Networksettings API API Documentation

Module Class Reference

The basis of all plugins. More...

#include <module.h>

Inheritance diagram for Module:

Inheritance graph
[legend]
Collaboration diagram for Module:

Collaboration graph
[legend]
List of all members.

Signals

void updateInterface (Interface *i)
 Emit this Signal once you change the Interface you're operating on.


Public Member Functions

virtual const QString type ()=0
 The type of the plugin and the name of the qcop call.

virtual void setProfile (const QString &newProfile)=0
 The current profile has been changed and the module should do any neccesary changes also.

virtual QString getPixmapName (Interface *)=0
 get the icon name for this device.

virtual bool isOwner (Interface *)
 Check to see if the interface i is owned by this module.

virtual QWidgetconfigure (Interface *)
 Create and return the Configure Module.

virtual QWidgetinformation (Interface *)
 Create, and return the Information Module.

virtual QList< InterfacegetInterfaces ()=0
 Get all active (up or down) interfaces managed by this module.

virtual void possibleNewInterfaces (QMap< QString, QString > &list)=0
 Adds possible new interfaces to the list (Example: usb(ppp), ir(ppp), modem ppp) Both strings need to be translated.

virtual InterfaceaddNewInterface (const QString &name)=0
 Attempts to create a new interface from name you gave possibleNewInterfaces().

virtual bool remove (Interface *i)=0
 Attempts to remove the interface, doesn't delete i.

virtual void receive (const QCString &msg, const QByteArray &arg)=0
 get dcop calls

QStringList handledInterfaceNames () const

Protected Member Functions

void setHandledInterfaceNames (const QStringList &in)
 set which interfaceNames should not be shown cause they're handled internally of this module..


Detailed Description

The basis of all plugins.

This is the way to extend networksettings with extra functionality.

Networksettings in the 1.0 release does not use QCOM for activation. You need to provide the following function yourself.

A module needs to provide Name, Images, and methods for claiming interfaces. For example you can claim physicla interfaces like wlan0, ppp0 or virtual like a VPN connection and hide the real ppp device or ethernet device behind your VPN plugin.

During start up. The main application searches for network devices and then looks for an owner under the plugins for them. For example the WLAN Plugin looks if there is a WLAN Extension on that interface and then claims it by returning true from isOwner()

 extern "C"
  {
   void* create_plugin() {
   return new WLANModule();
 }
 };
See also:
isOwner(Interface*)

Definition at line 48 of file module.h.


Member Function Documentation

void Module::updateInterface Interface i  )  [signal]
 

Emit this Signal once you change the Interface you're operating on.

Parameters:
i The Interface

virtual const QString Module::type  )  [pure virtual]
 

The type of the plugin and the name of the qcop call.

virtual void Module::setProfile const QString newProfile  )  [pure virtual]
 

The current profile has been changed and the module should do any neccesary changes also.

As of Opie1.0 profiles are disabled.

Parameters:
newProfile what the profile should be changed to.

virtual QString Module::getPixmapName Interface  )  [pure virtual]
 

get the icon name for this device.

Parameters:
Interface* can be used in determining the icon.
Returns:
QString the icon name (minus .png, .gif etc)

virtual bool Module::isOwner Interface  )  [inline, virtual]
 

Check to see if the interface i is owned by this module.

See if you can handle it. And if you can claim ownership by returning true. For physical devices you will be asked if you want to own the device. But you can also create new

See also:
Interface Implementations.
If you want to own the Interface add it to your internal interface list

Parameters:
Interface* interface to check against
Returns:
bool true if i is owned by this module, false otherwise.
See also:
getInterfaces

Definition at line 100 of file module.h.

virtual QWidget* Module::configure Interface  )  [inline, virtual]
 

Create and return the Configure Module.

Parameters:
Interface *i the interface to configure.
Returns:
QWidget* pointer to this modules configure.
See also:
InterfaceSetupImp

Definition at line 109 of file module.h.

virtual QWidget* Module::information Interface  )  [inline, virtual]
 

Create, and return the Information Module.

An default Implementation is InterfaceInformationImp

Parameters:
Interface *i the interface to get info on.
Returns:
QWidget* pointer to this modules info.
See also:
InterfaceInformationImp

Definition at line 122 of file module.h.

virtual QList<Interface> Module::getInterfaces  )  [pure virtual]
 

Get all active (up or down) interfaces managed by this module.

At the end of initialisation you will be asked to return your interfaces Return all of your interfaces even the ones you claimed by isOnwer. Here you can also return your 'virtual' Interface Objects

Returns:
QList<Interface> A list of interfaces that exsist that havn't been called by isOwner()

virtual void Module::possibleNewInterfaces QMap< QString, QString > &  list  )  [pure virtual]
 

Adds possible new interfaces to the list (Example: usb(ppp), ir(ppp), modem ppp) Both strings need to be translated.

The first string is a Shortcut like PPP and the second argument is a description.

list.insert(

Parameters:
list A reference to the list of supported additionns.

virtual Interface* Module::addNewInterface const QString name  )  [pure virtual]
 

Attempts to create a new interface from name you gave possibleNewInterfaces().

Returns:
Interface* NULL if it was unable to be created.
Parameters:
name the type of interface to create
See also:
possibleNewInterfaces

virtual bool Module::remove Interface i  )  [pure virtual]
 

Attempts to remove the interface, doesn't delete i.

Returns:
bool true if successful, false otherwise.

virtual void Module::receive const QCString msg,
const QByteArray arg
[pure virtual]
 

get dcop calls

void Module::setHandledInterfaceNames const QStringList in  )  [inline, protected]
 

set which interfaceNames should not be shown cause they're handled internally of this module..

An already running ppp link or a tunnel... VPN an such

Definition at line 179 of file module.h.


The documentation for this class was generated from the following file:
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:47 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001