Mercurial > bellaciao
comparison dbus_types.cpp @ 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 #include "dbus_types.h" | |
20 | |
21 QDBusArgument &operator<<(QDBusArgument &argument, const ContactT &contact) | |
22 { | |
23 argument.beginStructure(); | |
24 argument << contact.jid << contact.attributes << contact.groups; | |
25 argument.endStructure(); | |
26 return argument; | |
27 } | |
28 const QDBusArgument &operator>>(const QDBusArgument &argument, ContactT &contact) | |
29 { | |
30 argument.beginStructure(); | |
31 argument >> contact.jid >> contact.attributes >> contact.groups; | |
32 argument.endStructure(); | |
33 return argument; | |
34 } | |
35 | |
36 QDBusArgument &operator<<(QDBusArgument &argument, const MessageT &message) | |
37 { | |
38 argument.beginStructure(); | |
39 argument << message.from_jid << message.text; | |
40 argument.endStructure(); | |
41 return argument; | |
42 } | |
43 | |
44 const QDBusArgument &operator>>(const QDBusArgument &argument, MessageT &message) | |
45 { | |
46 argument.beginStructure(); | |
47 argument >> message.from_jid >> message.text; | |
48 argument.endStructure(); | |
49 return argument; | |
50 } | |
51 | |
52 QDBusArgument &operator<<(QDBusArgument &argument, const MenuT &menu) | |
53 { | |
54 argument.beginStructure(); | |
55 argument << menu.category << menu.name << menu.type; | |
56 argument.endStructure(); | |
57 return argument; | |
58 } | |
59 | |
60 const QDBusArgument &operator>>(const QDBusArgument &argument, MenuT &menu) | |
61 { | |
62 argument.beginStructure(); | |
63 argument >> menu.category >> menu.name >> menu.type; | |
64 argument.endStructure(); | |
65 return argument; | |
66 } | |
67 | |
68 QDBusArgument &operator<<(QDBusArgument &argument, const PresenceInfoT &presence_info) | |
69 { | |
70 argument.beginStructure(); | |
71 argument << presence_info.show << presence_info.priority << presence_info.statuses; | |
72 argument.endStructure(); | |
73 return argument; | |
74 } | |
75 | |
76 const QDBusArgument &operator>>(const QDBusArgument &argument, PresenceInfoT &presence_info) | |
77 { | |
78 argument.beginStructure(); | |
79 argument >> presence_info.show >> presence_info.priority >> presence_info.statuses; | |
80 argument.endStructure(); | |
81 return argument; | |
82 } | |
83 |