| 1 | /* |
| 2 | * This file is part of libOnlineAccounts |
| 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_ACCOUNT_INFO_H |
| 22 | #define ONLINE_ACCOUNTS_ACCOUNT_INFO_Hcxx . . $ `online-accounts/lib/qt/LomiriOnlineAccounts/account_info.h:22:9`! |
| 23 | |
| 24 | #include <QVariantMap> |
| 25 | |
| 26 | #include <LomiriOnlineAccountsDaemon/dbus_constants.h>cxx . . $ `<file>/online-accounts-daemon/lib/LomiriOnlineAccountsDaemon/dbus_constants.h`/ |
| 27 | #include "global.h"cxx . . $ `<file>/online-accounts/lib/qt/LomiriOnlineAccounts/global.h`/ |
| 28 | |
| 29 | class QDBusArgumentcxx . . $ QDBusArgument#; |
| 30 | |
| 31 | namespace OnlineAccountscxx . . $ OnlineAccounts/ { |
| 32 | |
| 33 | class AccountInfocxx . . $ OnlineAccounts/AccountInfo# { |
| 34 | public: |
| 35 | enum ChangeTypecxx . . $ OnlineAccounts/AccountInfo#ChangeType# { |
| 36 | Enabledcxx . . $ OnlineAccounts/AccountInfo#Enabled., |
| 37 | Disabledcxx . . $ OnlineAccounts/AccountInfo#Disabled., |
| 38 | Updatedcxx . . $ OnlineAccounts/AccountInfo#Updated., |
| 39 | }; |
| 40 | AccountInfocxx . . $ OnlineAccounts/AccountInfo#AccountInfo(49f6e7a06ebc5aa8).(): accountIdcxx . . $ OnlineAccounts/AccountInfo#accountId.(0) {} |
| 41 | AccountInfocxx . . $ OnlineAccounts/AccountInfo#AccountInfo(a674b9a78b7822c6).(AccountIdcxx . . $ OnlineAccounts/AccountId# accountId, const QVariantMapcxx . . $ QVariantMap# &details): |
| 42 | accountIdcxx . . $ OnlineAccounts/AccountInfo#accountId.(accountId), detailscxx . . $ QMap#QMap(21739d87639e1d56).(details) {} |
| 43 | |
| 44 | AccountIdcxx . . $ OnlineAccounts/AccountId# idcxx . . $ OnlineAccounts/AccountInfo#id(ddd8539a2fcdd4ce).() const { return accountIdcxx . . $ OnlineAccounts/AccountInfo#accountId.; } |
| 45 | QStringcxx . . $ QString# displayNamecxx . . $ OnlineAccounts/AccountInfo#displayName(6ef7b6c27b00b43d).() const { |
| 46 | return detailscxx . . $ OnlineAccounts/AccountInfo#details..valuecxx . . $ QMap#value(866b0a4e5fb46e14).(ONLINE_ACCOUNTS_INFO_KEY_DISPLAY_NAMEcxx . . $ QString#QString(85c52e162fed56f9).).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 47 | } |
| 48 | QStringcxx . . $ QString# servicecxx . . $ OnlineAccounts/AccountInfo#service(6ef7b6c27b00b43d).() const { |
| 49 | return detailscxx . . $ OnlineAccounts/AccountInfo#details..valuecxx . . $ QMap#value(866b0a4e5fb46e14).(ONLINE_ACCOUNTS_INFO_KEY_SERVICE_IDcxx . . $ `online-accounts-daemon/lib/LomiriOnlineAccountsDaemon/dbus_constants.h:32:9`!).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 50 | } |
| 51 | AuthenticationMethodcxx . . $ OnlineAccounts/AuthenticationMethod# authenticationMethodcxx . . $ OnlineAccounts/AccountInfo#authenticationMethod(5844b1512d846331).() const { |
| 52 | return AuthenticationMethodcxx . . $ OnlineAccounts/AuthenticationMethod#(detailscxx . . $ OnlineAccounts/AccountInfo#details..valuecxx . . $ QMap#value(866b0a4e5fb46e14).(ONLINE_ACCOUNTS_INFO_KEY_AUTH_METHODcxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()); |
| 53 | } |
| 54 | ChangeTypecxx . . $ OnlineAccounts/AccountInfo#ChangeType# changeTypecxx . . $ OnlineAccounts/AccountInfo#changeType(e13e2d55a53dc40f).() const { |
| 55 | switch (detailscxx . . $ OnlineAccounts/AccountInfo#details..valuecxx . . $ QMap#value(866b0a4e5fb46e14).(ONLINE_ACCOUNTS_INFO_KEY_CHANGE_TYPEcxx . . $ QString#QString(85c52e162fed56f9).).toUIntcxx . . $ QVariant#toUInt(870b63f89c7fb98).()) { |
| 56 | case ONLINE_ACCOUNTS_INFO_CHANGE_ENABLEDcxx . . $ `online-accounts-daemon/lib/LomiriOnlineAccountsDaemon/dbus_constants.h:41:11`!: return Enabledcxx . . $ OnlineAccounts/AccountInfo#Enabled.; |
| 57 | case ONLINE_ACCOUNTS_INFO_CHANGE_DISABLEDcxx . . $ `online-accounts-daemon/lib/LomiriOnlineAccountsDaemon/dbus_constants.h:42:11`!: return Disabledcxx . . $ OnlineAccounts/AccountInfo#Disabled.; |
| 58 | default: return Updatedcxx . . $ OnlineAccounts/AccountInfo#Updated.; |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | QStringListcxx . . $ QStringList# keyscxx . . $ OnlineAccounts/AccountInfo#keys(e1dbd5c4feadc8f5).() const { |
| 63 | QStringListcxx . . $ QStringList# settingKeyscxx . . $ QStringList#QStringList(ced63f7c635d850d).; |
| 64 | Q_FOREACHcxx . . $ QtPrivate/qMakeForeachContainer(fe1094b4e720f216).(const QString &key, details.keys()) { |
| 65 | if (key.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).(ONLINE_ACCOUNTS_INFO_KEY_SETTINGScxx . . $ QString#QString(85c52e162fed56f9).)) { |
| 66 | settingKeys.appendcxx . . $ QList#append(77d9f17553126ecb).(key.midcxx . . $ QString#mid(44b7563da18aea72).(sizeof(ONLINE_ACCOUNTS_INFO_KEY_SETTINGScxx . . $ `online-accounts-daemon/lib/LomiriOnlineAccountsDaemon/dbus_constants.h:39:9`!) - 1)); |
| 67 | } |
| 68 | } |
| 69 | return settingKeys; |
| 70 | } |
| 71 | QVariantcxx . . $ QVariant# settingcxx . . $ OnlineAccounts/AccountInfo#setting(f6a024953685a9e0).(const QStringcxx . . $ QString# &key) const { |
| 72 | return detailscxx . . $ OnlineAccounts/AccountInfo#details..valuecxx . . $ QMap#value(866b0a4e5fb46e14).(ONLINE_ACCOUNTS_INFO_KEY_SETTINGScxx . . $ `online-accounts-daemon/lib/LomiriOnlineAccountsDaemon/dbus_constants.h:39:9`! +cxx . . $ operator+(c75c3ae4eb9af1a8). key); |
| 73 | } |
| 74 | |
| 75 | AccountInfocxx . . $ OnlineAccounts/AccountInfo# stripMetadatacxx . . $ OnlineAccounts/AccountInfo#stripMetadata(5bd39d543bdb4e4b).() const { |
| 76 | AccountInfocxx . . $ OnlineAccounts/AccountInfo# stripped = *this; |
| 77 | stripped.detailscxx . . $ OnlineAccounts/AccountInfo#details..removecxx . . $ QMap#remove(dd8e59d271e40448).(ONLINE_ACCOUNTS_INFO_KEY_CHANGE_TYPEcxx . . $ QString#QString(85c52e162fed56f9).); |
| 78 | return stripped; |
| 79 | } |
| 80 | |
| 81 | bool operatorcxx . . $ OnlineAccounts/AccountInfo#`operator==`(e7eb4e2a59f43bc).==(const AccountInfocxx . . $ OnlineAccounts/AccountInfo# &other) const { |
| 82 | return accountIdcxx . . $ OnlineAccounts/AccountInfo#accountId. == other.accountIdcxx . . $ OnlineAccounts/AccountInfo#accountId. && detailscxx . . $ OnlineAccounts/AccountInfo#details. ==cxx . . $ QMap#`operator==`(273b8a10d4ccd454). other.detailscxx . . $ OnlineAccounts/AccountInfo#details.; |
| 83 | } |
| 84 | |
| 85 | bool operatorcxx . . $ OnlineAccounts/AccountInfo#`operator!=`(e7eb4e2a59f43bc).!=(const AccountInfocxx . . $ OnlineAccounts/AccountInfo# &other) const { |
| 86 | return !(*this ==cxx . . $ OnlineAccounts/AccountInfo#`operator==`(e7eb4e2a59f43bc). other); |
| 87 | } |
| 88 | |
| 89 | private: |
| 90 | friend QDBusArgumentcxx . . $ QDBusArgument# &operatorcxx . . $ OnlineAccounts/`operator<<`(ab6bd8ced86d59c).<<(QDBusArgumentcxx . . $ QDBusArgument# &, const AccountInfocxx . . $ OnlineAccounts/AccountInfo# &); |
| 91 | friend const QDBusArgumentcxx . . $ QDBusArgument# &operatorcxx . . $ OnlineAccounts/`operator>>`(5a5c59bfdbfa761b).>>(const QDBusArgumentcxx . . $ QDBusArgument# &, AccountInfocxx . . $ OnlineAccounts/AccountInfo# &); |
| 92 | AccountIdcxx . . $ OnlineAccounts/AccountId# accountIdcxx . . $ OnlineAccounts/AccountInfo#accountId.; |
| 93 | QVariantMapcxx . . $ QVariantMap# detailscxx . . $ OnlineAccounts/AccountInfo#details.; |
| 94 | }; |
| 95 | |
| 96 | QDBusArgumentcxx . . $ QDBusArgument# &operatorcxx . . $ OnlineAccounts/`operator<<`(ab6bd8ced86d59c).<<(QDBusArgumentcxx . . $ QDBusArgument# &argument, const AccountInfocxx . . $ OnlineAccounts/AccountInfo# &info); |
| 97 | const QDBusArgumentcxx . . $ QDBusArgument# &operatorcxx . . $ OnlineAccounts/`operator>>`(5a5c59bfdbfa761b).>>(const QDBusArgumentcxx . . $ QDBusArgument# &argument, AccountInfocxx . . $ OnlineAccounts/AccountInfo# &info); |
| 98 | |
| 99 | } //namespace |
| 100 | |
| 101 | Q_DECLARE_METATYPEcxx . . $ OnlineAccounts/(OnlineAccounts::AccountInfo) |
| 102 | |
| 103 | #endif // ONLINE_ACCOUNTS_ACCOUNT_INFO_H |