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

mailcommon

  • sources
  • kde-4.12
  • 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 Nepomuk2 {
32 class Resource;
33 namespace Query {
34 class Result;
35 }
36 }
37 
38 namespace MailCommon {
39 
40 class FilterActionDict;
41 
47 class MAILCOMMON_EXPORT FilterManager : public QObject
48 {
49  Q_OBJECT
50 
51 public:
55  enum FilterSet {
56  NoSet = 0x0,
57  Inbound = 0x1,
58  Outbound = 0x2,
59  Explicit = 0x4,
60  BeforeOutbound = 0x8,
61  All = Inbound|BeforeOutbound|Outbound|Explicit
62  };
63 
67  static FilterManager *instance();
68 
72  bool isValid() const;
73 
78  QString createUniqueFilterName( const QString &name ) const;
79 
83  static FilterActionDict *filterActionDict();
84 
90  void showFilterLogDialog(qlonglong windowId);
91 
93 
98  void filter( const Akonadi::Item &item, const QString &identifier, const QString &resourceId ) const;
99 
110  void filter( const Akonadi::Item &item, FilterSet set = Inbound,
111  bool account = false, const QString &resourceId = QString() ) const;
112 
121  void filter( const Akonadi::Item::List &messages, FilterSet set = Explicit ) const;
122 
123  void filter( const Akonadi::Item::List &messages, SearchRule::RequiredPart requiredPart,
124  const QStringList &listFilters ) const;
125 
127 
133  void appendFilters( const QList<MailCommon::MailFilter*> &filters,
134  bool replaceIfNameExists = false );
135 
140  void removeFilter( MailCommon::MailFilter *filter );
141 
146  void setFilters( const QList<MailCommon::MailFilter*> &filters );
147 
151  QList<MailCommon::MailFilter*> filters() const;
152 
156  void beginUpdate();
157 
161  void endUpdate();
162 
163  QMap<QUrl, QString> tagList() const;
164 
165  bool initialized() const;
166 
167 private Q_SLOTS:
168  void slotServerStateChanged(Akonadi::ServerManager::State);
169  void slotFinishedTagListing();
170  void slotNewTagEntries(const QList<Nepomuk2::Query::Result>&);
171  void slotReadConfig();
172  void updateTagList();
173 
174  void resourceCreated(const Nepomuk2::Resource&,const QList<QUrl>&);
175  void resourceRemoved(const QUrl&,const QList<QUrl>&);
176  void propertyChanged(const Nepomuk2::Resource&);
177 
178 Q_SIGNALS:
182  void filtersChanged();
183 
184  void tagListingFinished();
185 
186  void loadingFiltersDone();
187 
188 private:
189  FilterManager();
190 
191  class Private;
192  Private *const d;
193 };
194 
195 }
196 
197 #endif
MailCommon::FilterManager
A wrapper class that allows easy access to the mail filters.
Definition: filtermanager.h:47
mailfilter.h
QObject
MailCommon::SearchRule::RequiredPart
RequiredPart
Definition: searchpattern.h:104
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:55
MailCommon::MailFilter
Definition: mailfilter.h:42
QList
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:14 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

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