kmail Library API Documentation

KMFilterActionDict Class Reference

Dictionary that contains a list of all registered filter actions with their creation functions. List of known KMFilterAction-types. More...

#include <kmfilteraction.h>

Inheritance diagram for KMFilterActionDict:

QDict< KMFilterActionDesc > List of all members.

Public Methods

 KMFilterActionDict ()
void insert (KMFilterActionNewFunc aNewFunc)
const QPtrList< KMFilterActionDesc > & list () const

Protected Methods

virtual void init (void)

Detailed Description

Dictionary that contains a list of all registered filter actions with their creation functions. List of known KMFilterAction-types.

They are hard-coded into the constructor. If you want to add a new KMFilterAction, make sure you add the details of it in init, too.

You will be able to find a description of a KMFilterAction by looking up either it's (english) name or it's (i18n) label:

    KMFilterActionDict dict;
    // get name of the action with label "file into folder":
    dict[i18n("file into folder")]->name; // == "transfer"
    // create one such action:
    KMFilterAction *action = dict["transfer"]->create();
    

You can iterate over all known filter actions by using list.

Author:
Marc Mutz <Marc@Mutz.com>, based on work by Stefan Taferner <taferner@kde.org>
See also:
KMFilterAction KMFilterActionDesc KMFilter

Definition at line 631 of file kmfilteraction.h.


Member Function Documentation

void KMFilterActionDict::insert KMFilterActionNewFunc    aNewFunc
 

Overloaded member function, provided for convenience.

Thin wrapper around QDict::insert and QPtrList::insert. Inserts the resulting KMFilterActionDesc thrice: First with the name, then with the label as key into the QDict, then into the QPtrList. For that, it creates an instance of the action internally and deletes it again after querying it for name and label.

Definition at line 1761 of file kmfilteraction.cpp.

References QPtrList< KMFilterActionDesc >::append(), KMFilterActionDesc::create, QDict::insert(), KMFilterAction::label(), KMFilterActionDesc::label, KMFilterAction::name(), and KMFilterActionDesc::name.

Referenced by init().

const QPtrList<KMFilterActionDesc>& KMFilterActionDict::list   const [inline]
 

Provides read-only access to a list of all known filter actions.

Definition at line 647 of file kmfilteraction.h.

void KMFilterActionDict::init void    [protected, virtual]
 

Populate the dictionary with all known KMFilterAction types.

Called automatically from the constructor.

Definition at line 1732 of file kmfilteraction.cpp.

References insert().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kmail Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:37:36 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003