mailcommon
mailfilter.cpp
Go to the documentation of this file.
135 MailFilter::ReturnCode MailFilter::execActions( ItemContext &context, bool& stopIt, bool applyOnOutbound ) const
260 requiredPart = qMax( requiredPart, (int)pattern()->requiredPart() ) ; // no pattern means always matches?
275 void MailFilter::folderRemoved( const Akonadi::Collection & aFolder, const Akonadi::Collection& aNewFolder )
420 KMessageBox::information( 0, i18n("<qt>Too many filter actions in filter rule <b>%1</b>.</qt>", mPattern.name() ) );
435 const bool ret = fa->argsFromStringInteractive( config.readEntry( argsName, QString() ), name() );
451 i18n("<qt>Unknown filter action <b>%1</b><br />in filter rule <b>%2</b>.<br />Ignoring it.</qt>",
459 FilterActionMissingAccountDialog *dlg = new FilterActionMissingAccountDialog(mAccounts, name());
557 if ( !Akonadi::AgentManager::self()->instances().isEmpty() ) { // safety test to ensure that Akonadi system is ready
592 result += QString("Filter is %1\n").arg(bEnabled ? QLatin1String("enabled") : QLatin1String("disabled"));
637 QDataStream& MailCommon::operator<<( QDataStream &stream, const MailCommon::MailFilter &filter )
void setConfigureShortcut(bool aShort)
Set whether this filter should be plugged into the filter menu.
Definition: mailfilter.cpp:319
void clear()
void generateSieveScript(QStringList &requires, QString &code)
Definition: searchpattern.cpp:403
static bool allAccountExist(const QStringList &lst)
Definition: filteractionmissingargumentdialog.cpp:396
Definition: mailfilter.h:59
const T & next()
const T & previous()
QByteArray serialize() const
Writes the pattern into a byte array for persistance purposes.
Definition: searchpattern.cpp:350
void generateRandomIdentifier()
Definition: mailfilter.cpp:120
QString purify(bool removeAction=true)
Remove empty rules (and actions one day).
Definition: mailfilter.cpp:540
virtual SearchRule::RequiredPart requiredPart() const =0
Returns the required part from the item that is needed for the action to operate. ...
bool contains(const QString &str, Qt::CaseSensitivity cs) const
void readConfig(const KConfigGroup &config)
Reads a search pattern from a KConfigGroup.
Definition: searchpattern.cpp:161
void setApplyOnOutbound(bool aApply=true)
Set whether this filter should be applied on outbound messages (aApply == true) or not...
Definition: mailfilter.cpp:199
void setShortcut(const KShortcut &shortcut)
Set the shortcut to be used if plugged into the filter menu or toolbar.
Definition: mailfilter.cpp:345
virtual QString argsAsString() const =0
Return extra arguments as string.
iterator erase(iterator pos)
SearchRule::RequiredPart requiredPart(const QString &id) const
Returns the required part from the item that is needed for the filter to operate. ...
Definition: mailfilter.cpp:249
QList< FilterAction * > * actions()
Provides a reference to the internal action list.
Definition: mailfilter.cpp:179
const QString asString() const
Returns the filter in a human-readable form.
Definition: mailfilter.cpp:585
Definition: mailfilter.h:70
void generateSieveScript(QStringList &requires, QString &code)
Definition: mailfilter.cpp:470
static FilterLog * instance()
Returns the single global instance of the filter log.
Definition: filterlog.cpp:107
void setStopProcessingHere(bool aStop)
Definition: mailfilter.cpp:309
void append(const T &value)
virtual QString informationAboutNotValidAction() const
Definition: filteraction.cpp:60
void setApplyBeforeOutbound(bool aApply=true)
Set whether this filter should be applied on outbound messages before sending (aApply == TRUE) or not...
Definition: mailfilter.cpp:204
void deserialize(const QByteArray &)
Constructs the pattern from a byte array serialization.
Definition: searchpattern.cpp:358
bool isLogging() const
Returns whether the filter log is currently active.
Definition: filterlog.cpp:116
QString identifier() const
Returns the unique identifier of this filter.
Definition: mailfilter.cpp:125
void setToolbarName(const QString &toolbarName)
This sets the toolbar name for this filter.
Definition: mailfilter.cpp:340
virtual bool argsFromStringInteractive(const QString &argsStr, const QString &filterName)
Read extra arguments from given string.
Definition: filteraction.cpp:89
bool isEmpty() const
bool isEmpty() const
int removeAll(const T &value)
virtual bool isEmpty() const
Determines whether this action is valid.
Definition: filteraction.cpp:55
bool configureShortcut() const
Definition: mailfilter.cpp:325
typedef Iterator
bool configureToolbar() const
Definition: mailfilter.cpp:335
void writeConfig(KConfigGroup &config) const
Writes itself into config.
Definition: searchpattern.cpp:241
void toBack()
This class is an abstraction of a search over messages.
Definition: searchpattern.h:79
bool applyOnAccount(const QString &id) const
Definition: mailfilter.cpp:291
void writeConfig(KConfigGroup &config, bool exportFilter) const
Write contents to given config group.
Definition: mailfilter.cpp:496
iterator end()
QStringList selectedAccount() const
Definition: filteractionmissingargumentdialog.cpp:391
bool stopProcessingHere() const
Definition: mailfilter.cpp:314
Auxiliary struct for FilterActionDict.
Definition: filteractiondict.h:36
static FilterActionDict * filterActionDict()
Returns the global filter action dictionary.
Definition: filtermanager.cpp:106
Definition: searchrule.h:80
bool readConfig(const KConfigGroup &config, bool interactive=false)
Initialize from given config group.
Definition: mailfilter.cpp:376
Definition: mailfilter.h:59
MAILCOMMON_EXPORT QDataStream & operator>>(QDataStream &stream, MailFilter &filter)
Definition: mailfilter.cpp:668
Definition: mailfilter.h:70
bool hasPrevious() const
void setIcon(const QString &icon)
Set the icon to be used if plugged into the filter menu or toolbar.
Definition: mailfilter.cpp:355
AccountType applicability() const
Definition: mailfilter.cpp:244
void setApplicability(AccountType aApply=All)
Set whether this filter should be applied on inbound messages for all accounts (aApply == All) or inb...
Definition: mailfilter.cpp:239
QString & sprintf(const char *cformat,...)
MAILCOMMON_EXPORT QDataStream & operator<<(QDataStream &stream, const MailFilter &filter)
Definition: mailfilter.cpp:637
virtual void argsFromString(const QString &argsStr)=0
Read extra arguments from given string.
typedef ConstIterator
void setConfigureToolbar(bool aTool)
Set whether this filter should be plugged into the toolbar.
Definition: mailfilter.cpp:330
void setAutoNaming(bool useAutomaticNames)
Set the mode for using automatic naming for the filter.
Definition: mailfilter.cpp:365
ReturnCode execActions(ItemContext &context, bool &stopIt, bool applyOnOutbound) const
Execute the filter action(s) on the given message.
Definition: mailfilter.cpp:135
QString fromLatin1(const char *str, int size)
void setApplyOnExplicit(bool aApply=true)
Set whether this filter should be applied on explicit (CTRL-J) filtering (aApply == true) or not...
Definition: mailfilter.cpp:229
void setApplyOnInbound(bool aApply=true)
Set whether this filter should be applied on inbound messages (aApply == true) or not...
Definition: mailfilter.cpp:219
Definition: mailfilter.h:70
SearchRule::RequiredPart requiredPart() const
Returns the required part from the item that is needed for the search to operate. ...
Definition: searchpattern.cpp:123
void folderRemoved(const Akonadi::Collection &aFolder, const Akonadi::Collection &aNewFolder)
Called from the filter manager when a folder is moved.
Definition: mailfilter.cpp:275
void add(const QString &entry, ContentType type)
Adds the given log entry under the given content type to the log.
Definition: filterlog.cpp:164
QString purify(bool removeAction=true)
Removes all empty rules from the list.
Definition: searchpattern.cpp:136
void setApplyOnAccount(const QString &id, bool aApply=true)
Set whether this filter should be applied on inbound messages for the account with id (id)...
Definition: mailfilter.cpp:282
const_iterator constEnd() const
const_iterator constBegin() const
bool applyBeforeOutbound() const
Definition: mailfilter.cpp:214
SearchPattern * pattern()
Provides a reference to the internal pattern.
Definition: mailfilter.cpp:189
Definition: mailfilter.h:42
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
iterator begin()
bool hasNext() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:31:40 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:31:40 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.