summaryrefslogtreecommitdiff
path: root/noncore/applets/wirelessapplet/networkinfo.h
authormickeyl <mickeyl>2004-02-23 18:38:28 (UTC)
committer mickeyl <mickeyl>2004-02-23 18:38:28 (UTC)
commitd66f871dfeae78babeb1fa0b8a3e1c72dd10ea2b (patch) (unidiff)
tree224c86eb4ab72154365ae450ce517c559b363bf0 /noncore/applets/wirelessapplet/networkinfo.h
parent19b274033fc05d5190cee2fa974c683892173c84 (diff)
downloadopie-d66f871dfeae78babeb1fa0b8a3e1c72dd10ea2b.zip
opie-d66f871dfeae78babeb1fa0b8a3e1c72dd10ea2b.tar.gz
opie-d66f871dfeae78babeb1fa0b8a3e1c72dd10ea2b.tar.bz2
The wireless applet uses now libopie2net instead of its own routines.
Display mode "ANTENNA" is fixed, "BAR GRAPH" is still broken but will be removed anyway, since nearly everyone used "ANTENNA".
Diffstat (limited to 'noncore/applets/wirelessapplet/networkinfo.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/wirelessapplet/networkinfo.h126
1 files changed, 0 insertions, 126 deletions
diff --git a/noncore/applets/wirelessapplet/networkinfo.h b/noncore/applets/wirelessapplet/networkinfo.h
deleted file mode 100644
index 7e50bc4..0000000
--- a/noncore/applets/wirelessapplet/networkinfo.h
+++ b/dev/null
@@ -1,126 +0,0 @@
1/**********************************************************************
2** MNetwork* classes
3**
4** Encapsulates network information
5**
6** Copyright (C) 2002, Michael Lauer
7** mickey@tm.informatik.uni-frankfurt.de
8** http://www.Vanille.de
9**
10** This file may be distributed and/or modified under the terms of the
11** GNU General Public License version 2 as published by the Free Software
12** Foundation and appearing in the file LICENSE.GPL included in the
13** packaging of this file.
14**
15** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17**
18**********************************************************************/
19
20#ifndef NETWORKINFO_H
21#define NETWORKINFO_H
22
23#include <qstring.h>
24#include <qdict.h>
25
26//---------------------------------------------------------------------------
27// class MNetworkInterface
28//
29
30class MNetworkInterface
31{
32public:
33
34 MNetworkInterface( const char* name = "eth0" );
35 virtual ~MNetworkInterface();
36
37 bool isLoopback() { return isLoopbackInterface; };
38 const QString& getName() { return name; };
39
40 virtual bool updateStatistics();
41
42protected:
43
44 int fd;
45 const QString name;
46 bool isLoopbackInterface;
47 bool isIrda;
48 bool isTunnel;
49};
50
51//---------------------------------------------------------------------------
52// class MWirelessNetworkInterface
53//
54
55class MWirelessNetworkInterface : public MNetworkInterface
56{
57public:
58 MWirelessNetworkInterface( const char* name = "wlan0" );
59 virtual ~MWirelessNetworkInterface();
60
61 int noisePercent();
62 int qualityPercent();
63 int signalPercent();
64
65 QString APAddr;
66 QString essid;
67 QString mode;
68 QString nick;
69 QString rate;
70 double freq;
71 int channel;
72
73 virtual bool updateStatistics();
74
75private:
76 int quality;
77 int signal;
78 int noise;
79
80 bool hasWirelessExtensions;
81};
82
83//---------------------------------------------------------------------------
84// class MNetwork
85//
86
87class MNetwork
88{
89public:
90 MNetwork();
91 virtual ~MNetwork();
92
93 typedef QDict<MNetworkInterface> InterfaceMap;
94 typedef QDictIterator<MNetworkInterface> InterfaceMapIterator;
95
96 bool hasInterfaces() const { return interfaces.isEmpty(); };
97 int numInterfaces() const { return interfaces.count(); };
98
99 MNetworkInterface* getFirstInterface();
100
101protected:
102 QString procfile;
103 InterfaceMap interfaces;
104
105 virtual MNetworkInterface* createInterface( const char* name ) const;
106
107private:
108 void enumerateInterfaces();
109};
110
111//---------------------------------------------------------------------------
112// class MWirelessNetwork
113//
114
115class MWirelessNetwork : public MNetwork
116{
117public:
118 MWirelessNetwork();
119 virtual ~MWirelessNetwork();
120
121protected:
122 virtual MNetworkInterface* createInterface( const char* name )
123 const;
124};
125
126#endif