summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interfaceinformationimp.h12
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.h12
-rw-r--r--noncore/settings/networksettings/module.h77
-rw-r--r--noncore/settings/networksettings/ppp/pppmodule.cpp2
4 files changed, 88 insertions, 15 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformationimp.h b/noncore/settings/networksettings/interfaces/interfaceinformationimp.h
index 9c93d1d..03da736 100644
--- a/noncore/settings/networksettings/interfaces/interfaceinformationimp.h
+++ b/noncore/settings/networksettings/interfaces/interfaceinformationimp.h
@@ -1,17 +1,21 @@
1#ifndef INTERFACEINFORMATIONIMP_H 1#ifndef INTERFACEINFORMATIONIMP_H
2#define INTERFACEINFORMATIONIMP_H 2#define INTERFACEINFORMATIONIMP_H
3 3
4#include "interfaceinformation.h" 4#include "interfaceinformation.h"
5#include "interface.h" 5#include "interface.h"
6 6
7/**
8 * This widget just shows some generic information about the
9 * given Interface. IP Addresses and such will be shown.
10 */
7class InterfaceInformationImp : public InterfaceInformation { 11class InterfaceInformationImp : public InterfaceInformation {
8 12
9Q_OBJECT 13Q_OBJECT
10 14
11public: 15public:
12 InterfaceInformationImp(QWidget *parent=0, const char *name=0, Interface *i=0, WFlags f=0); 16 InterfaceInformationImp(QWidget *parent=0, const char *name=0, Interface *i=0, WFlags f=0);
13 ~InterfaceInformationImp(); 17 ~InterfaceInformationImp();
14 18
15private slots: 19private slots:
16 void advanced(); 20 void advanced();
17 void updateInterface(Interface *i); 21 void updateInterface(Interface *i);
@@ -19,7 +23,7 @@ private slots:
19 23
20private: 24private:
21 Interface *interface; 25 Interface *interface;
22 26
23}; 27};
24 28
25#endif 29#endif
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.h b/noncore/settings/networksettings/interfaces/interfacesetupimp.h
index 172da6a..f38fba5 100644
--- a/noncore/settings/networksettings/interfaces/interfacesetupimp.h
+++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.h
@@ -7,14 +7,20 @@
7 7
8class Interface; 8class Interface;
9 9
10/**
11 * A default implementation for setting up basic
12 * network config. Like DHCP, IP and other information.
13 * You can use it in a tab or in any other way*
14 * On saveChanges() it'll save the changes to Interfaces.
15 */
10class InterfaceSetupImp : public InterfaceSetup { 16class InterfaceSetupImp : public InterfaceSetup {
11 Q_OBJECT 17 Q_OBJECT
12 18
13public: 19public:
14 InterfaceSetupImp( QWidget* parent = 0, const char* name = 0, Interface *i = 0, Interfaces *j = 0, WFlags fl = 0); 20 InterfaceSetupImp( QWidget* parent = 0, const char* name = 0, Interface *i = 0, Interfaces *j = 0, WFlags fl = 0);
15 ~InterfaceSetupImp(); 21 ~InterfaceSetupImp();
16 bool saveChanges(); 22 bool saveChanges();
17 23
18public slots: 24public slots:
19 void setProfile(const QString &profile); 25 void setProfile(const QString &profile);
20 bool saveSettings(); 26 bool saveSettings();
@@ -31,7 +37,7 @@ private:
31 37
32class InterfaceSetupImpDialog : public QDialog { 38class InterfaceSetupImpDialog : public QDialog {
33Q_OBJECT 39Q_OBJECT
34 40
35public: 41public:
36 InterfaceSetupImpDialog(QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = false, WFlags fl = 0) : QDialog(parent, name, modal, fl){ 42 InterfaceSetupImpDialog(QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = false, WFlags fl = 0) : QDialog(parent, name, modal, fl){
37 QVBoxLayout *InterfaceSetupLayout = new QVBoxLayout( this ); 43 QVBoxLayout *InterfaceSetupLayout = new QVBoxLayout( this );
diff --git a/noncore/settings/networksettings/module.h b/noncore/settings/networksettings/module.h
index 5cc82cd..3ef823c 100644
--- a/noncore/settings/networksettings/module.h
+++ b/noncore/settings/networksettings/module.h
@@ -13,9 +13,47 @@
13class QWidget; 13class QWidget;
14class QTabWidget; 14class QTabWidget;
15 15
16class Module : QObject{ 16
17/**
18 * \brief The basis of all plugins
19 *
20 * This is the way to extend networksettings with
21 * extra functionality.
22 *
23 *
24 * Networksettings in the 1.0 release does not use QCOM
25 * for activation. You need to provide the following function yourself.
26 *
27 * A module needs to provide Name, Images, and methods for
28 * claiming interfaces. For example you can claim physicla
29 * interfaces like wlan0, ppp0 or virtual like a VPN
30 * connection and hide the real ppp device or ethernet device
31 * behind your VPN plugin.
32 *
33 * During start up. The main application searches for network devices
34 * and then looks for an owner under the plugins for them.
35 * For example the WLAN Plugin looks if there is a WLAN Extension
36 * on that interface and then claims it by returning true from isOwner()
37 *
38 * \code
39 * extern "C"
40 * {
41 * void* create_plugin() {
42 * return new WLANModule();
43 * }
44 * };
45 * \endcode
46 * @see isOwner(Interface*)
47 */
48class Module : private QObject{
17 49
18signals: 50signals:
51/**
52 * Emit this Signal once you change the Interface
53 * you're operating on
54 *
55 * @param i The Interface
56 */
19 void updateInterface(Interface *i); 57 void updateInterface(Interface *i);
20 58
21 59
@@ -24,13 +62,15 @@ public:
24 62
25 /** 63 /**
26 * The type of the plugin 64 * The type of the plugin
27 * and the name of the dcop call 65 * and the name of the qcop call
28 */ 66 */
29 virtual const QString type() = 0; 67 virtual const QString type() = 0;
30 68
31 /** 69 /**
32 * The current profile has been changed and the module should do any 70 * The current profile has been changed and the module should do any
33 * neccesary changes also. 71 * neccesary changes also.
72 * As of Opie1.0 profiles are disabled.
73 *
34 * @param newProfile what the profile should be changed to. 74 * @param newProfile what the profile should be changed to.
35 */ 75 */
36 virtual void setProfile(const QString &newProfile) = 0; 76 virtual void setProfile(const QString &newProfile) = 0;
@@ -44,27 +84,38 @@ public:
44 84
45 /** 85 /**
46 * Check to see if the interface i is owned by this module. 86 * Check to see if the interface i is owned by this module.
87 * See if you can handle it. And if you can claim ownership
88 * by returning true.
47 * @param Interface* interface to check against 89 * @param Interface* interface to check against
48 * @return bool true if i is owned by this module, false otherwise. 90 * @return bool true if i is owned by this module, false otherwise.
49 */ 91 */
50 virtual bool isOwner(Interface *){ return false; }; 92 virtual bool isOwner(Interface *){ return false; };
51 93
52 /** 94 /**
53 * Create and return the WLANConfigure Module 95 * Create and return the Configure Module
54 * @param Interface *i the interface to configure. 96 * @param Interface *i the interface to configure.
55 * @return QWidget* pointer to this modules configure. 97 * @return QWidget* pointer to this modules configure.
98 *
99 * @see InterfaceSetupImp
56 */ 100 */
57 virtual QWidget *configure(Interface *){ return NULL; } ; 101 virtual QWidget *configure(Interface *){ return NULL; } ;
58 102
59 /** 103 /**
60 * Create, and return the Information Module 104 * Create, and return the Information Module.
105 *
106 * An default Implementation is InterfaceInformationImp
107 *
61 * @param Interface *i the interface to get info on. 108 * @param Interface *i the interface to get info on.
62 * @return QWidget* pointer to this modules info. 109 * @return QWidget* pointer to this modules info.
110 *
111 * @see InterfaceInformationImp
112 *
63 */ 113 */
64 virtual QWidget *information(Interface *){ return NULL; }; 114 virtual QWidget *information(Interface *){ return NULL; };
65 115
66 /** 116 /**
67 * Get all active (up or down) interfaces 117 * Get all active (up or down) interfaces managed by this
118 * module.
68 * @return QList<Interface> A list of interfaces that exsist that havn't 119 * @return QList<Interface> A list of interfaces that exsist that havn't
69 * been called by isOwner() 120 * been called by isOwner()
70 */ 121 */
@@ -73,13 +124,25 @@ public:
73 /** 124 /**
74 * Adds possible new interfaces to the list (Example: usb(ppp), ir(ppp), 125 * Adds possible new interfaces to the list (Example: usb(ppp), ir(ppp),
75 * modem ppp) 126 * modem ppp)
127 * Both strings need to be translated. The first string is a Shortcut
128 * like PPP and the second argument is a description.
129 *
130 * <code>
131 * list.insert(
132 *
133 * </code>
134 *
135 * @param list A reference to the list of supported additionns.
76 */ 136 */
77 virtual void possibleNewInterfaces(QMap<QString, QString> &list) = 0; 137 virtual void possibleNewInterfaces(QMap<QString, QString> &list) = 0;
78 138
79 /** 139 /**
80 * Attempts to create a new interface from name 140 * Attempts to create a new interface from name you gave
141 * possibleNewInterfaces()
81 * @return Interface* NULL if it was unable to be created. 142 * @return Interface* NULL if it was unable to be created.
82 * @param name the type of interface to create 143 * @param name the type of interface to create
144 *
145 * @see possibleNewInterfaces
83 */ 146 */
84 virtual Interface *addNewInterface(const QString &name) = 0; 147 virtual Interface *addNewInterface(const QString &name) = 0;
85 148
@@ -99,7 +162,7 @@ protected:
99 /** 162 /**
100 * set which interfaceNames should not be shown cause they're handled 163 * set which interfaceNames should not be shown cause they're handled
101 * internally of this module.. An already running ppp link or 164 * internally of this module.. An already running ppp link or
102 * a tunnel... 165 * a tunnel... VPN an such
103 */ 166 */
104 void setHandledInterfaceNames( const QStringList& in) { m_inter = in; } 167 void setHandledInterfaceNames( const QStringList& in) { m_inter = in; }
105 168
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp
index 2462fa4..f7dacf6 100644
--- a/noncore/settings/networksettings/ppp/pppmodule.cpp
+++ b/noncore/settings/networksettings/ppp/pppmodule.cpp
@@ -127,7 +127,7 @@ QWidget *PPPModule::configure(Interface *i){
127 qDebug("return ModemWidget"); 127 qDebug("return ModemWidget");
128 PPPConfigWidget *pppconfig = new PPPConfigWidget( (InterfacePPP*)i, 128 PPPConfigWidget *pppconfig = new PPPConfigWidget( (InterfacePPP*)i,
129 0, "PPPConfig", false, 129 0, "PPPConfig", false,
130 Qt::WDestructiveClose | Qt::WStyle_ContextHelp); 130 (Qt::WDestructiveClose | Qt::WStyle_ContextHelp));
131 return pppconfig; 131 return pppconfig;
132} 132}
133 133