00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef SENDERLISTFILTER_H
00019 #define SENDERLISTFILTER_H
00020
00021
00022 #include <qstring.h>
00023 #include <qstringlist.h>
00024
00025
00026 #include <kapplication.h>
00027 #include <kconfig.h>
00028 #include <kdebug.h>
00029 #include <KConfigGroup>
00030
00031
00032 #include "types.h"
00033 #include "constants.h"
00034
00035 using namespace Types;
00036
00044 class SenderListFilter{
00045
00046 public:
00047
00051 SenderListFilter();
00052
00056 ~SenderListFilter();
00057
00063 FilterAction_Type check( QString sender ) const;
00064
00068 void load();
00069
00073 void print();
00074
00080 bool isOnWhitelist( const QString& sender ) const;
00081
00086 QStringList getBlacklist() const;
00087
00092 QStringList getWhitelist() const;
00093
00094 private:
00095
00099 KSharedConfigPtr config;
00100
00104 QStringList blacklist;
00105
00109 QStringList whitelist;
00110
00114 FilterAction_Type blacklistAction;
00115
00116 protected:
00117
00136 bool search( QStringList list, QString sender ) const;
00137 };
00138
00139 #endif