aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_gui-qt4/peers.h
blob: bb7373749c2fc7cd3959b734adfeb17c57b20282 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
 * wpa_gui - Peers class
 * Copyright (c) 2009-2010, Atheros Communications
 *
 * This software may be distributed under the terms of the BSD license.
 * See README for more details.
 */

#ifndef PEERS_H
#define PEERS_H

#include <QObject>
#include <QStandardItemModel>
#include "wpamsg.h"
#include "ui_peers.h"

class WpaGui;

class Peers : public QDialog, public Ui::Peers
{
	Q_OBJECT

public:
	Peers(QWidget *parent = 0, const char *name = 0,
		    bool modal = false, Qt::WindowFlags fl = 0);
	~Peers();
	void setWpaGui(WpaGui *_wpagui);
	void event_notify(WpaMsg msg);

public slots:
	virtual void context_menu(const QPoint &pos);
	virtual void enter_pin();
	virtual void connect_pbc();
	virtual void learn_ap_config();
	virtual void ctx_refresh();
	virtual void ctx_p2p_start();
	virtual void ctx_p2p_stop();
	virtual void ctx_p2p_listen();
	virtual void ctx_p2p_start_group();
	virtual void ctx_p2p_remove_group();
	virtual void ctx_p2p_connect();
	virtual void ctx_p2p_req_pin();
	virtual void ctx_p2p_show_pin();
	virtual void ctx_p2p_display_pin();
	virtual void ctx_p2p_display_pin_pd();
	virtual void ctx_p2p_enter_pin();
	virtual void properties();
	virtual void ctx_hide_ap();
	virtual void ctx_show_ap();
	virtual void ctx_p2p_show_passphrase();
	virtual void ctx_p2p_start_persistent();
	virtual void ctx_p2p_invite();
	virtual void ctx_p2p_delete();

protected slots:
	virtual void languageChange();
	virtual void closeEvent(QCloseEvent *event);

private:
	void add_station(QString info);
	void add_stations();
	void add_single_station(const char *addr);
	bool add_bss(const char *cmd);
	void remove_bss(int id);
	void add_scan_results();
	void add_persistent(int id, const char *ssid, const char *bssid);
	void add_persistent_groups();
	void update_peers();
	QStandardItem * find_addr(QString addr);
	QStandardItem * find_addr_type(QString addr, int type);
	void add_p2p_group_client(QStandardItem *parent, QString params);
	QStandardItem * find_uuid(QString uuid);
	void done(int r);
	void remove_enrollee_uuid(QString uuid);
	QString ItemType(int type);
	void enable_persistent(int id);

	WpaGui *wpagui;
	QStandardItemModel model;
	QIcon *default_icon;
	QIcon *ap_icon;
	QIcon *laptop_icon;
	QIcon *group_icon;
	QIcon *invitation_icon;
	QStandardItem *ctx_item;

	bool hide_ap;
};

#endif /* PEERS_H */