korganizer

filtereditdialog.h
1 /*
2  This file is part of KOrganizer.
3  Copyright (c) 2001, 2002 Cornelius Schumacher <schumacher@kde.org>
4  Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
5  Copyright (C) 2005 Thomas Zander <zander@kde.org>
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program 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
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 
21  As a special exception, permission is given to link this program
22  with any edition of TQt, and distribute the resulting executable,
23  without including the source code for TQt in the source distribution.
24 */
25 #ifndef _FILTEREDITDIALOG_H
26 #define _FILTEREDITDIALOG_H
27 
28 #include <kdialogbase.h>
29 #include "filteredit_base.h"
30 
31 class FilterEdit;
32 template<class type> class TQPtrList;
33 
34 namespace KPIM { class CategorySelectDialog; }
35 namespace KCal { class CalFilter; }
36 
37 using namespace KCal;
38 
45 class FilterEditDialog : public KDialogBase
46 {
47  TQ_OBJECT
48 
49  public:
50  FilterEditDialog(TQPtrList<CalFilter> *,TQWidget *parent=0, const char *name=0);
51  virtual ~FilterEditDialog();
52 
53  signals:
54  void filterChanged();
55  void editCategories();
56 
57  public slots:
58  void updateFilterList();
59  void updateCategoryConfig();
60  void setDialogConsistent(bool consistent);
61 
62  private:
63  FilterEdit *mFilterEdit;
64 
65  protected slots:
66  void slotApply();
67  void slotOk();
68 };
69 
70 class FilterEdit : public FilterEdit_base
71 {
72  TQ_OBJECT
73 
74  public:
75  FilterEdit(TQPtrList<CalFilter> *filters, TQWidget *parent);
76  ~FilterEdit();
77 
78  void updateFilterList();
79  void saveChanges();
80  void updateCategoryConfig();
81 
82  signals:
83  void dataConsistent(bool);
84  void filterChanged();
85  void editCategories();
86 
87  private slots:
88  void filterSelected();
89  void bNewPressed();
90  void bDeletePressed();
91  void updateSelectedName(const TQString &);
92  void updateCategorySelection(const TQStringList &categories);
93  void editCategorySelection();
94 
95  private:
96  void filterSelected(CalFilter *f);
97 
98  TQPtrList<CalFilter> *mFilters;
99  CalFilter *current;
100  KPIM::CategorySelectDialog *mCategorySelectDialog;
101 };
102 
103 #endif
This is the class to add/edit a calendar filter.