Diffstat (limited to 'noncore/settings/networksettings/interfaces/interface.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/interfaces/interface.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/noncore/settings/networksettings/interfaces/interface.h b/noncore/settings/networksettings/interfaces/interface.h index ec82851..83ab088 100644 --- a/noncore/settings/networksettings/interfaces/interface.h +++ b/noncore/settings/networksettings/interfaces/interface.h | |||
@@ -1,73 +1,80 @@ | |||
1 | #ifndef INTERFACE_H | 1 | #ifndef INTERFACE_H |
2 | #define INTERFACE_H | 2 | #define INTERFACE_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qobject.h> | 5 | #include <qobject.h> |
6 | 6 | ||
7 | class Module; | 7 | class Module; |
8 | 8 | ||
9 | /** | ||
10 | * A Interface represents a physical device. You can | ||
11 | * inherit it and create also virtual devices. Like saved | ||
12 | * ppp dial ups or vpn. Interface is used for representing | ||
13 | * your interface to the User and its actions. | ||
14 | * | ||
15 | */ | ||
9 | class Interface : public QObject{ | 16 | class Interface : public QObject{ |
10 | Q_OBJECT | 17 | Q_OBJECT |
11 | 18 | ||
12 | signals: | 19 | signals: |
13 | void updateInterface(Interface *i); | 20 | void updateInterface(Interface *i); |
14 | void updateMessage(const QString &message); | 21 | void updateMessage(const QString &message); |
15 | 22 | ||
16 | public: | 23 | public: |
17 | Interface(QObject * parent=0, const char * name= "unknown", bool status = false); | 24 | Interface(QObject * parent=0, const char * name= "unknown", bool status = false); |
18 | 25 | ||
19 | QString getInterfaceName() const { QString n(this->name()); return n; }; | 26 | QString getInterfaceName() const { QString n(this->name()); return n; }; |
20 | void setInterfaceName( const QString &n ) { this->setName(n); }; | 27 | void setInterfaceName( const QString &n ) { this->setName(n); }; |
21 | 28 | ||
22 | bool getStatus() const { return status; }; | 29 | bool getStatus() const { return status; }; |
23 | void setStatus(bool newStatus); | 30 | void setStatus(bool newStatus); |
24 | 31 | ||
25 | bool isAttached() const { return attached; }; | 32 | bool isAttached() const { return attached; }; |
26 | void setAttached(bool isAttached=false); | 33 | void setAttached(bool isAttached=false); |
27 | 34 | ||
28 | QString getHardwareName() const { return hardwareName; }; | 35 | QString getHardwareName() const { return hardwareName; }; |
29 | void setHardwareName(const QString &name="Unknown"); | 36 | void setHardwareName(const QString &name="Unknown"); |
30 | 37 | ||
31 | Module* getModuleOwner() const { return moduleOwner; }; | 38 | Module* getModuleOwner() const { return moduleOwner; }; |
32 | void setModuleOwner(Module *owner=NULL); | 39 | void setModuleOwner(Module *owner=NULL); |
33 | 40 | ||
34 | // inet information. | 41 | // inet information. |
35 | QString getMacAddress() const { return macAddress; }; | 42 | QString getMacAddress() const { return macAddress; }; |
36 | QString getIp() const { return ip; }; | 43 | QString getIp() const { return ip; }; |
37 | QString getSubnetMask() const { return subnetMask; }; | 44 | QString getSubnetMask() const { return subnetMask; }; |
38 | QString getBroadcast() const { return broadcast; }; | 45 | QString getBroadcast() const { return broadcast; }; |
39 | bool isDhcp() const { return dhcp; }; | 46 | bool isDhcp() const { return dhcp; }; |
40 | QString getDhcpServerIp() const { return dhcpServerIp; }; | 47 | QString getDhcpServerIp() const { return dhcpServerIp; }; |
41 | QString getLeaseObtained() const { return leaseObtained; }; | 48 | QString getLeaseObtained() const { return leaseObtained; }; |
42 | QString getLeaseExpires() const { return leaseExpires; }; | 49 | QString getLeaseExpires() const { return leaseExpires; }; |
43 | 50 | ||
44 | public slots: | 51 | public slots: |
45 | virtual bool refresh(); | 52 | virtual bool refresh(); |
46 | virtual void start(); | 53 | virtual void start(); |
47 | virtual void stop(); | 54 | virtual void stop(); |
48 | virtual void restart(); | 55 | virtual void restart(); |
49 | 56 | ||
50 | protected: | 57 | protected: |
51 | // Interface information | 58 | // Interface information |
52 | QString hardwareName; | 59 | QString hardwareName; |
53 | Module *moduleOwner; | 60 | Module *moduleOwner; |
54 | bool status; | 61 | bool status; |
55 | bool attached; | 62 | bool attached; |
56 | 63 | ||
57 | // Network information | 64 | // Network information |
58 | bool dhcp; | 65 | bool dhcp; |
59 | QString dhcpServerIp; | 66 | QString dhcpServerIp; |
60 | QString leaseObtained; | 67 | QString leaseObtained; |
61 | QString leaseExpires; | 68 | QString leaseExpires; |
62 | 69 | ||
63 | QString macAddress; | 70 | QString macAddress; |
64 | QString ip; | 71 | QString ip; |
65 | QString broadcast; | 72 | QString broadcast; |
66 | QString subnetMask; | 73 | QString subnetMask; |
67 | 74 | ||
68 | }; | 75 | }; |
69 | 76 | ||
70 | #endif | 77 | #endif |
71 | 78 | ||
72 | // interface.h | 79 | // interface.h |
73 | 80 | ||