Search for usage in LXR

MailCommon::FilterActionDict Class Reference

#include <filteractiondict.h>

Inheritance diagram for MailCommon::FilterActionDict:

Public Member Functions

virtual MAILCOMMON_EXPORT ~FilterActionDict ()
MAILCOMMON_EXPORT void insert (FilterActionNewFunc aNewFunc)
const MAILCOMMON_EXPORT QVector< FilterActionDesc * > & list () const
- Public Member Functions inherited from QMultiHash< QString, FilterActionDesc * >
 QMultiHash (const QHash< Key, T > &other)
 QMultiHash (InputIterator begin, InputIterator end)
 QMultiHash (std::initializer_list< std::pair< Key, T > > list)
typename QHash< Key, T >::const_iterator constFind (const Key &key, const T &value) const const
bool contains (const Key &key, const T &value) const const
int count (const Key &key, const T &value) const const
typename QHash< Key, T >::iterator find (const Key &key, const T &value)
typename QHash< Key, T >::const_iterator find (const Key &key, const T &value) const const
typename QHash< Key, T >::iterator insert (const Key &key, const T &value)
QMultiHash< K, V > operator+ (const QMultiHash< K, V > &other) const const
QMultiHash< K, V > & operator+= (const QMultiHash< K, V > &other)
uint qHash (const QMultiHash< Key, T > &key, uint seed)
int remove (const Key &key, const T &value)
typename QHash< Key, T >::iterator replace (const Key &key, const T &value)
void swap (QMultiHash< K, V > &other)
QList< Key > uniqueKeys () const const
QMultiHash< K, V > & unite (const QMultiHash< K, V > &other)
QList< T > values (const Key &key) const const

Protected Member Functions

virtual void init ()

Detailed Description

List of known FilterAction-types.

Dictionary that contains a list of all registered filter actions with their creation functions. They are hard-coded into the constructor. If you want to add a new FilterAction, make sure you add the details of it in init, too.

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

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

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

Marc Mutz [email protected][email protected]kde.[email protected]org, based on work by Stefan Taferner tafer[email protected][email protected][email protected]kde.o[email protected]rg
See also
FilterAction FilterActionDesc Filter

Definition at line 52 of file filteractiondict.h.

Constructor & Destructor Documentation

◆ FilterActionDict()

FilterActionDict::FilterActionDict ( )

Creates the filter action dictionary.

Definition at line 75 of file filteractiondict.cpp.

◆ ~FilterActionDict()

FilterActionDict::~FilterActionDict ( )

Destroys the filter action dictionary.

Definition at line 40 of file filteractiondict.cpp.

Member Function Documentation

◆ init()

void FilterActionDict::init ( )

Populate the dictionary with all known FilterAction types.

Called automatically from the constructor.

Definition at line 45 of file filteractiondict.cpp.

◆ insert()

void FilterActionDict::insert ( FilterActionNewFunc  aNewFunc)

Overloaded member function, provided for convenience.

Thin wrapper around QDict::insert and QPtrList::insert. Inserts the resulting FilterActionDesc 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 81 of file filteractiondict.cpp.

◆ list()

const QVector< FilterActionDesc * > & FilterActionDict::list ( ) const

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

Definition at line 96 of file filteractiondict.cpp.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Wed Sep 28 2022 03:59:03 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.