comparison dbus_types.h @ 0:22b44846b04b

Initial commit
author Goffi <goffi@goffi.org>
date Sat, 06 Aug 2011 15:37:02 +0200
parents
children 220e5619bf87
comparison
equal deleted inserted replaced
-1:000000000000 0:22b44846b04b
1 /*
2 Mignonne: a Salut à Toi frontend
3 Copyright (C) 2011 Jérôme Poisson (goffi@goffi.org)
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Affero General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #ifndef DBUS_TYPES_H
20 #define DBUS_TYPES_H
21
22 #include <QtDBus>
23 #include <QHash>
24 #include <QMap>
25 #include <QString>
26 #include <QList>
27
28 typedef QHash<QString, QString> StringDict;
29
30 struct ContactT {
31 QString jid;
32 StringDict attributes;
33 QList<QString> groups;
34 };
35
36 struct MessageT {
37 QString from_jid;
38 QString text;
39 };
40
41 typedef QMap<int,MessageT> HistoryT;
42
43 struct MenuT {
44 QString category;
45 QString name;
46 QString type;
47 };
48
49 struct PresenceInfoT {
50 QString show;
51 int priority;
52 QHash<QString, QString> statuses;
53 };
54
55 typedef QMap<QString,PresenceInfoT> ResourcePresenceT;
56
57 typedef QHash<QString,ResourcePresenceT> PresenceStatusT;
58
59 typedef QHash<QString, StringDict> ActionResultExtDataT;
60
61 Q_DECLARE_METATYPE(StringDict);
62 Q_DECLARE_METATYPE(ContactT);
63 Q_DECLARE_METATYPE(QList<ContactT>);
64 Q_DECLARE_METATYPE(HistoryT);
65 Q_DECLARE_METATYPE(PresenceStatusT);
66 Q_DECLARE_METATYPE(MenuT);
67 Q_DECLARE_METATYPE(QList<MenuT>);
68 Q_DECLARE_METATYPE(ActionResultExtDataT);
69
70 QDBusArgument &operator<<(QDBusArgument &argument, const ContactT &contact);
71 const QDBusArgument &operator>>(const QDBusArgument &argument, ContactT &contact);
72 QDBusArgument &operator<<(QDBusArgument &argument, const MenuT &menu);
73 const QDBusArgument &operator>>(const QDBusArgument &argument, MenuT &menu);
74 QDBusArgument &operator<<(QDBusArgument &argument, const MessageT &message);
75 const QDBusArgument &operator>>(const QDBusArgument &argument, MessageT &message);
76 QDBusArgument &operator<<(QDBusArgument &argument, const PresenceInfoT &presence_info);
77 const QDBusArgument &operator>>(const QDBusArgument &argument, PresenceInfoT &presence_info);
78
79 #endif
80