author | zautrix <zautrix> | 2004-09-22 04:45:07 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-22 04:45:07 (UTC) |
commit | bbeffa56ee51d30b84bcadaf22234b8227958f31 (patch) (unidiff) | |
tree | 040ce64f3e618ef4b76ddfa80d34a245d59ef1b5 /libkdepim/kprefswidget.h | |
parent | a56783aace3496c8b40008d0dec4c42437165e54 (diff) | |
download | kdepimpi-bbeffa56ee51d30b84bcadaf22234b8227958f31.zip kdepimpi-bbeffa56ee51d30b84bcadaf22234b8227958f31.tar.gz kdepimpi-bbeffa56ee51d30b84bcadaf22234b8227958f31.tar.bz2 |
desktop compile fixes
-rw-r--r-- | libkdepim/kprefswidget.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libkdepim/kprefswidget.h b/libkdepim/kprefswidget.h index 8a24515..8543a39 100644 --- a/libkdepim/kprefswidget.h +++ b/libkdepim/kprefswidget.h | |||
@@ -1,454 +1,455 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | // $Id$ | 23 | // $Id$ |
24 | 24 | ||
25 | #ifndef _KPREFSWIDGET_H | 25 | #ifndef _KPREFSWIDGET_H |
26 | #define _KPREFSWIDGET_H | 26 | #define _KPREFSWIDGET_H |
27 | 27 | ||
28 | #include <qptrlist.h> | 28 | #include <qptrlist.h> |
29 | #include <qlineedit.h> | 29 | #include <qlineedit.h> |
30 | #include <qpushbutton.h> | ||
30 | 31 | ||
31 | #include <qwidget.h> | 32 | #include <qwidget.h> |
32 | 33 | ||
33 | class KPrefs; | 34 | class KPrefs; |
34 | 35 | ||
35 | class KColorButton; | 36 | class KColorButton; |
36 | class QCheckBox; | 37 | class QCheckBox; |
37 | class QLabel; | 38 | class QLabel; |
38 | class QSpinBox; | 39 | class QSpinBox; |
39 | class QButtonGroup; | 40 | class QButtonGroup; |
40 | 41 | ||
41 | /** | 42 | /** |
42 | @short Base class for widgets used by @ref KPrefsDialog. | 43 | @short Base class for widgets used by @ref KPrefsDialog. |
43 | @author Cornelius Schumacher | 44 | @author Cornelius Schumacher |
44 | @see KPrefsDialog | 45 | @see KPrefsDialog |
45 | 46 | ||
46 | This class provides the interface for the preferences widgets used by | 47 | This class provides the interface for the preferences widgets used by |
47 | KPrefsDialog. | 48 | KPrefsDialog. |
48 | */ | 49 | */ |
49 | class KPrefsWid : public QObject | 50 | class KPrefsWid : public QObject |
50 | { | 51 | { |
51 | Q_OBJECT | 52 | Q_OBJECT |
52 | public: | 53 | public: |
53 | /** | 54 | /** |
54 | This function is called to read value of the setting from the | 55 | This function is called to read value of the setting from the |
55 | stored configuration and display it in the widget. | 56 | stored configuration and display it in the widget. |
56 | */ | 57 | */ |
57 | virtual void readConfig() = 0; | 58 | virtual void readConfig() = 0; |
58 | /** | 59 | /** |
59 | This function is called to write the current setting of the widget to the | 60 | This function is called to write the current setting of the widget to the |
60 | stored configuration. | 61 | stored configuration. |
61 | */ | 62 | */ |
62 | virtual void writeConfig() = 0; | 63 | virtual void writeConfig() = 0; |
63 | 64 | ||
64 | //connect to this signal if you want to be notified of changes | 65 | //connect to this signal if you want to be notified of changes |
65 | signals: | 66 | signals: |
66 | void modified(); | 67 | void modified(); |
67 | 68 | ||
68 | }; | 69 | }; |
69 | 70 | ||
70 | /** | 71 | /** |
71 | @short Widget for bool settings in @ref KPrefsDialog. | 72 | @short Widget for bool settings in @ref KPrefsDialog. |
72 | 73 | ||
73 | This class provides a widget for configuring bool values. It is meant to be | 74 | This class provides a widget for configuring bool values. It is meant to be |
74 | used by KPrefsDialog. The user is responsible for the layout management. | 75 | used by KPrefsDialog. The user is responsible for the layout management. |
75 | */ | 76 | */ |
76 | class KPrefsWidBool : public KPrefsWid | 77 | class KPrefsWidBool : public KPrefsWid |
77 | { | 78 | { |
78 | public: | 79 | public: |
79 | /** | 80 | /** |
80 | Create a bool widget consisting of a QCheckbox. | 81 | Create a bool widget consisting of a QCheckbox. |
81 | 82 | ||
82 | @param text Text of QCheckBox. | 83 | @param text Text of QCheckBox. |
83 | @param reference Pointer to variable read and written by this widget. | 84 | @param reference Pointer to variable read and written by this widget. |
84 | @param parent Parent widget. | 85 | @param parent Parent widget. |
85 | */ | 86 | */ |
86 | KPrefsWidBool(const QString &text,bool *reference,QWidget *parent); | 87 | KPrefsWidBool(const QString &text,bool *reference,QWidget *parent); |
87 | 88 | ||
88 | /** | 89 | /** |
89 | Return the QCheckbox used by this widget. | 90 | Return the QCheckbox used by this widget. |
90 | */ | 91 | */ |
91 | QCheckBox *checkBox(); | 92 | QCheckBox *checkBox(); |
92 | 93 | ||
93 | void readConfig(); | 94 | void readConfig(); |
94 | void writeConfig(); | 95 | void writeConfig(); |
95 | 96 | ||
96 | private: | 97 | private: |
97 | bool *mReference; | 98 | bool *mReference; |
98 | 99 | ||
99 | QCheckBox *mCheck; | 100 | QCheckBox *mCheck; |
100 | }; | 101 | }; |
101 | 102 | ||
102 | /** | 103 | /** |
103 | @short Widget for time settings in @ref KPrefsDialog. | 104 | @short Widget for time settings in @ref KPrefsDialog. |
104 | 105 | ||
105 | This class provides a widget for configuring time values. It is meant to be | 106 | This class provides a widget for configuring time values. It is meant to be |
106 | used by KPrefsDialog. The user is responsible for the layout management. | 107 | used by KPrefsDialog. The user is responsible for the layout management. |
107 | */ | 108 | */ |
108 | class KPrefsWidTime : public KPrefsWid | 109 | class KPrefsWidTime : public KPrefsWid |
109 | { | 110 | { |
110 | public: | 111 | public: |
111 | /** | 112 | /** |
112 | Create a time widget consisting of a label and a spinbox. | 113 | Create a time widget consisting of a label and a spinbox. |
113 | 114 | ||
114 | @param text Text of Label. | 115 | @param text Text of Label. |
115 | @param reference Pointer to variable read and written by this widget. | 116 | @param reference Pointer to variable read and written by this widget. |
116 | @param parent Parent widget. | 117 | @param parent Parent widget. |
117 | */ | 118 | */ |
118 | KPrefsWidTime(const QString &text,int *reference,QWidget *parent); | 119 | KPrefsWidTime(const QString &text,int *reference,QWidget *parent); |
119 | 120 | ||
120 | /** | 121 | /** |
121 | Return QLabel used by this widget. | 122 | Return QLabel used by this widget. |
122 | */ | 123 | */ |
123 | QLabel *label(); | 124 | QLabel *label(); |
124 | /** | 125 | /** |
125 | Return QSpinBox used by this widget. | 126 | Return QSpinBox used by this widget. |
126 | */ | 127 | */ |
127 | QSpinBox *spinBox(); | 128 | QSpinBox *spinBox(); |
128 | 129 | ||
129 | void readConfig(); | 130 | void readConfig(); |
130 | void writeConfig(); | 131 | void writeConfig(); |
131 | 132 | ||
132 | private: | 133 | private: |
133 | int *mReference; | 134 | int *mReference; |
134 | 135 | ||
135 | QLabel *mLabel; | 136 | QLabel *mLabel; |
136 | QSpinBox *mSpin; | 137 | QSpinBox *mSpin; |
137 | }; | 138 | }; |
138 | 139 | ||
139 | /** | 140 | /** |
140 | @short Widget for color settings in @ref KPrefsDialog. | 141 | @short Widget for color settings in @ref KPrefsDialog. |
141 | 142 | ||
142 | This class provides a widget for configuring color values. It is meant to be | 143 | This class provides a widget for configuring color values. It is meant to be |
143 | used by KPrefsDialog. The user is responsible for the layout management. | 144 | used by KPrefsDialog. The user is responsible for the layout management. |
144 | */ | 145 | */ |
145 | class KPrefsWidColor : public KPrefsWid | 146 | class KPrefsWidColor : public KPrefsWid |
146 | { | 147 | { |
147 | public: | 148 | public: |
148 | /** | 149 | /** |
149 | Create a color widget consisting of a test field and a button for opening | 150 | Create a color widget consisting of a test field and a button for opening |
150 | a color dialog. | 151 | a color dialog. |
151 | 152 | ||
152 | @param text Text of button. | 153 | @param text Text of button. |
153 | @param reference Pointer to variable read and written by this widget. | 154 | @param reference Pointer to variable read and written by this widget. |
154 | @param parent Parent widget. | 155 | @param parent Parent widget. |
155 | */ | 156 | */ |
156 | KPrefsWidColor(const QString &text,QColor *reference,QWidget *parent); | 157 | KPrefsWidColor(const QString &text,QColor *reference,QWidget *parent); |
157 | /** | 158 | /** |
158 | Destruct color setting widget. | 159 | Destruct color setting widget. |
159 | */ | 160 | */ |
160 | ~KPrefsWidColor(); | 161 | ~KPrefsWidColor(); |
161 | 162 | ||
162 | /** | 163 | /** |
163 | Return QLabel for the button | 164 | Return QLabel for the button |
164 | */ | 165 | */ |
165 | QLabel *label(); | 166 | QLabel *label(); |
166 | /** | 167 | /** |
167 | Return button opening the color dialog. | 168 | Return button opening the color dialog. |
168 | */ | 169 | */ |
169 | KColorButton *button(); | 170 | KColorButton *button(); |
170 | 171 | ||
171 | void readConfig(); | 172 | void readConfig(); |
172 | void writeConfig(); | 173 | void writeConfig(); |
173 | 174 | ||
174 | private: | 175 | private: |
175 | QColor *mReference; | 176 | QColor *mReference; |
176 | 177 | ||
177 | QLabel *mLabel; | 178 | QLabel *mLabel; |
178 | KColorButton *mButton; | 179 | KColorButton *mButton; |
179 | }; | 180 | }; |
180 | 181 | ||
181 | /** | 182 | /** |
182 | @short Widget for font settings in @ref KPrefsDialog. | 183 | @short Widget for font settings in @ref KPrefsDialog. |
183 | 184 | ||
184 | This class provides a widget for configuring font values. It is meant to be | 185 | This class provides a widget for configuring font values. It is meant to be |
185 | used by KPrefsDialog. The user is responsible for the layout management. | 186 | used by KPrefsDialog. The user is responsible for the layout management. |
186 | */ | 187 | */ |
187 | class KPrefsWidFont : public KPrefsWid | 188 | class KPrefsWidFont : public KPrefsWid |
188 | { | 189 | { |
189 | Q_OBJECT | 190 | Q_OBJECT |
190 | public: | 191 | public: |
191 | /** | 192 | /** |
192 | Create a font widget consisting of a test field and a button for opening | 193 | Create a font widget consisting of a test field and a button for opening |
193 | a font dialog. | 194 | a font dialog. |
194 | 195 | ||
195 | @param label Text of label. | 196 | @param label Text of label. |
196 | @param reference Pointer to variable read and written by this widget. | 197 | @param reference Pointer to variable read and written by this widget. |
197 | @param parent Parent widget. | 198 | @param parent Parent widget. |
198 | */ | 199 | */ |
199 | KPrefsWidFont(const QString &sampleText,const QString &labelText, | 200 | KPrefsWidFont(const QString &sampleText,const QString &labelText, |
200 | QFont *reference,QWidget *parent); | 201 | QFont *reference,QWidget *parent); |
201 | /** | 202 | /** |
202 | Destruct font setting widget. | 203 | Destruct font setting widget. |
203 | */ | 204 | */ |
204 | ~KPrefsWidFont(); | 205 | ~KPrefsWidFont(); |
205 | 206 | ||
206 | /** | 207 | /** |
207 | Return label. | 208 | Return label. |
208 | */ | 209 | */ |
209 | QLabel *label(); | 210 | QLabel *label(); |
210 | /** | 211 | /** |
211 | Return QFrame used as preview field. | 212 | Return QFrame used as preview field. |
212 | */ | 213 | */ |
213 | QLabel *preview(); | 214 | QLabel *preview(); |
214 | /** | 215 | /** |
215 | Return button opening the font dialog. | 216 | Return button opening the font dialog. |
216 | */ | 217 | */ |
217 | QPushButton *button(); | 218 | QPushButton *button(); |
218 | 219 | ||
219 | void readConfig(); | 220 | void readConfig(); |
220 | void writeConfig(); | 221 | void writeConfig(); |
221 | 222 | ||
222 | protected slots: | 223 | protected slots: |
223 | void selectFont(); | 224 | void selectFont(); |
224 | 225 | ||
225 | private: | 226 | private: |
226 | QFont *mReference; | 227 | QFont *mReference; |
227 | 228 | ||
228 | QLabel *mLabel; | 229 | QLabel *mLabel; |
229 | QLabel *mPreview; | 230 | QLabel *mPreview; |
230 | QPushButton *mButton; | 231 | QPushButton *mButton; |
231 | }; | 232 | }; |
232 | 233 | ||
233 | /** | 234 | /** |
234 | @short Widget for settings represented by a group of radio buttons in | 235 | @short Widget for settings represented by a group of radio buttons in |
235 | @ref KPrefsDialog. | 236 | @ref KPrefsDialog. |
236 | 237 | ||
237 | This class provides a widget for configuring selections. It is meant to be | 238 | This class provides a widget for configuring selections. It is meant to be |
238 | used by KPrefsDialog. The user is responsible for the layout management. The | 239 | used by KPrefsDialog. The user is responsible for the layout management. The |
239 | setting is interpreted as an int value, corresponding to the position of the | 240 | setting is interpreted as an int value, corresponding to the position of the |
240 | radio button. The position of the button is defined by the sequence of @ref | 241 | radio button. The position of the button is defined by the sequence of @ref |
241 | addRadio() calls, starting with 0. | 242 | addRadio() calls, starting with 0. |
242 | */ | 243 | */ |
243 | class KPrefsWidRadios : public KPrefsWid | 244 | class KPrefsWidRadios : public KPrefsWid |
244 | { | 245 | { |
245 | public: | 246 | public: |
246 | /** | 247 | /** |
247 | Create a widget for selection of an option. It consists of a box with | 248 | Create a widget for selection of an option. It consists of a box with |
248 | several radio buttons. | 249 | several radio buttons. |
249 | 250 | ||
250 | @param text Text of main box. | 251 | @param text Text of main box. |
251 | @param reference Pointer to variable read and written by this widget. | 252 | @param reference Pointer to variable read and written by this widget. |
252 | @param parent Parent widget. | 253 | @param parent Parent widget. |
253 | */ | 254 | */ |
254 | KPrefsWidRadios(const QString &text,int *reference,QWidget *parent); | 255 | KPrefsWidRadios(const QString &text,int *reference,QWidget *parent); |
255 | virtual ~KPrefsWidRadios(); | 256 | virtual ~KPrefsWidRadios(); |
256 | 257 | ||
257 | /** | 258 | /** |
258 | Add a radio button. | 259 | Add a radio button. |
259 | 260 | ||
260 | @param text Text of the button. | 261 | @param text Text of the button. |
261 | */ | 262 | */ |
262 | void addRadio(const QString &text); | 263 | void addRadio(const QString &text); |
263 | 264 | ||
264 | /** | 265 | /** |
265 | Return the box widget used by this widget. | 266 | Return the box widget used by this widget. |
266 | */ | 267 | */ |
267 | QButtonGroup *groupBox(); | 268 | QButtonGroup *groupBox(); |
268 | 269 | ||
269 | void readConfig(); | 270 | void readConfig(); |
270 | void writeConfig(); | 271 | void writeConfig(); |
271 | 272 | ||
272 | private: | 273 | private: |
273 | int *mReference; | 274 | int *mReference; |
274 | 275 | ||
275 | QButtonGroup *mBox; | 276 | QButtonGroup *mBox; |
276 | }; | 277 | }; |
277 | 278 | ||
278 | 279 | ||
279 | /** | 280 | /** |
280 | @short Widget for string settings in @ref KPrefsDialog. | 281 | @short Widget for string settings in @ref KPrefsDialog. |
281 | 282 | ||
282 | This class provides a widget for configuring string values. It is meant to be | 283 | This class provides a widget for configuring string values. It is meant to be |
283 | used by KPrefsDialog. The user is responsible for the layout management. | 284 | used by KPrefsDialog. The user is responsible for the layout management. |
284 | */ | 285 | */ |
285 | class KPrefsWidString : public KPrefsWid | 286 | class KPrefsWidString : public KPrefsWid |
286 | { | 287 | { |
287 | public: | 288 | public: |
288 | /** | 289 | /** |
289 | Create a string widget consisting of a test label and a line edit. | 290 | Create a string widget consisting of a test label and a line edit. |
290 | 291 | ||
291 | @param text Text of label. | 292 | @param text Text of label. |
292 | @param reference Pointer to variable read and written by this widget. | 293 | @param reference Pointer to variable read and written by this widget. |
293 | @param parent Parent widget. | 294 | @param parent Parent widget. |
294 | */ | 295 | */ |
295 | KPrefsWidString(const QString &text,QString *reference,QWidget *parent,QLineEdit::EchoMode echomode=QLineEdit::Normal); | 296 | KPrefsWidString(const QString &text,QString *reference,QWidget *parent,QLineEdit::EchoMode echomode=QLineEdit::Normal); |
296 | /** | 297 | /** |
297 | Destructor. | 298 | Destructor. |
298 | */ | 299 | */ |
299 | virtual ~KPrefsWidString(); | 300 | virtual ~KPrefsWidString(); |
300 | 301 | ||
301 | /** | 302 | /** |
302 | Return label used by this widget. | 303 | Return label used by this widget. |
303 | */ | 304 | */ |
304 | QLabel *label(); | 305 | QLabel *label(); |
305 | /** | 306 | /** |
306 | Return QLineEdit used by this widget. | 307 | Return QLineEdit used by this widget. |
307 | */ | 308 | */ |
308 | QLineEdit *lineEdit(); | 309 | QLineEdit *lineEdit(); |
309 | 310 | ||
310 | void readConfig(); | 311 | void readConfig(); |
311 | void writeConfig(); | 312 | void writeConfig(); |
312 | 313 | ||
313 | private: | 314 | private: |
314 | QString *mReference; | 315 | QString *mReference; |
315 | 316 | ||
316 | QLabel *mLabel; | 317 | QLabel *mLabel; |
317 | QLineEdit *mEdit; | 318 | QLineEdit *mEdit; |
318 | }; | 319 | }; |
319 | 320 | ||
320 | 321 | ||
321 | /** | 322 | /** |
322 | @short Base class for a preferences widget. | 323 | @short Base class for a preferences widget. |
323 | 324 | ||
324 | This class provides the framework for a preferences widget. You have to | 325 | This class provides the framework for a preferences widget. You have to |
325 | subclass it and add the code to create the actual configuration widgets and | 326 | subclass it and add the code to create the actual configuration widgets and |
326 | do the layout management. | 327 | do the layout management. |
327 | 328 | ||
328 | KPrefsWidget provides functions to add subclasses of @ref KPrefsWid. For | 329 | KPrefsWidget provides functions to add subclasses of @ref KPrefsWid. For |
329 | these widgets the reading, writing and setting to default values is handled | 330 | these widgets the reading, writing and setting to default values is handled |
330 | automatically. Custom widgets have to be handled in the functions @ref | 331 | automatically. Custom widgets have to be handled in the functions @ref |
331 | usrReadConfig() and @ref usrWriteConfig(). | 332 | usrReadConfig() and @ref usrWriteConfig(). |
332 | */ | 333 | */ |
333 | class KPrefsWidget : public QWidget | 334 | class KPrefsWidget : public QWidget |
334 | { | 335 | { |
335 | Q_OBJECT | 336 | Q_OBJECT |
336 | public: | 337 | public: |
337 | /** | 338 | /** |
338 | Create a KPrefsDialog for a KPrefs object. | 339 | Create a KPrefsDialog for a KPrefs object. |
339 | 340 | ||
340 | @param prefs KPrefs object used to access te configuration. | 341 | @param prefs KPrefs object used to access te configuration. |
341 | @param parent Parent widget. | 342 | @param parent Parent widget. |
342 | @param name Widget name. | 343 | @param name Widget name. |
343 | */ | 344 | */ |
344 | KPrefsWidget(KPrefs *prefs,QWidget *parent=0,const char *name=0); | 345 | KPrefsWidget(KPrefs *prefs,QWidget *parent=0,const char *name=0); |
345 | /** | 346 | /** |
346 | Destructor. | 347 | Destructor. |
347 | */ | 348 | */ |
348 | virtual ~KPrefsWidget(); | 349 | virtual ~KPrefsWidget(); |
349 | 350 | ||
350 | /** | 351 | /** |
351 | Register a custom KPrefsWid object. | 352 | Register a custom KPrefsWid object. |
352 | */ | 353 | */ |
353 | void addWid(KPrefsWid *); | 354 | void addWid(KPrefsWid *); |
354 | /** | 355 | /** |
355 | Register a @ref KPrefsWidBool object. | 356 | Register a @ref KPrefsWidBool object. |
356 | 357 | ||
357 | @param text Text of bool widget. | 358 | @param text Text of bool widget. |
358 | @param reference Reference to variable storing the setting. | 359 | @param reference Reference to variable storing the setting. |
359 | @param parent Parent widget. | 360 | @param parent Parent widget. |
360 | */ | 361 | */ |
361 | KPrefsWidBool *addWidBool(const QString &text,bool *reference,QWidget *parent); | 362 | KPrefsWidBool *addWidBool(const QString &text,bool *reference,QWidget *parent); |
362 | /** | 363 | /** |
363 | Register a @ref KPrefsWidTime object. | 364 | Register a @ref KPrefsWidTime object. |
364 | 365 | ||
365 | @param text Text of time widget. | 366 | @param text Text of time widget. |
366 | @param reference Reference to variable storing the setting. | 367 | @param reference Reference to variable storing the setting. |
367 | @param parent Parent widget. | 368 | @param parent Parent widget. |
368 | */ | 369 | */ |
369 | KPrefsWidTime *addWidTime(const QString &text,int *reference,QWidget *parent); | 370 | KPrefsWidTime *addWidTime(const QString &text,int *reference,QWidget *parent); |
370 | /** | 371 | /** |
371 | Register a @ref KPrefsWidColor object. | 372 | Register a @ref KPrefsWidColor object. |
372 | 373 | ||
373 | @param text Text of color widget. | 374 | @param text Text of color widget. |
374 | @param reference Reference to variable storing the setting. | 375 | @param reference Reference to variable storing the setting. |
375 | @param parent Parent widget. | 376 | @param parent Parent widget. |
376 | */ | 377 | */ |
377 | KPrefsWidColor *addWidColor(const QString &text,QColor *reference,QWidget *parent); | 378 | KPrefsWidColor *addWidColor(const QString &text,QColor *reference,QWidget *parent); |
378 | /** | 379 | /** |
379 | Register a @ref KPrefsWidRadios object. | 380 | Register a @ref KPrefsWidRadios object. |
380 | 381 | ||
381 | @param text Text of radio button box widget. | 382 | @param text Text of radio button box widget. |
382 | @param reference Reference to variable storing the setting. | 383 | @param reference Reference to variable storing the setting. |
383 | @param parent Parent widget. | 384 | @param parent Parent widget. |
384 | */ | 385 | */ |
385 | KPrefsWidRadios *addWidRadios(const QString &text,int *reference,QWidget *parent); | 386 | KPrefsWidRadios *addWidRadios(const QString &text,int *reference,QWidget *parent); |
386 | /** | 387 | /** |
387 | Register a @ref KPrefsWidString object. | 388 | Register a @ref KPrefsWidString object. |
388 | 389 | ||
389 | @param text Text of string widget. | 390 | @param text Text of string widget. |
390 | @param reference Reference to variable storing the setting. | 391 | @param reference Reference to variable storing the setting. |
391 | @param parent Parent widget. | 392 | @param parent Parent widget. |
392 | */ | 393 | */ |
393 | KPrefsWidString *addWidString(const QString &text,QString *reference,QWidget *parent); | 394 | KPrefsWidString *addWidString(const QString &text,QString *reference,QWidget *parent); |
394 | /** | 395 | /** |
395 | Register a password @ref KPrefsWidString object, with echomode set to QLineEdit::Password. | 396 | Register a password @ref KPrefsWidString object, with echomode set to QLineEdit::Password. |
396 | 397 | ||
397 | @param text Text of string widget. | 398 | @param text Text of string widget. |
398 | @param reference Reference to variable storing the setting. | 399 | @param reference Reference to variable storing the setting. |
399 | @param parent Parent widget. | 400 | @param parent Parent widget. |
400 | */ | 401 | */ |
401 | KPrefsWidString *addWidPassword (const QString &text,QString *reference,QWidget *parent); | 402 | KPrefsWidString *addWidPassword (const QString &text,QString *reference,QWidget *parent); |
402 | /** | 403 | /** |
403 | Register a @ref KPrefsWidFont object. | 404 | Register a @ref KPrefsWidFont object. |
404 | 405 | ||
405 | @param sampleText Sample text of font widget. | 406 | @param sampleText Sample text of font widget. |
406 | @param buttonText Button text of font widget. | 407 | @param buttonText Button text of font widget. |
407 | @param reference Reference to variable storing the setting. | 408 | @param reference Reference to variable storing the setting. |
408 | @param parent Parent widget. | 409 | @param parent Parent widget. |
409 | */ | 410 | */ |
410 | KPrefsWidFont *addWidFont(const QString &sampleText,const QString &buttonText, | 411 | KPrefsWidFont *addWidFont(const QString &sampleText,const QString &buttonText, |
411 | QFont *reference,QWidget *parent); | 412 | QFont *reference,QWidget *parent); |
412 | 413 | ||
413 | public slots: | 414 | public slots: |
414 | /** Set all widgets to default values. */ | 415 | /** Set all widgets to default values. */ |
415 | void setDefaults(); | 416 | void setDefaults(); |
416 | 417 | ||
417 | /** Read preferences from config file. */ | 418 | /** Read preferences from config file. */ |
418 | void readConfig(); | 419 | void readConfig(); |
419 | 420 | ||
420 | /** Write preferences to config file. */ | 421 | /** Write preferences to config file. */ |
421 | void writeConfig(); | 422 | void writeConfig(); |
422 | 423 | ||
423 | /** connect this slot to all UI elements */ | 424 | /** connect this slot to all UI elements */ |
424 | void modified(); | 425 | void modified(); |
425 | 426 | ||
426 | signals: | 427 | signals: |
427 | /** Emitted when the a changed configuration has been stored. */ | 428 | /** Emitted when the a changed configuration has been stored. */ |
428 | //US void configChanged(); | 429 | //US void configChanged(); |
429 | void changed( bool ); | 430 | void changed( bool ); |
430 | 431 | ||
431 | protected slots: | 432 | protected slots: |
432 | /** Apply changes to preferences */ | 433 | /** Apply changes to preferences */ |
433 | //US void slotApply(); | 434 | //US void slotApply(); |
434 | 435 | ||
435 | //US void accept(); | 436 | //US void accept(); |
436 | /** Accept changes to preferences and close dialog */ | 437 | /** Accept changes to preferences and close dialog */ |
437 | //US void slotOk(); | 438 | //US void slotOk(); |
438 | 439 | ||
439 | /** Set preferences to default values */ | 440 | /** Set preferences to default values */ |
440 | //US void slotDefault(); | 441 | //US void slotDefault(); |
441 | 442 | ||
442 | protected: | 443 | protected: |
443 | /** Implement this to read custom configuration widgets. */ | 444 | /** Implement this to read custom configuration widgets. */ |
444 | virtual void usrReadConfig() {} | 445 | virtual void usrReadConfig() {} |
445 | /** Implement this to write custom configuration widgets. */ | 446 | /** Implement this to write custom configuration widgets. */ |
446 | virtual void usrWriteConfig() {} | 447 | virtual void usrWriteConfig() {} |
447 | 448 | ||
448 | private: | 449 | private: |
449 | KPrefs *mPrefs; | 450 | KPrefs *mPrefs; |
450 | 451 | ||
451 | QPtrList<KPrefsWid> mPrefsWids; | 452 | QPtrList<KPrefsWid> mPrefsWids; |
452 | }; | 453 | }; |
453 | 454 | ||
454 | #endif | 455 | #endif |