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 Qt, and distribute the resulting executable,
00023     without including the source code for Qt 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 QPtrList;
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   public:
00049     FilterEditDialog(QPtrList<CalFilter> *,QWidget *parent=0, const char *name=0);
00050     virtual ~FilterEditDialog();
00051 
00052   signals:
00053     void filterChanged();
00054     void editCategories();
00055 
00056   public slots:
00057     void updateFilterList();
00058     void updateCategoryConfig();
00059     void setDialogConsistent(bool consistent);
00060 
00061   private:
00062     FilterEdit *mFilterEdit;
00063 
00064   protected slots:
00065     void slotApply();
00066     void slotOk();
00067 };
00068 
00069 class FilterEdit : public FilterEdit_base
00070 {
00071     Q_OBJECT
00072   public:
00073     FilterEdit(QPtrList<CalFilter> *filters, QWidget *parent);
00074     ~FilterEdit();
00075 
00076     void updateFilterList();
00077     void saveChanges();
00078     void updateCategoryConfig();
00079 
00080   signals:
00081     void dataConsistent(bool);
00082     void filterChanged();
00083     void editCategories();
00084 
00085   private slots:
00086     void filterSelected();
00087     void bNewPressed();
00088     void bDeletePressed();
00089     void updateSelectedName(const QString &);
00090     void updateCategorySelection(const QStringList &categories);
00091     void editCategorySelection();
00092 
00093   private:
00094     void filterSelected(CalFilter *f);
00095 
00096     QPtrList<CalFilter> *mFilters;
00097     CalFilter *current;
00098     KPIM::CategorySelectDialog *mCategorySelectDialog;
00099 };
00100 
00101 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys