filtereditdialog.h
00001 /* 00002 This file is part of KAddressBook. 00003 Copyright (c) 2002 Mike Pilone <mpilone@slac.com> 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 00019 As a special exception, permission is given to link this program 00020 with any edition of TQt, and distribute the resulting executable, 00021 without including the source code for TQt in the source distribution. 00022 */ 00023 00024 #ifndef FILTEREDITDIALOG_H 00025 #define FILTEREDITDIALOG_H 00026 00027 class TQButtonGroup; 00028 class TQString; 00029 class TQToolButton; 00030 class TQWidget; 00031 00032 class KLineEdit; 00033 class KListBox; 00034 class KListView; 00035 00036 #include <kdialogbase.h> 00037 00038 #include "filter.h" 00039 00040 class FilterDialog : public KDialogBase 00041 { 00042 Q_OBJECT 00043 TQ_OBJECT 00044 00045 public: 00046 FilterDialog( TQWidget *parent, const char *name = 0 ); 00047 ~FilterDialog(); 00048 00049 void setFilters( const Filter::List &list ); 00050 Filter::List filters() const; 00051 00052 protected slots: 00053 void add(); 00054 void edit(); 00055 void remove(); 00056 void selectionChanged( TQListBoxItem* ); 00057 00058 private: 00059 void initGUI(); 00060 void refresh(); 00061 00062 Filter::List mFilterList; 00063 Filter::List mInternalFilterList; 00064 00065 KListBox *mFilterListBox; 00066 TQPushButton *mAddButton; 00067 TQPushButton *mEditButton; 00068 TQPushButton *mRemoveButton; 00069 }; 00070 00071 class FilterEditDialog : public KDialogBase 00072 { 00073 Q_OBJECT 00074 TQ_OBJECT 00075 public: 00076 FilterEditDialog( TQWidget *parent, const char *name = 0 ); 00077 ~FilterEditDialog(); 00078 00079 void setFilter( const Filter &filter ); 00080 Filter filter(); 00081 00082 protected slots: 00083 void filterNameTextChanged( const TQString& ); 00084 void slotHelp(); 00085 00086 private: 00087 void initGUI(); 00088 00089 Filter mFilter; 00090 00091 KLineEdit *mNameEdit; 00092 KListView *mCategoriesView; 00093 TQButtonGroup *mMatchRuleGroup; 00094 TQPushButton *mEditButton; 00095 TQPushButton *mRemoveButton; 00096 }; 00097 00098 #endif