• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kmail

KMFilterMgr Class Reference

#include <kmfiltermgr.h>

Inheritance diagram for KMFilterMgr:

Inheritance graph
[legend]

List of all members.


Detailed Description

Definition at line 29 of file kmfiltermgr.h.


Public Types

enum  FilterSet {
  NoSet = 0x0, Inbound = 0x1, Outbound = 0x2, Explicit = 0x4,
  All = Inbound|Outbound|Explicit
}

Public Slots

void slotFolderRemoved (KMFolder *aFolder)

Signals

void filterListUpdated ()

Public Member Functions

void appendFilters (const QList< KMFilter * > &filters, bool replaceIfNameExists=false)
bool atLeastOneFilterAppliesTo (unsigned int accountID) const
bool atLeastOneIncomingFilterAppliesTo (unsigned int accountID) const
bool atLeastOneOnlineImapFolderTarget ()
bool beginFiltering (KMMsgBase *msgBase) const
void beginUpdate ()
void cleanup ()
void clear ()
void createFilter (const QByteArray &field, const QString &value)
const QString createUniqueName (const QString &name)
void deref (bool force=false)
void dump () const
void endFiltering (KMMsgBase *msgBase) const
void endUpdate ()
const QList< KMFilter * > & filters () const
void folderCreated (KMFolder *)
bool folderRemoved (KMFolder *aFolder, KMFolder *aNewFolder)
 KMFilterMgr (bool popFilter=false)
int moveMessage (KMMessage *msg) const
void openDialog (QWidget *parent, bool checkForEmptyFilterList=true)
int process (quint32 serNum, const KMFilter *filter)
int process (KMMessage *msg, const KMFilter *filter)
int process (KMMessage *msg, FilterSet aSet=Inbound, bool account=false, uint accountId=0)
void readConfig (void)
void ref ()
void setFilters (const QList< KMFilter * > &filters)
void setShowLaterMsgs (bool show)
bool showLaterMsgs () const
int tempOpenFolder (KMFolder *aFolder)
void writeConfig (bool withSync=true)
virtual ~KMFilterMgr ()

Member Enumeration Documentation

enum KMFilterMgr::FilterSet

Enumerator:
NoSet 
Inbound 
Outbound 
Explicit 
All 

Definition at line 40 of file kmfiltermgr.h.


Constructor & Destructor Documentation

KMFilterMgr::KMFilterMgr ( bool  popFilter = false  ) 

Definition at line 33 of file kmfiltermgr.cpp.

KMFilterMgr::~KMFilterMgr (  )  [virtual]

Definition at line 49 of file kmfiltermgr.cpp.


Member Function Documentation

void KMFilterMgr::appendFilters ( const QList< KMFilter * > &  filters,
bool  replaceIfNameExists = false 
)

Append the list of filters to the current list of filters and write everything back into the configuration.

The filter manager takes ownership of the filters in the list.

Definition at line 446 of file kmfiltermgr.cpp.

bool KMFilterMgr::atLeastOneFilterAppliesTo ( unsigned int  accountID  )  const

Returns whether at least one filter applies to this account, which means that mail must be downloaded in order to be filtered, for example;.

Definition at line 305 of file kmfiltermgr.cpp.

bool KMFilterMgr::atLeastOneIncomingFilterAppliesTo ( unsigned int  accountID  )  const

Returns whether at least one incoming filter applies to this account, which means that mail must be downloaded in order to be filtered, for example;.

Definition at line 316 of file kmfiltermgr.cpp.

bool KMFilterMgr::atLeastOneOnlineImapFolderTarget (  ) 

Returns whether at least one filter targets a folder on an online IMAP account.

Definition at line 327 of file kmfiltermgr.cpp.

bool KMFilterMgr::beginFiltering ( KMMsgBase *  msgBase  )  const

Definition at line 98 of file kmfiltermgr.cpp.

void KMFilterMgr::beginUpdate (  )  [inline]

Called at the beginning of an filter list update.

Currently a no-op

Definition at line 145 of file kmfiltermgr.h.

void KMFilterMgr::cleanup (  ) 

void KMFilterMgr::clear (  ) 

Clears the list of filters and deletes them.

Definition at line 56 of file kmfiltermgr.cpp.

void KMFilterMgr::createFilter ( const QByteArray &  field,
const QString &  value 
)

Open an edit dialog, create a new filter and preset the first rule with "field equals value".

Definition at line 413 of file kmfiltermgr.cpp.

const QString KMFilterMgr::createUniqueName ( const QString &  name  ) 

Check for existing filters with the &p name and extend the "name" to "name (i)" until no match is found for i=1.

.n

Definition at line 421 of file kmfiltermgr.cpp.

void KMFilterMgr::deref ( bool  force = false  ) 

Decrement the reference count for the filter manager.

Call this method after processing messages with process(). Shall be called after all messages are processed. If the reference count is zero then this method closes all folders that have been temporarily opened with tempOpenFolder().

Definition at line 362 of file kmfiltermgr.cpp.

void KMFilterMgr::dump ( void   )  const

Output all rules to stdout.

Definition at line 498 of file kmfiltermgr.cpp.

void KMFilterMgr::endFiltering ( KMMsgBase *  msgBase  )  const

Definition at line 122 of file kmfiltermgr.cpp.

void KMFilterMgr::endUpdate ( void   ) 

Called at the end of an filter list update.

Definition at line 508 of file kmfiltermgr.cpp.

void KMFilterMgr::filterListUpdated (  )  [signal]

const QList<KMFilter*>& KMFilterMgr::filters (  )  const [inline]

Returns:
the list of filters managed by this object

Definition at line 96 of file kmfiltermgr.h.

void KMFilterMgr::folderCreated ( KMFolder *   )  [inline]

Called from the folder manager when a new folder has been created.

Forwards this to the filter dialog if that is open.

Definition at line 163 of file kmfiltermgr.h.

bool KMFilterMgr::folderRemoved ( KMFolder *  aFolder,
KMFolder *  aNewFolder 
)

Called from the folder manager when a folder is removed.

Tests if the folder aFolder is used in any action. Changes to aNewFolder folder in this case. Returns true if a change occurred.

Definition at line 483 of file kmfiltermgr.cpp.

int KMFilterMgr::moveMessage ( KMMessage *  msg  )  const

Definition at line 110 of file kmfiltermgr.cpp.

void KMFilterMgr::openDialog ( QWidget *  parent,
bool  checkForEmptyFilterList = true 
)

Open an edit dialog.

If checkForEmptyFilterList is true, an empty filter is created to improve the visibility of the dialog in case no filter has been defined so far.

Definition at line 397 of file kmfiltermgr.cpp.

int KMFilterMgr::process ( quint32  serNum,
const KMFilter *  filter 
)

For ad-hoc filters.

Applies filter to message with serNum . Return codes are as with the above method.

Definition at line 164 of file kmfiltermgr.cpp.

int KMFilterMgr::process ( KMMessage *  msg,
const KMFilter *  filter 
)

For ad-hoc filters.

Applies filter to msg. Return codes are as with the above method.

Deprecated:
Use int process( quint32, const KMFilter * )

Definition at line 139 of file kmfiltermgr.cpp.

int KMFilterMgr::process ( KMMessage *  msg,
FilterSet  aSet = Inbound,
bool  account = false,
uint  accountId = 0 
)

Process given message by applying the filter rules one by one.

You can select which set of filters (incoming or outgoing) should be used.

Parameters:
msg The message to process.
aSet Select the filter set to use.
account true if an account id is specified else false
accountId The id of the KMAccount that the message was retrieved from
Returns:
2 if a critical error occurred (eg out of disk space) 1 if the caller is still owner of the message and 0 otherwise. If the caller does not any longer own the message he *must* not delete the message or do similar stupid things. ;-)

Definition at line 218 of file kmfiltermgr.cpp.

void KMFilterMgr::readConfig ( void   ) 

Reload filter rules from config file.

Definition at line 64 of file kmfiltermgr.cpp.

void KMFilterMgr::ref ( void   ) 

Increment the reference count for the filter manager.

Call this method before processing messages with process()

Definition at line 356 of file kmfiltermgr.cpp.

void KMFilterMgr::setFilters ( const QList< KMFilter * > &  filters  ) 

Replace the list of filters under control of the filter manager.

The manager takes ownershipt of the filters.

Definition at line 468 of file kmfiltermgr.cpp.

void KMFilterMgr::setShowLaterMsgs ( bool  show  )  [inline]

Set the global option 'Show Download Later Messages'.

Definition at line 166 of file kmfiltermgr.h.

bool KMFilterMgr::showLaterMsgs (  )  const [inline]

Get the global option 'Show Download Later Messages'.

Definition at line 171 of file kmfiltermgr.h.

void KMFilterMgr::slotFolderRemoved ( KMFolder *  aFolder  )  [slot]

Definition at line 477 of file kmfiltermgr.cpp.

int KMFilterMgr::tempOpenFolder ( KMFolder *  aFolder  ) 

Open given folder and mark it as temporarily open.

The folder will be closed upon next call of cleanip(). This method is usually only called from within filter actions during process(). Returns returncode from KMFolder::open() call.

Definition at line 382 of file kmfiltermgr.cpp.

void KMFilterMgr::writeConfig ( bool  withSync = true  ) 

Store filter rules in config file.

Definition at line 77 of file kmfiltermgr.cpp.


The documentation for this class was generated from the following files:
  • kmfiltermgr.h
  • kmfiltermgr.cpp

kmail

Skip menu "kmail"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal