Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / network / WirelessManager / wpa_supplicant / wpa_gui-qt4 / wpagui.h
blob2e1af8e776193844c449154919ec6f1fb8393a6f
1 /*
2 * wpa_gui - WpaGui class
3 * Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
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.
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
12 * See README and COPYING for more details.
15 #ifndef WPAGUI_H
16 #define WPAGUI_H
18 #include <QSystemTrayIcon>
19 #include <QObject>
20 #include "ui_wpagui.h"
21 #include "addinterface.h"
23 class UserDataRequest;
26 class WpaGui : public QMainWindow, public Ui::WpaGui
28 Q_OBJECT
30 public:
31 WpaGui(QApplication *app, QWidget *parent = 0, const char *name = 0,
32 Qt::WFlags fl = 0);
33 ~WpaGui();
35 virtual int ctrlRequest(const char *cmd, char *buf, size_t *buflen);
36 virtual void triggerUpdate();
37 virtual void editNetwork(const QString &sel);
38 virtual void removeNetwork(const QString &sel);
39 virtual void enableNetwork(const QString &sel);
40 virtual void disableNetwork(const QString &sel);
41 virtual int getNetworkDisabled(const QString &sel);
42 void setBssFromScan(const QString &bssid);
43 #ifndef QT_NO_SESSIONMANAGER
44 void saveState();
45 #endif
47 public slots:
48 virtual void parse_argv();
49 virtual void updateStatus();
50 virtual void updateNetworks();
51 virtual void helpIndex();
52 virtual void helpContents();
53 virtual void helpAbout();
54 virtual void disconnect();
55 virtual void scan();
56 virtual void eventHistory();
57 virtual void ping();
58 virtual void processMsg(char *msg);
59 virtual void processCtrlReq(const char *req);
60 virtual void receiveMsgs();
61 virtual void connectB();
62 virtual void selectNetwork(const QString &sel);
63 virtual void editSelectedNetwork();
64 virtual void editListedNetwork();
65 virtual void removeSelectedNetwork();
66 virtual void removeListedNetwork();
67 virtual void addNetwork();
68 virtual void enableAllNetworks();
69 virtual void disableAllNetworks();
70 virtual void removeAllNetworks();
71 virtual void saveConfig();
72 virtual void selectAdapter(const QString &sel);
73 virtual void updateNetworkDisabledStatus();
74 virtual void enableListedNetwork(bool);
75 virtual void disableListedNetwork(bool);
76 virtual void showTrayMessage(QSystemTrayIcon::MessageIcon type,
77 int sec, const QString &msg);
78 virtual void showTrayStatus();
79 virtual void wpsDialog();
80 virtual void peersDialog();
81 virtual void tabChanged(int index);
82 virtual void wpsPbc();
83 virtual void wpsGeneratePin();
84 virtual void wpsApPinChanged(const QString &text);
85 virtual void wpsApPin();
86 #ifdef CONFIG_NATIVE_WINDOWS
87 virtual void startService();
88 virtual void stopService();
89 #endif /* CONFIG_NATIVE_WINDOWS */
90 virtual void addInterface();
92 protected slots:
93 virtual void languageChange();
94 virtual void trayActivated(QSystemTrayIcon::ActivationReason how);
95 virtual void closeEvent(QCloseEvent *event);
97 private:
98 ScanResults *scanres;
99 Peers *peers;
100 bool networkMayHaveChanged;
101 char *ctrl_iface;
102 EventHistory *eh;
103 struct wpa_ctrl *ctrl_conn;
104 QSocketNotifier *msgNotifier;
105 QTimer *timer;
106 int pingsToStatusUpdate;
107 WpaMsgList msgs;
108 char *ctrl_iface_dir;
109 struct wpa_ctrl *monitor_conn;
110 UserDataRequest *udr;
111 QAction *disconnectAction;
112 QAction *reconnectAction;
113 QAction *eventAction;
114 QAction *scanAction;
115 QAction *statAction;
116 QAction *showAction;
117 QAction *hideAction;
118 QAction *quitAction;
119 QMenu *tray_menu;
120 QSystemTrayIcon *tray_icon;
121 QString wpaStateTranslate(char *state);
122 void createTrayIcon(bool);
123 bool ackTrayIcon;
124 bool startInTray;
126 int openCtrlConnection(const char *ifname);
128 bool wpsRunning;
130 QString bssFromScan;
132 void stopWpsRun(bool success);
134 #ifdef CONFIG_NATIVE_WINDOWS
135 QAction *fileStartServiceAction;
136 QAction *fileStopServiceAction;
138 bool serviceRunning();
139 #endif /* CONFIG_NATIVE_WINDOWS */
141 QAction *addInterfaceAction;
142 AddInterface *add_iface;
144 bool connectedToService;
146 QApplication *app;
147 bool inTray;
150 #endif /* WPAGUI_H */