FEATURE: (contracted in prokde35)
[kdepim.git] / libkdepim / categoryselectdialog.h
blob1861b0363ee7014299c1e3401652aecefacf6e07
1 /*
2 This file is part of libkdepim.
4 Copyright (c) 2000, 2001, 2002 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
22 #ifndef KPIM_CATEGORYSELECTDIALOG_H
23 #define KPIM_CATEGORYSELECTDIALOG_H
25 #include <kdialog.h>
26 #include <kdepim_export.h>
27 #include "ui_categoryselectdialog_base.h"
29 class KPimPrefs;
30 class Q3ListView;
32 namespace KPIM {
34 class CategorySelectWidgetBase : public QWidget, public Ui::CategorySelectDialog_base
36 public:
37 CategorySelectWidgetBase( QWidget *parent ) : QWidget( parent ) {
38 setupUi( this );
43 class KDEPIM_EXPORT CategorySelectWidget : public QWidget
45 Q_OBJECT
46 public:
47 CategorySelectWidget(QWidget *parent, KPimPrefs *prefs);
48 ~CategorySelectWidget();
50 void setCategories( const QStringList &categoryList = QStringList() );
51 void setSelected( const QStringList &selList );
52 QStringList selectedCategories() const;
53 void setAutoselectChildren( bool autoselectChildren );
54 void setCategoryList(const QStringList &categories);
56 void hideButton();
57 void hideHeader();
59 Q3ListView *listView() const;
61 public slots:
62 void clear();
64 signals:
65 void editCategories();
67 private:
68 QStringList mCategoryList;
69 CategorySelectWidgetBase *mWidgets;
70 KPimPrefs *mPrefs;
73 class KDEPIM_EXPORT CategorySelectDialog : public KDialog
75 Q_OBJECT
76 public:
77 CategorySelectDialog( KPimPrefs *prefs, QWidget *parent = 0,
78 const char *name = 0, bool modal = false );
79 ~CategorySelectDialog();
81 QStringList selectedCategories() const;
82 void setCategoryList(const QStringList &categories);
84 void setAutoselectChildren( bool autoselectChildren );
85 void setSelected( const QStringList &selList );
87 public slots:
88 void slotOk();
89 void slotApply();
90 void updateCategoryConfig();
92 signals:
93 void categoriesSelected( const QString & );
94 void categoriesSelected( const QStringList & );
95 void editCategories();
97 private:
98 CategorySelectWidget *mWidgets;
100 class CategorySelectDialogPrivate;
101 CategorySelectDialogPrivate *d;
106 #endif