00001 /* 00002 Copyright 2010 Ulrich Weigelt <ulrich.weigelt@gmx.de> 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU General Public License as 00006 published by the Free Software Foundation; either version 2 of 00007 the License, or (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef FILTERSETUPDIALOG_H 00019 #define FILTERSETUPDIALOG_H 00020 00021 //button IDs 00022 #define ID_BUTTON_LINKAGE_MATCH_ALL 1 00023 #define ID_BUTTON_LINKAGE_MATCH_ANY 2 00024 00025 //Qt headers 00026 #include <qlayout.h> 00027 #include <qgroupbox.h> 00028 #include <qbuttongroup.h> 00029 #include <qradiobutton.h> 00030 #include <qtooltip.h> 00031 #include <qlabel.h> 00032 #include <QPointer> 00033 00034 //KDE headers 00035 #include <KDialog> 00036 #include <klocale.h> 00037 #include <kpushbutton.h> 00038 #include <kcombobox.h> 00039 #include <klineedit.h> 00040 00041 //KShowmail headers 00042 #include "filtersetupitem.h" 00043 #include "filtercriteriawidget.h" 00044 #include "constants.h" 00045 #include "mailboxwizard.h" 00046 00047 //IDs of the action combo box 00048 #define ID_COMBO_FILTER_ACTION_PASS 0 00049 #define ID_COMBO_FILTER_ACTION_DELETE 1 00050 #define ID_COMBO_FILTER_ACTION_MARK 2 00051 #define ID_COMBO_FILTER_ACTION_MOVE 3 00052 #define ID_COMBO_FILTER_ACTION_SPAMCHECK 4 00053 #define ID_COMBO_FILTER_ACTION_IGNORE 5 00054 00059 class FilterSetupDialog : public KDialog 00060 { 00061 00062 Q_OBJECT 00063 00064 public: 00070 explicit FilterSetupDialog( QWidget* parent, FilterSetupItem* item = NULL ); 00071 00075 ~FilterSetupDialog(); 00076 00077 private: 00078 00082 FilterSetupItem* filter; 00083 00087 QTreeWidget* listView; 00088 00092 KLineEdit* txtName; 00093 00097 QButtonGroup* grpLinkage; 00098 00102 QWidget* wdgCriteriasHolding; 00103 00107 QVBoxLayout* layCriteriasHolding; 00108 00112 KPushButton* btnAddCriteria; 00113 00117 KPushButton* btnRemoveCriteria; 00118 00122 KComboBox* cmbAction; 00123 00127 KLineEdit* txtMailbox; 00128 00132 KPushButton* btnMailboxWizard; 00133 00134 00135 protected: 00136 00140 void fillDialog(); 00141 00148 void addCriteriaWidget( int source, int condition, uint value ); 00149 00157 void addCriteriaWidget( int source, int condition, QString value, bool cs ); 00158 00159 00160 protected slots: 00161 00170 void slotButtonClicked( int button ); 00171 00177 void slotActionChanged( int index ); 00178 00183 FilterCriteriaWidget* slotAddCriteriaWidget(); 00184 00188 void slotRemoveCriteriaWidget(); 00189 00194 void slotOpenMailBoxWizard(); 00195 }; 00196 00197 #endif