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"
33 #include <QtGui/QPixmap>
40 class ViewConfigureFieldsPage
;
41 class ViewConfigureFilterPage
;
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
50 class KADDRESSBOOK_EXPORT ViewConfigureWidget
: public KAB::ConfigureWidget
55 ViewConfigureWidget( KABC::AddressBook
*ab
, QWidget
*parent
);
56 virtual ~ViewConfigureWidget();
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
64 virtual void restoreSettings( const KConfigGroup
&config
);
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
);
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() );
81 KPageWidget
*mMainWidget
;
83 ViewConfigureFieldsPage
*mFieldsPage
;
84 ViewConfigureFilterPage
*mFilterPage
;
87 class ViewConfigureDialog
: public KDialog
92 ViewConfigureDialog( ViewConfigureWidget
*wdg
, const QString
&viewName
,
94 virtual ~ViewConfigureDialog();
96 void restoreSettings( const KConfigGroup
& );
97 void saveSettings( KConfigGroup
& );
103 ViewConfigureWidget
*mConfigWidget
;