You need a space here
[kdepim.git] / kaddressbook / viewconfigurewidget.h
blob0afe3b4f8b9c4186f00f31b1bd256676a67e08ea
1 /*
2 This file is part of KAddressBook.
3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
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
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
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.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
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.
24 #ifndef VIEWCONFIGUREWIDGET_H
25 #define VIEWCONFIGUREWIDGET_H
27 #include "kaddressbook_export.h"
28 #include "configurewidget.h"
30 #include <kdialog.h>
31 #include <kvbox.h>
33 #include <QtGui/QPixmap>
35 class KPageWidget;
37 class QString;
38 class KVBox;
40 class ViewConfigureFieldsPage;
41 class ViewConfigureFilterPage;
43 /**
44 This widget is the base class for all view configuration widgets. The
45 author of a view may wish to inherit from this widget and add config pages
46 that add custom config options. The default implementation of this widget
47 is to show a page with the select fields widget. For simple views this may
48 be sufficient.
50 class KADDRESSBOOK_EXPORT ViewConfigureWidget : public KAB::ConfigureWidget
52 Q_OBJECT
54 public:
55 ViewConfigureWidget( KABC::AddressBook *ab, QWidget *parent );
56 virtual ~ViewConfigureWidget();
58 /**
59 Reads the configuration from the config object and sets the values
60 in the GUI. If this method is overloaded, be sure to call the base
61 class's method.
64 virtual void restoreSettings( const KConfigGroup &config );
66 /**
67 Writes the configuration from the GUI to the config object. If this
68 method is overloaded, be sure to call the base class's method.
71 virtual void saveSettings( KConfigGroup &config );
74 /**
75 Use this method to add new pages to the widget.
77 KVBox *addPage( const QString &item, const QString &header = QString(),
78 const QPixmap &pixmap = QPixmap() );
80 private:
81 KPageWidget *mMainWidget;
83 ViewConfigureFieldsPage *mFieldsPage;
84 ViewConfigureFilterPage *mFilterPage;
87 class ViewConfigureDialog : public KDialog
89 Q_OBJECT
91 public:
92 ViewConfigureDialog( ViewConfigureWidget *wdg, const QString &viewName,
93 QWidget *parent );
94 virtual ~ViewConfigureDialog();
96 void restoreSettings( const KConfigGroup& );
97 void saveSettings( KConfigGroup& );
99 protected Q_SLOTS:
100 void slotHelp();
102 private:
103 ViewConfigureWidget *mConfigWidget;
106 #endif