author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /libkdepim/kprefsdialog.h | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | libkdepim/kprefsdialog.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libkdepim/kprefsdialog.h b/libkdepim/kprefsdialog.h index 52ec809..cc95dd4 100644 --- a/libkdepim/kprefsdialog.h +++ b/libkdepim/kprefsdialog.h | |||
@@ -3,61 +3,63 @@ | |||
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 | #ifndef _KPREFSDIALOG_H | 23 | #ifndef _KPREFSDIALOG_H |
24 | #define _KPREFSDIALOG_H | 24 | #define _KPREFSDIALOG_H |
25 | // $Id$ | 25 | // $Id$ |
26 | 26 | ||
27 | #include <qptrlist.h> | 27 | #include <q3ptrlist.h> |
28 | #include <qlineedit.h> | 28 | #include <qlineedit.h> |
29 | //Added by qt3to4: | ||
30 | #include <QLabel> | ||
29 | 31 | ||
30 | #include <kdialogbase.h> | 32 | #include <kdialogbase.h> |
31 | 33 | ||
32 | class KPrefs; | 34 | class KPrefs; |
33 | class KPrefsDialog; | 35 | class KPrefsDialog; |
34 | 36 | ||
35 | class KColorButton; | 37 | class KColorButton; |
36 | class QCheckBox; | 38 | class QCheckBox; |
37 | class QLabel; | 39 | class QLabel; |
38 | class QSpinBox; | 40 | class QSpinBox; |
39 | class QButtonGroup; | 41 | class Q3ButtonGroup; |
40 | 42 | ||
41 | /** | 43 | /** |
42 | @short Base class for widgets used by @ref KPrefsDialog. | 44 | @short Base class for widgets used by @ref KPrefsDialog. |
43 | @author Cornelius Schumacher | 45 | @author Cornelius Schumacher |
44 | @see KPrefsDialog | 46 | @see KPrefsDialog |
45 | 47 | ||
46 | This class provides the interface for the preferences widgets used by | 48 | This class provides the interface for the preferences widgets used by |
47 | KPrefsDialog. | 49 | KPrefsDialog. |
48 | */ | 50 | */ |
49 | class KPrefsDialogWid : public QObject | 51 | class KPrefsDialogWid : public QObject |
50 | { | 52 | { |
51 | public: | 53 | public: |
52 | /** | 54 | /** |
53 | 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 |
54 | stored configuration and display it in the widget. | 56 | stored configuration and display it in the widget. |
55 | */ | 57 | */ |
56 | virtual void readConfig() = 0; | 58 | virtual void readConfig() = 0; |
57 | /** | 59 | /** |
58 | 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 |
59 | stored configuration. | 61 | stored configuration. |
60 | */ | 62 | */ |
61 | virtual void writeConfig() = 0; | 63 | virtual void writeConfig() = 0; |
62 | }; | 64 | }; |
63 | 65 | ||
@@ -237,57 +239,57 @@ class KPrefsDialogWidFont : public KPrefsDialogWid | |||
237 | class KPrefsDialogWidRadios : public KPrefsDialogWid | 239 | class KPrefsDialogWidRadios : public KPrefsDialogWid |
238 | { | 240 | { |
239 | public: | 241 | public: |
240 | /** | 242 | /** |
241 | Create a widget for selection of an option. It consists of a box with | 243 | Create a widget for selection of an option. It consists of a box with |
242 | several radio buttons. | 244 | several radio buttons. |
243 | 245 | ||
244 | @param text Text of main box. | 246 | @param text Text of main box. |
245 | @param reference Pointer to variable read and written by this widget. | 247 | @param reference Pointer to variable read and written by this widget. |
246 | @param parent Parent widget. | 248 | @param parent Parent widget. |
247 | */ | 249 | */ |
248 | KPrefsDialogWidRadios(const QString &text,int *reference,QWidget *parent); | 250 | KPrefsDialogWidRadios(const QString &text,int *reference,QWidget *parent); |
249 | virtual ~KPrefsDialogWidRadios(); | 251 | virtual ~KPrefsDialogWidRadios(); |
250 | 252 | ||
251 | /** | 253 | /** |
252 | Add a radio button. | 254 | Add a radio button. |
253 | 255 | ||
254 | @param text Text of the button. | 256 | @param text Text of the button. |
255 | */ | 257 | */ |
256 | void addRadio(const QString &text); | 258 | void addRadio(const QString &text); |
257 | 259 | ||
258 | /** | 260 | /** |
259 | Return the box widget used by this widget. | 261 | Return the box widget used by this widget. |
260 | */ | 262 | */ |
261 | QButtonGroup *groupBox(); | 263 | Q3ButtonGroup *groupBox(); |
262 | 264 | ||
263 | void readConfig(); | 265 | void readConfig(); |
264 | void writeConfig(); | 266 | void writeConfig(); |
265 | 267 | ||
266 | private: | 268 | private: |
267 | int *mReference; | 269 | int *mReference; |
268 | 270 | ||
269 | QButtonGroup *mBox; | 271 | Q3ButtonGroup *mBox; |
270 | }; | 272 | }; |
271 | 273 | ||
272 | 274 | ||
273 | /** | 275 | /** |
274 | @short Widget for string settings in @ref KPrefsDialog. | 276 | @short Widget for string settings in @ref KPrefsDialog. |
275 | 277 | ||
276 | This class provides a widget for configuring string values. It is meant to be | 278 | This class provides a widget for configuring string values. It is meant to be |
277 | used by KPrefsDialog. The user is responsible for the layout management. | 279 | used by KPrefsDialog. The user is responsible for the layout management. |
278 | */ | 280 | */ |
279 | class KPrefsDialogWidString : public KPrefsDialogWid | 281 | class KPrefsDialogWidString : public KPrefsDialogWid |
280 | { | 282 | { |
281 | public: | 283 | public: |
282 | /** | 284 | /** |
283 | Create a string widget consisting of a test label and a line edit. | 285 | Create a string widget consisting of a test label and a line edit. |
284 | 286 | ||
285 | @param text Text of label. | 287 | @param text Text of label. |
286 | @param reference Pointer to variable read and written by this widget. | 288 | @param reference Pointer to variable read and written by this widget. |
287 | @param parent Parent widget. | 289 | @param parent Parent widget. |
288 | */ | 290 | */ |
289 | KPrefsDialogWidString(const QString &text,QString *reference,QWidget *parent,QLineEdit::EchoMode echomode=QLineEdit::Normal); | 291 | KPrefsDialogWidString(const QString &text,QString *reference,QWidget *parent,QLineEdit::EchoMode echomode=QLineEdit::Normal); |
290 | /** | 292 | /** |
291 | Destructor. | 293 | Destructor. |
292 | */ | 294 | */ |
293 | virtual ~KPrefsDialogWidString(); | 295 | virtual ~KPrefsDialogWidString(); |
@@ -418,49 +420,49 @@ class KPrefsDialog : public KDialogBase | |||
418 | signals: | 420 | signals: |
419 | /** Emitted when the a changed configuration has been stored. */ | 421 | /** Emitted when the a changed configuration has been stored. */ |
420 | void configChanged(); | 422 | void configChanged(); |
421 | 423 | ||
422 | protected slots: | 424 | protected slots: |
423 | /** Apply changes to preferences */ | 425 | /** Apply changes to preferences */ |
424 | void slotApply(); | 426 | void slotApply(); |
425 | 427 | ||
426 | void accept(); | 428 | void accept(); |
427 | /** Accept changes to preferences and close dialog */ | 429 | /** Accept changes to preferences and close dialog */ |
428 | void slotOk(); | 430 | void slotOk(); |
429 | 431 | ||
430 | /** Set preferences to default values */ | 432 | /** Set preferences to default values */ |
431 | void slotDefault(); | 433 | void slotDefault(); |
432 | 434 | ||
433 | protected: | 435 | protected: |
434 | /** Implement this to read custom configuration widgets. */ | 436 | /** Implement this to read custom configuration widgets. */ |
435 | virtual void usrReadConfig() {} | 437 | virtual void usrReadConfig() {} |
436 | /** Implement this to write custom configuration widgets. */ | 438 | /** Implement this to write custom configuration widgets. */ |
437 | virtual void usrWriteConfig() {} | 439 | virtual void usrWriteConfig() {} |
438 | 440 | ||
439 | private: | 441 | private: |
440 | KPrefs *mPrefs; | 442 | KPrefs *mPrefs; |
441 | 443 | ||
442 | QPtrList<KPrefsDialogWid> mPrefsWids; | 444 | Q3PtrList<KPrefsDialogWid> mPrefsWids; |
443 | }; | 445 | }; |
444 | 446 | ||
445 | 447 | ||
446 | #include "kcmconfigs/kdepimconfigwidget.h" | 448 | #include "kcmconfigs/kdepimconfigwidget.h" |
447 | class KPimPrefsGlobalDialog : public KPrefsDialog | 449 | class KPimPrefsGlobalDialog : public KPrefsDialog |
448 | { | 450 | { |
449 | Q_OBJECT | 451 | Q_OBJECT |
450 | public: | 452 | public: |
451 | KPimPrefsGlobalDialog(QWidget *parent=0,char *name=0,bool modal=true); | 453 | KPimPrefsGlobalDialog(QWidget *parent=0,char *name=0,bool modal=true); |
452 | /** | 454 | /** |
453 | Destructor. | 455 | Destructor. |
454 | */ | 456 | */ |
455 | void showTZconfig(); | 457 | void showTZconfig(); |
456 | 458 | ||
457 | public slots: | 459 | public slots: |
458 | 460 | ||
459 | signals: | 461 | signals: |
460 | protected slots: | 462 | protected slots: |
461 | 463 | ||
462 | protected: | 464 | protected: |
463 | void usrReadConfig(); | 465 | void usrReadConfig(); |
464 | virtual void usrWriteConfig() ; | 466 | virtual void usrWriteConfig() ; |
465 | 467 | ||
466 | private: | 468 | private: |