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