peers.h revision 8d520ff1dc2da35cdca849e982051b86468016d8
1/*
2 * wpa_gui - Peers class
3 * Copyright (c) 2009-2010, Atheros Communications
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
11 *
12 * See README and COPYING for more details.
13 */
14
15#ifndef PEERS_H
16#define PEERS_H
17
18#include <QObject>
19#include <QStandardItemModel>
20#include "wpamsg.h"
21#include "ui_peers.h"
22
23class WpaGui;
24
25class Peers : public QDialog, public Ui::Peers
26{
27	Q_OBJECT
28
29public:
30	Peers(QWidget *parent = 0, const char *name = 0,
31		    bool modal = false, Qt::WFlags fl = 0);
32	~Peers();
33	void setWpaGui(WpaGui *_wpagui);
34	void event_notify(WpaMsg msg);
35
36public slots:
37	virtual void context_menu(const QPoint &pos);
38	virtual void enter_pin();
39	virtual void connect_pbc();
40	virtual void learn_ap_config();
41	virtual void ctx_refresh();
42	virtual void ctx_p2p_start();
43	virtual void ctx_p2p_stop();
44	virtual void ctx_p2p_listen();
45	virtual void ctx_p2p_start_group();
46	virtual void ctx_p2p_remove_group();
47	virtual void ctx_p2p_connect();
48	virtual void ctx_p2p_req_pin();
49	virtual void ctx_p2p_show_pin();
50	virtual void ctx_p2p_display_pin();
51	virtual void ctx_p2p_display_pin_pd();
52	virtual void ctx_p2p_enter_pin();
53	virtual void properties();
54	virtual void ctx_hide_ap();
55	virtual void ctx_show_ap();
56	virtual void ctx_p2p_show_passphrase();
57	virtual void ctx_p2p_start_persistent();
58	virtual void ctx_p2p_invite();
59	virtual void ctx_p2p_delete();
60
61protected slots:
62	virtual void languageChange();
63	virtual void closeEvent(QCloseEvent *event);
64
65private:
66	void add_station(QString info);
67	void add_stations();
68	void add_single_station(const char *addr);
69	bool add_bss(const char *cmd);
70	void remove_bss(int id);
71	void add_scan_results();
72	void add_persistent(int id, const char *ssid, const char *bssid);
73	void add_persistent_groups();
74	void update_peers();
75	QStandardItem * find_addr(QString addr);
76	QStandardItem * find_addr_type(QString addr, int type);
77	void add_p2p_group_client(QStandardItem *parent, QString params);
78	QStandardItem * find_uuid(QString uuid);
79	void done(int r);
80	void remove_enrollee_uuid(QString uuid);
81	QString ItemType(int type);
82	void enable_persistent(int id);
83
84	WpaGui *wpagui;
85	QStandardItemModel model;
86	QIcon *default_icon;
87	QIcon *ap_icon;
88	QIcon *laptop_icon;
89	QIcon *group_icon;
90	QIcon *invitation_icon;
91	QStandardItem *ctx_item;
92
93	bool hide_ap;
94};
95
96#endif /* PEERS_H */
97