kmail Library API Documentation

kmsearchpatternedit.h

00001 // -*- mode: C++; c-file-style: "gnu" -*- 00002 // kmfilterrulesedit.h 00003 // Author: Marc Mutz <Marc@Mutz.com> 00004 // This code is under GPL 00005 00006 #ifndef KMFILTERRULESEDIT_H 00007 #define KMFILTERRULESEDIT_H 00008 00009 #include "kwidgetlister.h" 00010 00011 #include <qgroupbox.h> 00012 #include <qstringlist.h> 00013 00014 class KMSearchRule; 00015 class KMSearchPattern; 00016 00017 template <typename T> class QPtrList; 00018 class QString; 00019 class QComboBox; 00020 class QLineEdit; 00021 class QRadioButton; 00022 class QWidgetStack; 00023 class QLabel; 00024 00039 class KMSearchRuleWidget : public QWidget 00040 { 00041 Q_OBJECT 00042 public: 00045 KMSearchRuleWidget( QWidget* parent=0, KMSearchRule* aRule=0, const char* name=0, bool headersOnly = false, bool absoluteDates = false ); 00046 00050 void setHeadersOnly( bool headersOnly ); 00056 void setRule( KMSearchRule* aRule ); 00058 KMSearchRule* rule() const; 00061 void reset(); 00062 static int ruleFieldToId( const QString & i18nVal ); 00063 00064 public slots: 00065 void slotFunctionChanged(); 00066 void slotValueChanged(); 00067 00068 signals: 00072 void fieldChanged( const QString & ); 00073 00076 void contentsChanged( const QString & ); 00077 00078 protected: 00081 static QCString ruleFieldToEnglish(const QString & i18nVal); 00084 int indexOfRuleField( const QCString & aName ) const; 00085 00086 protected slots: 00087 void slotRuleFieldChanged( const QString & ); 00088 00089 private: 00090 void initWidget(); 00091 void initFieldList( bool headersOnly, bool absoluteDates ); 00092 00093 QStringList mFilterFieldList; 00094 QComboBox *mRuleField; 00095 QWidgetStack *mFunctionStack; 00096 QWidgetStack *mValueStack; 00097 bool mAbsoluteDates; 00098 }; 00099 00100 00101 class KMSearchRuleWidgetLister : public KWidgetLister 00102 { 00103 Q_OBJECT 00104 00105 friend class KMSearchPatternEdit; 00106 00107 public: 00108 KMSearchRuleWidgetLister( QWidget *parent=0, const char* name=0, bool headersOnly = false, bool absoluteDates = false ); 00109 00110 virtual ~KMSearchRuleWidgetLister(); 00111 00112 void setRuleList( QPtrList<KMSearchRule> * aList ); 00113 void setHeadersOnly( bool headersOnly ); 00114 00115 public slots: 00116 void reset(); 00117 00118 protected: 00119 virtual void clearWidget( QWidget *aWidget ); 00120 virtual QWidget* createWidget( QWidget *parent ); 00121 00122 private: 00123 void regenerateRuleListFromWidgets(); 00124 QPtrList<KMSearchRule> *mRuleList; 00125 bool mHeadersOnly; 00126 bool mAbsoluteDates; 00127 }; 00128 00129 00162 class KMSearchPatternEdit : public QGroupBox { 00163 Q_OBJECT 00164 public: 00167 KMSearchPatternEdit(QWidget *parent=0, const char *name=0, bool headersOnly = false, bool absoluteDates = false); 00170 KMSearchPatternEdit(const QString & title, QWidget *parent=0, const char *name=0, bool headersOnly = false, bool absoluteDates = false); 00171 ~KMSearchPatternEdit(); 00172 00177 void setSearchPattern( KMSearchPattern* aPattern ); 00181 void setHeadersOnly( bool headersOnly ); 00182 00184 void updateSearchPattern() { mRuleLister->regenerateRuleListFromWidgets(); } 00185 00186 public slots: 00189 void reset(); 00190 00191 signals: 00194 void maybeNameChanged(); 00195 00196 private slots: 00197 void slotRadioClicked(int aIdx); 00198 void slotAutoNameHack(); 00199 00200 private: 00201 void initLayout( bool headersOnly, bool absoluteDates ); 00202 00203 KMSearchPattern *mPattern; 00204 QRadioButton *mAllRBtn, *mAnyRBtn; 00205 KMSearchRuleWidgetLister *mRuleLister; 00206 }; 00207 00208 #endif
KDE Logo
This file is part of the documentation for kmail Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Aug 27 12:52:49 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003