Networksettings API API Documentation

Interface Class Reference

A Interface represents a physical device. More...

#include <interface.h>

Inheritance diagram for Interface:

Inheritance graph
[legend]
Collaboration diagram for Interface:

Collaboration graph
[legend]
List of all members.

Public Slots

virtual bool refresh ()
 Try to refresh the information about the interface.

virtual void start ()
 Try to start the interface.

virtual void stop ()
 Try to stop the interface.

virtual void restart ()
 Try to restart the interface.


Signals

void updateInterface (Interface *i)
void updateMessage (const QString &message)

Public Member Functions

 Interface (QObject *parent=0, const char *name="unknown", bool status=false)
QString getInterfaceName () const
void setInterfaceName (const QString &n)
bool getStatus () const
void setStatus (bool newStatus)
 Set status.

bool isAttached () const
void setAttached (bool isAttached=false)
 Set if attached or not (802.11 card pulled out for example).

QString getHardwareName () const
void setHardwareName (const QString &name="Unknown")
 Set Hardware name.

ModulegetModuleOwner () const
void setModuleOwner (Module *owner=NULL)
 Set Module owner.

QString getMacAddress () const
QString getIp () const
QString getSubnetMask () const
QString getBroadcast () const
bool isDhcp () const
QString getDhcpServerIp () const
QString getLeaseObtained () const
QString getLeaseExpires () const

Protected Attributes

QString hardwareName
ModulemoduleOwner
bool status
bool attached
bool dhcp
QString dhcpServerIp
QString leaseObtained
QString leaseExpires
QString macAddress
QString ip
QString broadcast
QString subnetMask

Detailed Description

A Interface represents a physical device.

You can inherit it and create also virtual devices. Like saved ppp dial ups or vpn. Interface is used for representing your interface to the User and its actions.

Definition at line 16 of file interface.h.


Member Function Documentation

void Interface::setStatus bool  newStatus  ) 
 

Set status.

Parameters:
newStatus - the new status emit updateInterface

Definition at line 28 of file interface.cpp.

References refresh().

void Interface::setAttached bool  isAttached = false  ) 
 

Set if attached or not (802.11 card pulled out for example).

Parameters:
isAttached - if attached emit updateInterface

Definition at line 40 of file interface.cpp.

void Interface::setHardwareName const QString name = "Unknown"  ) 
 

Set Hardware name.

Parameters:
name - the new name emit updateInterface

Definition at line 50 of file interface.cpp.

void Interface::setModuleOwner Module owner = NULL  ) 
 

Set Module owner.

Parameters:
owner - the new owner emit updateInterface

Definition at line 60 of file interface.cpp.

bool Interface::refresh  )  [virtual, slot]
 

Try to refresh the information about the interface.

First call ifconfig, then check the dhcp-info file

Returns:
bool true if successful.

Definition at line 122 of file interface.cpp.

References QDateTime::addSecs(), QString::arg(), QFile::close(), QString::contains(), QFile::exists(), QDir::exists(), QString::find(), QString::latin1(), QString::length(), QString::mid(), QFile::open(), QTextStream::readLine(), QFile::remove(), QTextStream::setDevice(), QFile::setName(), QString::toInt(), and QDateTime::toString().

Referenced by InterfaceSetupImp::saveChanges(), setStatus(), start(), and stop().

void Interface::start  )  [virtual, slot]
 

Try to start the interface.

Definition at line 69 of file interface.cpp.

References refresh().

Referenced by restart().

void Interface::stop  )  [virtual, slot]
 

Try to stop the interface.

Definition at line 91 of file interface.cpp.

References refresh().

Referenced by restart().

void Interface::restart  )  [virtual, slot]
 

Try to restart the interface.

Definition at line 112 of file interface.cpp.

References start(), and stop().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for OPIE Version 1.0.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:26:45 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001