kaddressbook
filter.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FILTER_H
00025 #define FILTER_H
00026
00027 #include <qstring.h>
00028 #include <qstringlist.h>
00029 #include <qvaluelist.h>
00030
00031 #include <kabc/addressee.h>
00032 #include <kconfig.h>
00033
00039 class Filter
00040 {
00041 public:
00042 typedef QValueList<Filter> List;
00043
00044 enum MatchRule { Matching = 0, NotMatching = 1 };
00045
00046 Filter();
00047 Filter( const QString& name );
00048 ~Filter();
00049
00053 void setName( const QString &name );
00054
00058 const QString &name() const;
00059
00063 bool isInternal() const;
00064
00072 void apply( KABC::Addressee::List &addresseeList );
00073
00080 bool filterAddressee( const KABC::Addressee &a ) const;
00081
00085 void setEnabled( bool on );
00086
00090 bool isEnabled() const;
00091
00095 void setCategories( const QStringList &list );
00096
00100 const QStringList &categories() const;
00101
00105 void save( KConfig *config );
00106
00110 void restore( KConfig *config );
00111
00121 static void save( KConfig *config, const QString &baseGroup, Filter::List &list );
00122
00131 static Filter::List restore( KConfig *config, const QString &baseGroup );
00132
00139 void setMatchRule( MatchRule rule );
00140
00144 MatchRule matchRule() const;
00145
00149 bool isEmpty() const;
00150
00151 private:
00152 QString mName;
00153 QStringList mCategoryList;
00154 MatchRule mMatchRule;
00155 bool mEnabled;
00156 bool mInternal;
00157 bool mIsEmpty;
00158 };
00159
00160 #endif
|