Diffstat (limited to 'noncore/settings/networksettings/module.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/module.h | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/noncore/settings/networksettings/module.h b/noncore/settings/networksettings/module.h index db74394..f7d8046 100644 --- a/noncore/settings/networksettings/module.h +++ b/noncore/settings/networksettings/module.h | |||
@@ -1,102 +1,113 @@ | |||
1 | #ifndef NETCONF_MODULE_H | 1 | #ifndef NETCONF_MODULE_H |
2 | #define NETCONF_MODULE_H | 2 | #define NETCONF_MODULE_H |
3 | 3 | ||
4 | #include <qobject.h> | 4 | #include <qobject.h> |
5 | #if QT_VERSION < 300 | 5 | #if QT_VERSION < 300 |
6 | #include <qlist.h> | 6 | #include <qlist.h> |
7 | #else | 7 | #else |
8 | #include <qptrlist.h> | 8 | #include <qptrlist.h> |
9 | #endif | 9 | #endif |
10 | #include <qmap.h> | 10 | #include <qmap.h> |
11 | #include "interface.h" | 11 | #include "interface.h" |
12 | 12 | ||
13 | class QWidget; | 13 | class QWidget; |
14 | class QTabWidget; | 14 | class QTabWidget; |
15 | 15 | ||
16 | class Module : QObject{ | 16 | class Module : QObject{ |
17 | 17 | ||
18 | signals: | 18 | signals: |
19 | void updateInterface(Interface *i); | 19 | void updateInterface(Interface *i); |
20 | 20 | ||
21 | 21 | ||
22 | public: | 22 | public: |
23 | Module(){}; | 23 | Module(){}; |
24 | 24 | ||
25 | /** | 25 | /** |
26 | * The type of the plugin | 26 | * The type of the plugin |
27 | * and the name of the dcop call | 27 | * and the name of the dcop call |
28 | */ | 28 | */ |
29 | virtual const QString type() = 0; | 29 | virtual const QString type() = 0; |
30 | 30 | ||
31 | /** | 31 | /** |
32 | * The current profile has been changed and the module should do any | 32 | * The current profile has been changed and the module should do any |
33 | * neccesary changes also. | 33 | * neccesary changes also. |
34 | * @param newProfile what the profile should be changed to. | 34 | * @param newProfile what the profile should be changed to. |
35 | */ | 35 | */ |
36 | virtual void setProfile(const QString &newProfile) = 0; | 36 | virtual void setProfile(const QString &newProfile) = 0; |
37 | 37 | ||
38 | /** | 38 | /** |
39 | * get the icon name for this device. | 39 | * get the icon name for this device. |
40 | * @param Interface* can be used in determining the icon. | 40 | * @param Interface* can be used in determining the icon. |
41 | * @return QString the icon name (minus .png, .gif etc) | 41 | * @return QString the icon name (minus .png, .gif etc) |
42 | */ | 42 | */ |
43 | virtual QString getPixmapName(Interface *) = 0; | 43 | virtual QString getPixmapName(Interface *) = 0; |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * Check to see if the interface i is owned by this module. | 46 | * Check to see if the interface i is owned by this module. |
47 | * @param Interface* interface to check against | 47 | * @param Interface* interface to check against |
48 | * @return bool true if i is owned by this module, false otherwise. | 48 | * @return bool true if i is owned by this module, false otherwise. |
49 | */ | 49 | */ |
50 | virtual bool isOwner(Interface *){ return false; }; | 50 | virtual bool isOwner(Interface *){ return false; }; |
51 | 51 | ||
52 | /** | 52 | /** |
53 | * Create and return the WLANConfigure Module | 53 | * Create and return the WLANConfigure Module |
54 | * @param Interface *i the interface to configure. | 54 | * @param Interface *i the interface to configure. |
55 | * @return QWidget* pointer to this modules configure. | 55 | * @return QWidget* pointer to this modules configure. |
56 | */ | 56 | */ |
57 | virtual QWidget *configure(Interface *){ return NULL; } ; | 57 | virtual QWidget *configure(Interface *){ return NULL; } ; |
58 | 58 | ||
59 | /** | 59 | /** |
60 | * Create, and return the Information Module | 60 | * Create, and return the Information Module |
61 | * @param Interface *i the interface to get info on. | 61 | * @param Interface *i the interface to get info on. |
62 | * @return QWidget* pointer to this modules info. | 62 | * @return QWidget* pointer to this modules info. |
63 | */ | 63 | */ |
64 | virtual QWidget *information(Interface *){ return NULL; }; | 64 | virtual QWidget *information(Interface *){ return NULL; }; |
65 | 65 | ||
66 | /** | 66 | /** |
67 | * Get all active (up or down) interfaces | 67 | * Get all active (up or down) interfaces |
68 | * @return QList<Interface> A list of interfaces that exsist that havn't | 68 | * @return QList<Interface> A list of interfaces that exsist that havn't |
69 | * been called by isOwner() | 69 | * been called by isOwner() |
70 | */ | 70 | */ |
71 | virtual QList<Interface> getInterfaces() = 0; | 71 | virtual QList<Interface> getInterfaces() = 0; |
72 | 72 | ||
73 | /** | 73 | /** |
74 | * Adds possible new interfaces to the list (Example: usb(ppp), ir(ppp), | 74 | * Adds possible new interfaces to the list (Example: usb(ppp), ir(ppp), |
75 | * modem ppp) | 75 | * modem ppp) |
76 | */ | 76 | */ |
77 | virtual void possibleNewInterfaces(QMap<QString, QString> &list) = 0; | 77 | virtual void possibleNewInterfaces(QMap<QString, QString> &list) = 0; |
78 | 78 | ||
79 | /** | 79 | /** |
80 | * Attempts to create a new interface from name | 80 | * Attempts to create a new interface from name |
81 | * @return Interface* NULL if it was unable to be created. | 81 | * @return Interface* NULL if it was unable to be created. |
82 | * @param name the type of interface to create | 82 | * @param name the type of interface to create |
83 | */ | 83 | */ |
84 | virtual Interface *addNewInterface(const QString &name) = 0; | 84 | virtual Interface *addNewInterface(const QString &name) = 0; |
85 | 85 | ||
86 | /** | 86 | /** |
87 | * Attempts to remove the interface, doesn't delete i | 87 | * Attempts to remove the interface, doesn't delete i |
88 | * @return bool true if successfull, false otherwise. | 88 | * @return bool true if successfull, false otherwise. |
89 | */ | 89 | */ |
90 | virtual bool remove(Interface* i) = 0; | 90 | virtual bool remove(Interface* i) = 0; |
91 | 91 | ||
92 | /** | 92 | /** |
93 | * get dcop calls | 93 | * get dcop calls |
94 | */ | 94 | */ |
95 | virtual void receive(const QCString &msg, const QByteArray &arg) = 0; | 95 | virtual void receive(const QCString &msg, const QByteArray &arg) = 0; |
96 | 96 | ||
97 | QStringList handledInterfaceNames()const { return m_inter; } | ||
98 | protected: | ||
99 | /** | ||
100 | * set which interfaceNames should not be shown cause they're handled | ||
101 | * internally of this module.. An already running ppp link or | ||
102 | * a tunnel... | ||
103 | */ | ||
104 | void setHandledInterfaceNames( const QStringList& in) { m_inter = in; } | ||
105 | |||
106 | private: | ||
107 | QStringList m_inter; | ||
97 | }; | 108 | }; |
98 | 109 | ||
99 | #endif | 110 | #endif |
100 | 111 | ||
101 | // module.h | 112 | // module.h |
102 | 113 | ||