MailCommon::FilterManager

Search for usage in LXR

#include <filtermanager.h>

Inheritance diagram for MailCommon::FilterManager:

Public Types

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

Signals

void filtersChanged ()
 
void loadingFiltersDone ()
 
void tagListingFinished ()
 

Public Member Functions

void appendFilters (const QVector< MailCommon::MailFilter * > &filters, bool replaceIfNameExists=false)
 
void beginUpdate ()
 
void cleanup ()
 
QString createUniqueFilterName (const QString &name) const
 
void endUpdate ()
 
void filter (const Akonadi::Collection &collection, const QStringList &listFilters) const
 
void filter (const Akonadi::Collection &collection, FilterSet set=Explicit) const
 
void filter (const Akonadi::Collection::List &collections, const QStringList &listFilters, FilterSet set=Explicit) const
 
void filter (const Akonadi::Collection::List &collections, FilterSet set=Explicit) const
 
void filter (const Akonadi::Item &item, const QString &identifier, const QString &resourceId) const
 
void filter (const Akonadi::Item &item, FilterSet set=Inbound, bool account=false, const QString &resourceId=QString()) const
 
void filter (const Akonadi::Item::List &messages, FilterSet set=Explicit) const
 
void filter (const Akonadi::Item::List &messages, SearchRule::RequiredPart requiredPart, const QStringList &listFilters) const
 
QVector< MailCommon::MailFilter * > filters () const
 
bool initialized () const
 
bool isValid () const
 
void removeFilter (MailCommon::MailFilter *filter)
 
void setFilters (const QVector< MailCommon::MailFilter * > &filters)
 
void showFilterLogDialog (qlonglong windowId)
 
QMap< QUrl, QStringtagList () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static FilterActionDictfilterActionDict ()
 
static FilterManagerinstance ()
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

A wrapper class that allows easy access to the mail filters.

This class communicates with the mailfilter agent via DBus.

Definition at line 26 of file filtermanager.h.

Member Enumeration Documentation

◆ FilterSet

Describes the list of filters.

Enumerator
AllFolders 

Apply the filter on all folders, not just inbox.

Definition at line 35 of file filtermanager.h.

Member Function Documentation

◆ appendFilters()

void FilterManager::appendFilters ( const QVector< MailCommon::MailFilter * > &  filters,
bool  replaceIfNameExists = false 
)

Manage filters interface.

Appends 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 296 of file filtermanager.cpp.

◆ beginUpdate()

void FilterManager::beginUpdate ( )

Should be called at the beginning of an filter list update.

Definition at line 324 of file filtermanager.cpp.

◆ createUniqueFilterName()

QString FilterManager::createUniqueFilterName ( const QString name) const

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

Definition at line 208 of file filtermanager.cpp.

◆ endUpdate()

void FilterManager::endUpdate ( )

Should be called at the end of an filter list update.

Definition at line 328 of file filtermanager.cpp.

◆ filter() [1/7]

void FilterManager::filter ( const Akonadi::Collection collection,
const QStringList listFilters 
) const

Apply specified filters on all messages in given collection.

Definition at line 244 of file filtermanager.cpp.

◆ filter() [2/7]

void FilterManager::filter ( const Akonadi::Collection collection,
FilterSet  set = Explicit 
) const

Process all messages in given collection by applying the filters rules one by one.

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

Definition at line 228 of file filtermanager.cpp.

◆ filter() [3/7]

void FilterManager::filter ( const Akonadi::Collection::List collections,
const QStringList listFilters,
FilterSet  set = Explicit 
) const

Apply specified filters on all messages in given collection.

Definition at line 249 of file filtermanager.cpp.

◆ filter() [4/7]

void FilterManager::filter ( const Akonadi::Collection::List collections,
FilterSet  set = Explicit 
) const

Process all messages in given collections by applying the filters rules one by one.

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

Definition at line 233 of file filtermanager.cpp.

◆ filter() [5/7]

void FilterManager::filter ( const Akonadi::Item item,
const QString identifier,
const QString resourceId 
) const

Apply filters interface.

Applies filter with the given identifier on the message item.

Returns
true on success, false otherwise.

Definition at line 218 of file filtermanager.cpp.

◆ filter() [6/7]

void FilterManager::filter ( const Akonadi::Item item,
FilterSet  set = Inbound,
bool  account = false,
const QString resourceId = QString() 
) const

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

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

Parameters
itemThe message item to process.
setSelect the filter set to use.
accounttrue if an account id is specified else false
accountIdThe id of the resource that the message was retrieved from

Definition at line 223 of file filtermanager.cpp.

◆ filter() [7/7]

void FilterManager::filter ( const Akonadi::Item::List messages,
FilterManager::FilterSet  set = Explicit 
) const

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

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

Parameters
itemThe message item to process.
setSelect the filter set to use.

Definition at line 260 of file filtermanager.cpp.

◆ filterActionDict()

FilterActionDict * FilterManager::filterActionDict ( )
static

Returns the global filter action dictionary.

Definition at line 97 of file filtermanager.cpp.

◆ filters()

QVector< MailCommon::MailFilter * > FilterManager::filters ( ) const

Returns the filter list of the manager.

Definition at line 291 of file filtermanager.cpp.

◆ filtersChanged

void MailCommon::FilterManager::filtersChanged ( )
signal

This signal is emitted whenever the filter list has been updated.

◆ instance()

FilterManager * FilterManager::instance ( )
static

Returns the global filter manager object.

Definition at line 88 of file filtermanager.cpp.

◆ isValid()

bool FilterManager::isValid ( ) const

Returns whether the filter manager is in a usable state.

Definition at line 203 of file filtermanager.cpp.

◆ removeFilter()

void FilterManager::removeFilter ( MailCommon::MailFilter filter)

Removes the given filter from the list.

The filter object is not deleted.

Definition at line 317 of file filtermanager.cpp.

◆ setFilters()

void FilterManager::setFilters ( const QVector< MailCommon::MailFilter * > &  filters)

Replace the list of filters of the filter manager with the given list of filters.

The manager takes ownership of the filters.

Definition at line 283 of file filtermanager.cpp.

◆ showFilterLogDialog()

void FilterManager::showFilterLogDialog ( qlonglong  windowId)

Shows the filter log dialog.

This is used to debug problems with filters.

Definition at line 213 of file filtermanager.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.