summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui/kcmodule.h
Unidiff
Diffstat (limited to 'microkde/kdeui/kcmodule.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdeui/kcmodule.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/microkde/kdeui/kcmodule.h b/microkde/kdeui/kcmodule.h
index 90a87c9..bc020bc 100644
--- a/microkde/kdeui/kcmodule.h
+++ b/microkde/kdeui/kcmodule.h
@@ -5,48 +5,49 @@
5 5
6 This library is free software; you can redistribute it and/or 6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public 7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either 8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version. 9 version 2 of the License, or (at your option) any later version.
10 10
11 This library is distributed in the hope that it will be useful, 11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20 20
21*/ 21*/
22#ifndef __KCMODULE_H__ 22#ifndef __KCMODULE_H__
23#define __KCMODULE_H__ 23#define __KCMODULE_H__
24 24
25#include <qwidget.h> 25#include <qwidget.h>
26#include <qstringlist.h> 26#include <qstringlist.h>
27//USclass KAboutData; 27//USclass KAboutData;
28class KCModulePrivate; 28class KCModulePrivate;
29class KPrefs;
29//US class KInstance; 30//US class KInstance;
30 31
31/** 32/**
32 * The base class for control center modules. 33 * The base class for control center modules.
33 * 34 *
34 * Starting from KDE 2.0, control center modules are realized as shared 35 * Starting from KDE 2.0, control center modules are realized as shared
35 * libraries that are loaded into the control center at runtime. 36 * libraries that are loaded into the control center at runtime.
36 * 37 *
37 * The module in principle is a simple widget displaying the 38 * The module in principle is a simple widget displaying the
38 * item to be changed. The module has a very small interface. 39 * item to be changed. The module has a very small interface.
39 * 40 *
40 * All the necessary glue logic and the GUI bells and whistles 41 * All the necessary glue logic and the GUI bells and whistles
41 * are provided by the control center and must not concern 42 * are provided by the control center and must not concern
42 * the module author. 43 * the module author.
43 * 44 *
44 * To write a config module, you have to create a library 45 * To write a config module, you have to create a library
45 * that contains at one factory function like this: 46 * that contains at one factory function like this:
46 * 47 *
47 * <pre> 48 * <pre>
48 * #include <kgenericfactory.h> 49 * #include <kgenericfactory.h>
49 * 50 *
50 * typedef KGenericFactory<YourKCModule, QWidget> YourKCModuleFactory; 51 * typedef KGenericFactory<YourKCModule, QWidget> YourKCModuleFactory;
51 * K_EXPORT_COMPONENT_FACTORY( yourLibName, YourKCModuleFactory("name_of_the_po_file") ); 52 * K_EXPORT_COMPONENT_FACTORY( yourLibName, YourKCModuleFactory("name_of_the_po_file") );
52 * </pre> 53 * </pre>
@@ -84,80 +85,80 @@ public:
84 */ 85 */
85 KCModule(QWidget *parent=0, const char *name=0, const QStringList &args=QStringList() ); 86 KCModule(QWidget *parent=0, const char *name=0, const QStringList &args=QStringList() );
86 87
87//US KCModule(KInstance *instance, QWidget *parent=0, const QStringList &args=QStringList() ); 88//US KCModule(KInstance *instance, QWidget *parent=0, const QStringList &args=QStringList() );
88 89
89 /* 90 /*
90 * Destroys the module. 91 * Destroys the module.
91 */ 92 */
92 ~KCModule(); 93 ~KCModule();
93 94
94 /** 95 /**
95 * Load the configuration data into the module. 96 * Load the configuration data into the module.
96 * 97 *
97 * The load method sets the user interface elements of the 98 * The load method sets the user interface elements of the
98 * module to reflect the current settings stored in the 99 * module to reflect the current settings stored in the
99 * configuration files. 100 * configuration files.
100 * 101 *
101 * This method is invoked whenever the module should read its configuration 102 * This method is invoked whenever the module should read its configuration
102 * (most of the times from a config file) and update the user interface. 103 * (most of the times from a config file) and update the user interface.
103 * This happens when the user clicks the "Reset" button in the control 104 * This happens when the user clicks the "Reset" button in the control
104 * center, to undo all of his changes and restore the currently valid 105 * center, to undo all of his changes and restore the currently valid
105 * settings. NOTE that this is not called after the modules is loaded, 106 * settings. NOTE that this is not called after the modules is loaded,
106 * so you probably want to call this method in the constructor. 107 * so you probably want to call this method in the constructor.
107 */ 108 */
108 virtual void load() {}; 109 virtual void load(KPrefs* prefs) {};
109 110
110 /** 111 /**
111 * Save the configuration data. 112 * Save the configuration data.
112 * 113 *
113 * The save method stores the config information as shown 114 * The save method stores the config information as shown
114 * in the user interface in the config files. 115 * in the user interface in the config files.
115 * 116 *
116 * If necessary, this method also updates the running system, 117 * If necessary, this method also updates the running system,
117 * e.g. by restarting applications. 118 * e.g. by restarting applications.
118 * 119 *
119 * save is called when the user clicks "Apply" or "Ok". 120 * save is called when the user clicks "Apply" or "Ok".
120 */ 121 */
121 virtual void save() {}; 122 virtual void save(KPrefs* prefs) {};
122 123
123 /** 124 /**
124 * Sets the configuration to sensible default values. 125 * Sets the configuration to sensible default values.
125 * 126 *
126 * This method is called when the user clicks the "Default" 127 * This method is called when the user clicks the "Default"
127 * button. It should set the display to useful values. 128 * button. It should set the display to useful values.
128 */ 129 */
129 virtual void defaults() {}; 130 virtual void defaults(KPrefs* prefs) {};
130 131
131 /** 132 /**
132 * Set the configuration to system default values. 133 * Set the configuration to system default values.
133 * 134 *
134 * This method is called when the user clicks the "System-Default" 135 * This method is called when the user clicks the "System-Default"
135 * button. It should set the display to the system default values. 136 * button. It should set the display to the system default values.
136 * 137 *
137 * NOTE: The default behaviour is to call defaults(). 138 * NOTE: The default behaviour is to call defaults().
138 */ 139 */
139 virtual void sysdefaults() { defaults(); }; 140 virtual void sysdefaults(KPrefs* prefs) { defaults(prefs); };
140 141
141 /** 142 /**
142 * Return a quick-help text. 143 * Return a quick-help text.
143 * 144 *
144 * This method is called when the module is docked. 145 * This method is called when the module is docked.
145 * The quick-help text should contain a short description of the module and 146 * The quick-help text should contain a short description of the module and
146 * links to the module's help files. You can use QML formating tags in the text. 147 * links to the module's help files. You can use QML formating tags in the text.
147 * 148 *
148 * NOTE: Please make sure the quick help text gets translated (use i18n()). 149 * NOTE: Please make sure the quick help text gets translated (use i18n()).
149 */ 150 */
150 virtual QString quickHelp() const { return QString::null; }; 151 virtual QString quickHelp() const { return QString::null; };
151 152
152 /** 153 /**
153 * Returns a the KAboutData for this module 154 * Returns a the KAboutData for this module
154 * This is generally only called for the KBugReport. 155 * This is generally only called for the KBugReport.
155 * Override and have it return a pointer to a constant 156 * Override and have it return a pointer to a constant
156 */ 157 */
157//US virtual const KAboutData *aboutData() const { return 0; } 158//US virtual const KAboutData *aboutData() const { return 0; }
158 159
159 /** 160 /**
160 * Indicate which buttons will be used. 161 * Indicate which buttons will be used.
161 * 162 *
162 * The return value is a value or'ed together from 163 * The return value is a value or'ed together from
163 * the Button enumeration type. 164 * the Button enumeration type.