Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

interface.h

Go to the documentation of this file.
00001 #ifndef INTERFACE_H
00002 #define INTERFACE_H
00003 
00004 #include <qstring.h>
00005 #include <qobject.h>
00006 
00007 class Module;
00008 
00016 class Interface : public QObject{
00017   Q_OBJECT
00018 
00019 signals:
00020   void updateInterface(Interface *i);
00021   void updateMessage(const QString &message);
00022 
00023 public:
00024   Interface(QObject * parent=0, const char * name= "unknown", bool status = false);
00025 
00026   QString getInterfaceName() const { QString n(this->name()); return n; };
00027   void setInterfaceName( const QString &n ) { this->setName(n); };
00028 
00029   bool getStatus() const { return status; };
00030   void setStatus(bool newStatus);
00031 
00032   bool isAttached() const { return attached; };
00033   void setAttached(bool isAttached=false);
00034 
00035   QString getHardwareName() const { return hardwareName; };
00036   void setHardwareName(const QString &name="Unknown");
00037 
00038   Module* getModuleOwner() const { return moduleOwner; };
00039   void setModuleOwner(Module *owner=NULL);
00040 
00041   // inet information.
00042   QString getMacAddress() const { return macAddress; };
00043   QString getIp() const { return ip; };
00044   QString getSubnetMask() const { return subnetMask; };
00045   QString getBroadcast() const { return broadcast; };
00046   bool isDhcp() const { return dhcp; };
00047   QString getDhcpServerIp() const { return dhcpServerIp; };
00048   QString getLeaseObtained() const { return leaseObtained; };
00049   QString getLeaseExpires() const { return leaseExpires; };
00050 
00051  public slots:
00052   virtual bool refresh();
00053   virtual void start();
00054   virtual void stop();
00055   virtual void restart();
00056 
00057 protected:
00058   bool callProcess( const QStringList& name );
00059   // Interface information
00060   QString hardwareName;
00061   Module *moduleOwner;
00062   bool status;
00063   bool attached;
00064 
00065   // Network information
00066   bool dhcp;
00067   QString dhcpServerIp;
00068   QString leaseObtained;
00069   QString leaseExpires;
00070 
00071   QString macAddress;
00072   QString ip;
00073   QString broadcast;
00074   QString subnetMask;
00075 
00076 };
00077 
00078 #endif
00079 
00080 // interface.h
00081 

Generated on Sat Nov 5 16:17:23 2005 for OPIE by  doxygen 1.4.2