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

mailcommon

  • sources
  • kde-4.14
  • kdepim
  • mailcommon
  • filter
filtermanager.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 Tobias Koenig <tokoe@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef MAILCOMMON_FILTERMANAGER_H
21 #define MAILCOMMON_FILTERMANAGER_H
22 
23 #include "../mailcommon_export.h"
24 #include "mailfilter.h"
25 
26 #include <Akonadi/Item>
27 #include <Akonadi/ServerManager>
28 
29 #include <QObject>
30 
31 namespace MailCommon {
32 
33 class FilterActionDict;
34 
40 class MAILCOMMON_EXPORT FilterManager : public QObject
41 {
42  Q_OBJECT
43 
44 public:
48  enum FilterSet {
49  NoSet = 0x0,
50  Inbound = 0x1,
51  Outbound = 0x2,
52  Explicit = 0x4,
53  BeforeOutbound = 0x8,
54  All = Inbound|BeforeOutbound|Outbound|Explicit
55  };
56 
60  static FilterManager *instance();
61 
65  bool isValid() const;
66 
71  QString createUniqueFilterName( const QString &name ) const;
72 
76  static FilterActionDict *filterActionDict();
77 
83  void showFilterLogDialog(qlonglong windowId);
84 
86 
91  void filter( const Akonadi::Item &item, const QString &identifier, const QString &resourceId ) const;
92 
103  void filter( const Akonadi::Item &item, FilterSet set = Inbound,
104  bool account = false, const QString &resourceId = QString() ) const;
105 
114  void filter( const Akonadi::Item::List &messages, FilterSet set = Explicit ) const;
115 
116  void filter( const Akonadi::Item::List &messages, SearchRule::RequiredPart requiredPart,
117  const QStringList &listFilters ) const;
118 
120 
126  void appendFilters( const QList<MailCommon::MailFilter*> &filters,
127  bool replaceIfNameExists = false );
128 
133  void removeFilter( MailCommon::MailFilter *filter );
134 
139  void setFilters( const QList<MailCommon::MailFilter*> &filters );
140 
144  QList<MailCommon::MailFilter*> filters() const;
145 
149  void beginUpdate();
150 
154  void endUpdate();
155 
156  QMap<QUrl, QString> tagList() const;
157 
158  bool initialized() const;
159 
160 private Q_SLOTS:
161  void slotServerStateChanged(Akonadi::ServerManager::State);
162  void slotFinishedTagListing(KJob *);
163  void slotReadConfig();
164  void updateTagList();
165 
166  void slotTagAdded(const Akonadi::Tag &);
167  void slotTagChanged(const Akonadi::Tag &);
168  void slotTagRemoved(const Akonadi::Tag &);
169 
170 Q_SIGNALS:
174  void filtersChanged();
175 
176  void tagListingFinished();
177 
178  void loadingFiltersDone();
179 
180 private:
181  FilterManager();
182 
183  class Private;
184  Private *const d;
185 };
186 
187 }
188 
189 #endif
MailCommon::FilterManager
A wrapper class that allows easy access to the mail filters.
Definition: filtermanager.h:40
QMap< QUrl, QString >
mailfilter.h
QObject
MailCommon::SearchRule::RequiredPart
RequiredPart
Definition: searchrule.h:79
QString
QList< MailCommon::MailFilter * >
QStringList
MAILCOMMON_EXPORT
#define MAILCOMMON_EXPORT
Definition: mailcommon_export.h:35
MailCommon::FilterActionDict
List of known FilterAction-types.
Definition: filteractiondict.h:65
MailCommon::FilterManager::FilterSet
FilterSet
Describes the list of filters.
Definition: filtermanager.h:48
MailCommon::MailFilter
Definition: mailfilter.h:42
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

KDE's Doxygen guidelines are available online.

mailcommon

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

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal