00001 /********************************************************************** 00002 ** Copyright (C) 2002 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> 00003 ** All rights reserved. 00004 ** 00005 ** This file may be distributed and/or modified under the terms of the 00006 ** GNU General Public License version 2 as published by the Free Software 00007 ** Foundation and appearing in the file LICENSE.GPL included in the 00008 ** packaging of this file. 00009 ** 00010 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00011 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00012 ** 00013 **********************************************************************/ 00014 00015 #ifndef __WIRELESS_APPLET_H__ 00016 #define __WIRELESS_APPLET_H__ 00017 00018 #include <qwidget.h> 00019 #include <qframe.h> 00020 #include <qpixmap.h> 00021 00022 namespace Opie {namespace Net { 00023 class OWirelessNetworkInterface; 00024 } 00025 } 00026 class Y; 00027 class QLabel; 00028 class WirelessApplet; 00029 class MGraph; 00030 00031 class WirelessControl : public QFrame 00032 { 00033 Q_OBJECT 00034 public: 00035 WirelessControl( WirelessApplet* icon, QWidget *parent=0, const char *name=0 ); 00036 void show( bool ); 00037 00038 void readConfig(); 00039 void writeConfigEntry( const char* entry, int val ); 00040 00041 MGraph* mgraph; 00042 QLabel* statusLabel; 00043 QLabel* updateLabel; 00044 00045 public slots: 00046 void updateDelayChange( int ); 00047 void displayStyleChange( int ); 00048 void advancedConfigClicked(); 00049 00050 private: 00051 WirelessApplet* applet; 00052 00053 int updateFrequency; 00054 00055 bool rocESSID; 00056 bool rocFREQ; 00057 bool rocAP; 00058 bool rocMODE; 00059 }; 00060 00061 class WirelessApplet : public QWidget 00062 { 00063 Q_OBJECT 00064 public: 00065 WirelessApplet( QWidget *parent = 0, const char *name=0 ); 00066 ~WirelessApplet(); 00067 static int position(); 00068 WirelessControl* status; 00069 00070 virtual void timerEvent( QTimerEvent* ); 00071 void updateDelayChange( int delay ); 00072 void displayStyleChange( int style ); 00073 00074 void updateDHCPConfig( bool, bool, bool, bool ); 00075 00076 private: 00077 void mousePressEvent( QMouseEvent * ); 00078 void paintEvent( QPaintEvent* ); 00079 void checkInterface(); 00080 void renewDHCP(); 00081 00082 bool mustRepaint(); 00083 void updatePopupWindow(); 00084 int numberOfRings(); 00085 00086 private: 00087 QPixmap snapshotPixmap; 00088 int visualStyle; 00089 int timer; 00090 00091 Opie::Net::OWirelessNetworkInterface* interface; 00092 00093 private: 00094 int oldrings; 00095 Opie::Net::OWirelessNetworkInterface* oldiface; 00096 int oldqualityH; 00097 int oldsignalH; 00098 int oldnoiseH; 00099 00100 QString oldESSID; 00101 QString oldAP; 00102 QString oldMODE; 00103 double oldFREQ; 00104 00105 bool rocESSID; 00106 bool rocFREQ; 00107 bool rocAP; 00108 bool rocMODE; 00109 }; 00110 00111 #endif // __WIRELESS_APPLET_H__ 00112
1.4.2