Backport r950340 | aacid | 2009-04-06 23:21:18 +0200 (Mon, 06 Apr 2009) | 4 lines
[kdepim.git] / kmail / groupware_types.h
blob21f6a9c43d2e622f83a4f76cf253afc468e1dec9
1 /* -*- mode: C++; c-file-style: "gnu" -*-
3 * This file is part of KMail, the KDE mail client.
4 * Copyright (c) 2007 Montel Laurent <montel@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 KMAIL_GROUPWARETYPES_H
32 #define KMAIL_GROUPWARETYPES_H
34 #include <QMetaType>
36 #define KMAIL_DBUS_SERVICE "org.kde.kmail"
37 #define KMAIL_DBUS_GROUPWARE_PATH "/Groupware"
38 #define KMAIL_DBUS_GROUPWARE_INTERFACE "org.kde.kmail.groupware"
40 namespace KMail {
42 struct SubResource {
43 SubResource() {
44 writable=false;
45 alarmRelevant=false;
47 SubResource( const QString& loc, const QString& lab, bool rw, bool ar )
48 : location( loc ), label( lab ), writable( rw ), alarmRelevant( ar ) {}
49 QString location; // unique
50 QString label; // shown to the user
51 bool writable;
52 bool alarmRelevant;
54 typedef QList<SubResource> List;
57 /// The format of the mails containing other contents than actual mail
58 /// (like contacts, calendar etc.)
59 /// This is currently either ical/vcard, or XML.
60 /// For actual mail folders this simply to know which resource handles it
61 /// This enum matches the one defined in kmail.kcfg
62 enum StorageFormat { StorageIcalVcard, StorageXML };
64 /// This bitfield indicates which changes have been made in a folder, at syncing time.
65 enum FolderChanges { NoChange = 0, ContentsChanged = 1, ACLChanged = 2 };
67 /** Custom header structure, consisting of the header name and value. */
68 struct CustomHeader
70 CustomHeader() {}
71 CustomHeader( const QByteArray &n, const QString &v ) :
72 name( n ), value( v ) {}
74 QByteArray name;
75 QString value;
77 typedef QList<CustomHeader> List;
80 /** Sernum/data pairs, used to transfer the actual incidence content. */
81 struct SernumDataPair
83 SernumDataPair() {}
84 SernumDataPair( quint32 n, const QString &d ) :
85 sernum( n ), data( d ) {}
86 quint32 sernum;
87 QString data;
89 typedef QList<SernumDataPair> List;
92 /**
93 Register D-Bus types.
95 void registerGroupwareTypes();
98 typedef QMap<quint32, QString> Quint32QStringMap;
100 Q_DECLARE_METATYPE( KMail::SubResource )
101 Q_DECLARE_METATYPE( KMail::SubResource::List )
102 Q_DECLARE_METATYPE( Quint32QStringMap )
103 Q_DECLARE_METATYPE( KMail::CustomHeader )
104 Q_DECLARE_METATYPE( KMail::CustomHeader::List )
105 Q_DECLARE_METATYPE( KMail::SernumDataPair )
106 Q_DECLARE_METATYPE( KMail::SernumDataPair::List )
108 #endif