Build with clang.
[kdepim.git] / mailcommon / messageproperty.h
blobd08474f832659e506387f8d1fa59ab69ed92cf3e
1 /* Message Property
3 This file is part of KMail, the KDE mail client.
4 Copyright (c) Don Sanders <sanders@kde.org>
6 KMail is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License, version 2, as
8 published by the Free Software Foundation.
10 KMail is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 In addition, as a special exception, the copyright holders give
20 permission to link the code of this program with any edition of
21 the Qt library by Trolltech AS, Norway (or with modified versions
22 of Qt that use the same license as Qt), and distribute linked
23 combinations including the two. You must obey the GNU General
24 Public License in all respects for all of the code used other than
25 Qt. If you modify this file, you may extend this exception to
26 your version of the file, but you are not obligated to do so. If
27 you do not wish to do so, delete this exception statement from
28 your version.
31 #ifndef MAILCOMMON_MESSAGEPROPERTY_H
32 #define MAILCOMMON_MESSAGEPROPERTY_H
34 #include "filteraction.h" // for KMFilterAction::ReturnCode
36 #include <akonadi/collection.h>
37 #include <akonadi/item.h>
39 #include <QObject>
41 namespace KMime {
42 class Content;
45 namespace MailCommon {
47 /* A place to store properties that some but not necessarily all messages
48 have.
50 These properties do not need to be stored persistantly on disk but
51 rather only are required while KMail is running.
53 Furthermore some properties, namely complete and
54 serialCache should only exist during the lifetime of a particular
55 KMMsgBase based instance.
57 class MessageProperty : public QObject
59 Q_OBJECT
61 public:
62 /** If the message is being filtered */
63 static bool filtering( const Akonadi::Item &item );
64 static void setFiltering( const Akonadi::Item &item, bool filtering );
65 /** The folder this message is to be moved into once
66 filtering is finished, or null if the message is not
67 scheduled to be moved */
68 static Akonadi::Collection filterFolder( const Akonadi::Item &item );
69 static void setFilterFolder( const Akonadi::Item &item, const Akonadi::Collection &folder );
71 /** Some properties, namely complete and
72 serialCache must be forgotten when a message class instance is
73 destructed or assigned a new value */
74 static void forget( KMime::Content* );
76 private:
78 // The folder a message is to be moved into once filtering is finished if any
79 static QMap<Akonadi::Item::Id, Akonadi::Collection> sFolders;
84 #endif