korganizer

filtereditdialog.h

00001 /*
00002     This file is part of KOrganizer.
00003     Copyright (c) 2001, 2002 Cornelius Schumacher <schumacher@kde.org>
00004     Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00005     Copyright (C) 2005 Thomas Zander <zander@kde.org>
00006 
00007     This program is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or
00010     (at your option) any later version.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020 
00021     As a special exception, permission is given to link this program
00022     with any edition of TQt, and distribute the resulting executable,
00023     without including the source code for TQt in the source distribution.
00024 */
00025 #ifndef _FILTEREDITDIALOG_H
00026 #define _FILTEREDITDIALOG_H
00027 
00028 #include <kdialogbase.h>
00029 #include "filteredit_base.h"
00030 
00031 class FilterEdit;
00032 template<class type> class TQPtrList;
00033 
00034 namespace KPIM { class CategorySelectDialog; }
00035 namespace KCal { class CalFilter; }
00036 
00037 using namespace KCal;
00038 
00045 class FilterEditDialog : public KDialogBase
00046 {
00047     Q_OBJECT
00048   
00049   public:
00050     FilterEditDialog(TQPtrList<CalFilter> *,TQWidget *parent=0, const char *name=0);
00051     virtual ~FilterEditDialog();
00052 
00053   signals:
00054     void filterChanged();
00055     void editCategories();
00056 
00057   public slots:
00058     void updateFilterList();
00059     void updateCategoryConfig();
00060     void setDialogConsistent(bool consistent);
00061 
00062   private:
00063     FilterEdit *mFilterEdit;
00064 
00065   protected slots:
00066     void slotApply();
00067     void slotOk();
00068 };
00069 
00070 class FilterEdit : public FilterEdit_base
00071 {
00072     Q_OBJECT
00073   
00074   public:
00075     FilterEdit(TQPtrList<CalFilter> *filters, TQWidget *parent);
00076     ~FilterEdit();
00077 
00078     void updateFilterList();
00079     void saveChanges();
00080     void updateCategoryConfig();
00081 
00082   signals:
00083     void dataConsistent(bool);
00084     void filterChanged();
00085     void editCategories();
00086 
00087   private slots:
00088     void filterSelected();
00089     void bNewPressed();
00090     void bDeletePressed();
00091     void updateSelectedName(const TQString &);
00092     void updateCategorySelection(const TQStringList &categories);
00093     void editCategorySelection();
00094 
00095   private:
00096     void filterSelected(CalFilter *f);
00097 
00098     TQPtrList<CalFilter> *mFilters;
00099     CalFilter *current;
00100     KPIM::CategorySelectDialog *mCategorySelectDialog;
00101 };
00102 
00103 #endif