Diffstat (limited to 'kaddressbook/viewconfigurewidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/viewconfigurewidget.h | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/kaddressbook/viewconfigurewidget.h b/kaddressbook/viewconfigurewidget.h new file mode 100644 index 0000000..0c2b77c --- a/dev/null +++ b/kaddressbook/viewconfigurewidget.h | |||
@@ -0,0 +1,106 @@ | |||
1 | /* | ||
2 | This file is part of KAddressBook. | ||
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | ||
4 | |||
5 | This program is free software; you can rremovePageedistribute it and/or modify | ||
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 | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
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 | ||
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
18 | |||
19 | As a special exception, permission is given to link this program | ||
20 | with any edition of Qt, and distribute the resulting executable, | ||
21 | without including the source code for Qt in the source distribution. | ||
22 | */ | ||
23 | |||
24 | #ifndef VIEWCONFIGUREWIDGET_H | ||
25 | #define VIEWCONFIGUREWIDGET_H | ||
26 | |||
27 | |||
28 | |||
29 | #include "configurewidget.h" | ||
30 | |||
31 | class QVBox; | ||
32 | |||
33 | #include <kdialogbase.h> | ||
34 | #include <qpixmap.h> | ||
35 | |||
36 | class KJanusWidget; | ||
37 | class QString; | ||
38 | class ViewConfigureFieldsPage; | ||
39 | class ViewConfigureFilterPage; | ||
40 | class ViewConfigureDialog; | ||
41 | /** | ||
42 | This widget is the base class for all view configuration widgets. The | ||
43 | author of a view may wish to inherit from this widget and add config pages | ||
44 | that add custom config options. The default implementation of this widget | ||
45 | is to show a page with the select fields widget. For simple views this may | ||
46 | be sufficient. | ||
47 | */ | ||
48 | class ViewConfigureWidget : public ConfigureWidget | ||
49 | { | ||
50 | Q_OBJECT | ||
51 | |||
52 | public: | ||
53 | ViewConfigureWidget( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 ); | ||
54 | virtual ~ViewConfigureWidget(); | ||
55 | |||
56 | /** | ||
57 | Reads the configuration from the config object and sets the values | ||
58 | in the GUI. If this method is overloaded, be sure to call the base | ||
59 | class's method. | ||
60 | |||
61 | Do not change the group of the config object in this method. | ||
62 | */ | ||
63 | virtual void restoreSettings( KConfig *config ); | ||
64 | |||
65 | /** | ||
66 | Writes the configuration from the GUI to the config object. If this | ||
67 | method is overloaded, be sure to call the base class's method. | ||
68 | |||
69 | Do not change the group of the config object in this method. | ||
70 | */ | ||
71 | virtual void saveSettings( KConfig *config ); | ||
72 | |||
73 | |||
74 | /** | ||
75 | Use this method to add new pages to the widget. | ||
76 | */ | ||
77 | QVBox *addPage( const QString &item, const QString &header = QString::null, | ||
78 | const QPixmap &pixmap = QPixmap() ); | ||
79 | |||
80 | private: | ||
81 | KJanusWidget *mMainWidget; | ||
82 | |||
83 | ViewConfigureFieldsPage *mFieldsPage; | ||
84 | ViewConfigureFilterPage *mFilterPage; | ||
85 | }; | ||
86 | |||
87 | class ViewConfigureDialog : public KDialogBase | ||
88 | { | ||
89 | Q_OBJECT | ||
90 | |||
91 | public: | ||
92 | ViewConfigureDialog( ViewConfigureWidget *wdg, const QString &viewName, | ||
93 | QWidget *parent, const char *name = 0 ); | ||
94 | ~ViewConfigureDialog(); | ||
95 | |||
96 | void restoreSettings( KConfig* ); | ||
97 | void saveSettings( KConfig* ); | ||
98 | void setWidget( ViewConfigureWidget *wdg ); | ||
99 | protected slots: | ||
100 | void slotHelp(); | ||
101 | |||
102 | private: | ||
103 | ViewConfigureWidget *mConfigWidget; | ||
104 | }; | ||
105 | |||
106 | #endif | ||