SenderListFilter Class Reference

This class represents both the blacklist and the whitelist. For using create an object of it and call check() to test a sender address. You have to call load() after the settings in the config file was changed. More...

#include <senderlistfilter.h>

List of all members.

Public Member Functions

 SenderListFilter ()
 ~SenderListFilter ()
FilterAction_Type check (QString sender) const
void load ()
void print ()
bool isOnWhitelist (const QString &sender) const
QStringList getBlacklist () const
QStringList getWhitelist () const

Protected Member Functions

bool search (QStringList list, QString sender) const

Private Attributes

KSharedConfigPtr config
QStringList blacklist
QStringList whitelist
FilterAction_Type blacklistAction

Detailed Description

This class represents both the blacklist and the whitelist. For using create an object of it and call check() to test a sender address. You have to call load() after the settings in the config file was changed.

Author:
Ulrich Weigelt <ulrich.weigelt@gmx.de>

Definition at line 44 of file senderlistfilter.h.


Constructor & Destructor Documentation

SenderListFilter::SenderListFilter (  ) 

Constructor

Definition at line 20 of file senderlistfilter.cpp.

SenderListFilter::~SenderListFilter (  ) 

Destructor

Definition at line 32 of file senderlistfilter.cpp.


Member Function Documentation

FilterAction_Type SenderListFilter::check ( QString  sender  )  const

Checks the given sender whether it is listed in the blacklist or whitelist.

Parameters:
sender sender which shall be checked
Returns:
appointed action (FActPass, FActDelete, FActMark, FActNone)

Definition at line 36 of file senderlistfilter.cpp.

QStringList SenderListFilter::getBlacklist (  )  const

Returns the blacklist

Returns:
the blacklist

Definition at line 115 of file senderlistfilter.cpp.

QStringList SenderListFilter::getWhitelist (  )  const

Returns the whitelist

Returns:
the whitelist

Definition at line 120 of file senderlistfilter.cpp.

bool SenderListFilter::isOnWhitelist ( const QString &  sender  )  const

Checks whether sender is on the whitelist

Parameters:
sender the sender to check
Returns:
TRUE - sender is listed on the whitelist

Definition at line 110 of file senderlistfilter.cpp.

void SenderListFilter::load (  ) 

Loads the setup from the application config file.

Definition at line 51 of file senderlistfilter.cpp.

void SenderListFilter::print (  ) 

Prints the settings.

Definition at line 85 of file senderlistfilter.cpp.

bool SenderListFilter::search ( QStringList  list,
QString  sender 
) const [protected]

Returns TRUE if the given list contains the sender or a part of it. e.g.: The list contains: Ulrich Weigelt spam@spamhouse.com "Lara Croft" <lara.croft@tombraider.com>

This sender strings will cause a return value of TRUE: "Ulrich Weigelt" <ulrich.weigelt@gmx.de> "Spam King" <spam@spamhouse.com> spam@spamhouse.com lara.croft@tombraider.com "Lara Croft" <lara.croft@tombraider.com>

Parameters:
list blacklist or whitelist
Parameters:
sender searched sender name
Returns:
TRUE - the given sender name is listed. FALSE - is not listed

Definition at line 69 of file senderlistfilter.cpp.


Member Data Documentation

QStringList SenderListFilter::blacklist [private]

blacklisted addresses

Definition at line 104 of file senderlistfilter.h.

appointed action of the blacklist.

Definition at line 114 of file senderlistfilter.h.

KSharedConfigPtr SenderListFilter::config [private]

Connector to the configuration file

Definition at line 99 of file senderlistfilter.h.

QStringList SenderListFilter::whitelist [private]

whitelisted addresses

Definition at line 109 of file senderlistfilter.h.


The documentation for this class was generated from the following files:
Generated on Sun Mar 13 15:27:10 2011 for KShowmail by  doxygen 1.6.3