Debian Codegraph @

online-accounts-daemon/lib/LomiriOnlineAccountsDaemon/account_info.h

raw symbols SCIP
1 /*
2 * This file is part of OnlineAccountsDaemon
3 *
4 * Copyright (C) 2015 Canonical Ltd.
5 *
6 * Contact: Alberto Mardegan <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License version 3, as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranties of
14 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef ONLINE_ACCOUNTS_DAEMON_ACCOUNT_INFO_H
22 #define ONLINE_ACCOUNTS_DAEMON_ACCOUNT_INFO_H
23
24 #include <QVariantMap>
25 #include "dbus_constants.h"
26
27 class QDBusArgument;
28
29 namespace OnlineAccountsDaemon {
30
31 struct AccountInfo {
32 uint accountId;
33 QVariantMap details;
34
35 AccountInfo(): accountId(0) {}
36 AccountInfo(uint accountId, const QVariantMap &details):
37 accountId(accountId), details(details) {}
38 QString serviceId() const {
39 return details[ONLINE_ACCOUNTS_INFO_KEY_SERVICE_ID].toString();
40 }
41 };
42
43 } // namespace
44
45 QDBusArgument &operator<<(QDBusArgument &argument,
46 const OnlineAccountsDaemon::AccountInfo &info);
47 const QDBusArgument &operator>>(const QDBusArgument &argument,
48 OnlineAccountsDaemon::AccountInfo &info);
49
50 Q_DECLARE_METATYPE(OnlineAccountsDaemon::AccountInfo)
51
52 #endif // ONLINE_ACCOUNTS_DAEMON_ACCOUNT_INFO_H