• 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
filteraction.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1996-1998 Stefan Taferner <taferner@kde.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  */
19 
20 #ifndef MAILCOMMON_FILTERACTION_H
21 #define MAILCOMMON_FILTERACTION_H
22 
23 #include "../mailcommon_export.h"
24 #include "../search/searchpattern.h"
25 
26 #include "itemcontext.h"
27 
28 #include <Akonadi/Collection>
29 #include <Akonadi/Item>
30 
31 #include <KMime/MDN>
32 #include <KMime/KMimeMessage>
33 
34 #include <QtCore/QList>
35 #include <QtCore/QObject>
36 
37 class QWidget;
38 
39 namespace MailCommon {
40 
52 class MAILCOMMON_EXPORT FilterAction : public QObject
53 {
54  Q_OBJECT
55 public:
56 
60  enum ReturnCode {
61  ErrorNeedComplete = 0x1,
62  GoOn = 0x2,
63  ErrorButGoOn = 0x4,
64  CriticalError = 0x8
67  };
69 
70 
77  FilterAction( const QString &name, const QString &label, QObject *parent = 0 );
78 
82  virtual ~FilterAction();
83 
88  QString label() const;
89 
94  QString name() const;
95 
96  virtual QStringList sieveRequires() const;
97 
98  virtual QString sieveCode() const;
99 
109  virtual ReturnCode process( ItemContext &context, bool applyOnOutbound ) const = 0;
110 
114  virtual SearchRule::RequiredPart requiredPart() const = 0;
121  virtual bool isEmpty() const;
122 
127  virtual QWidget *createParamWidget( QWidget *parent ) const;
128 
134  virtual void applyParamWidgetValue( QWidget *paramWidget );
135 
140  virtual void setParamWidgetValue( QWidget *paramWidget ) const;
141 
146  virtual void clearParamWidget( QWidget *paramWidget ) const;
147 
151  virtual void argsFromString( const QString &argsStr ) = 0;
152 
157  virtual bool argsFromStringInteractive( const QString &argsStr, const QString &filterName );
158 
159  virtual QString argsAsStringReal() const;
160 
164  virtual QString argsAsString() const = 0;
165 
170  virtual QString displayString() const = 0;
171 
177  virtual bool folderRemoved( const Akonadi::Collection &aFolder,
178  const Akonadi::Collection &aNewFolder );
179 
183  static FilterAction *newAction();
184 
188  static void sendMDN( const Akonadi::Item &item,
189  KMime::MDN::DispositionType d,
190  const QList<KMime::MDN::DispositionModifier> &m =
191  QList<KMime::MDN::DispositionModifier>() );
192 
193 signals:
198  void filterActionModified();
199 
200 private:
201  QString mName;
202  QString mLabel;
203 };
204 
205 }
206 
207 #endif
QWidget
QObject
MailCommon::FilterAction
Abstract base class for mail filter actions.
Definition: filteraction.h:52
itemcontext.h
MailCommon::SearchRule::RequiredPart
RequiredPart
Definition: searchpattern.h:104
MAILCOMMON_EXPORT
#define MAILCOMMON_EXPORT
Definition: mailcommon_export.h:35
MailCommon::FilterAction::ReturnCode
ReturnCode
Describes the possible return codes of filter processing:
Definition: filteraction.h:60
context
const char * context
Definition: searchpatternedit.cpp:54
MailCommon::ItemContext
A helper class for the filtering process.
Definition: itemcontext.h:39
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