1
/* This file is part of the KDE project
2
Copyright 2010 Lamarque Souza <lamarque@gmail.com>
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License as
6
published by the Free Software Foundation; either version 2 of
7
the License or (at your option) version 3 or any later version
8
accepted by the membership of KDE e.V. (or its successor approved
9
by the membership of KDE e.V.), which shall act as a proxy
10
defined in Section 14 of version 3 of the license.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program. If not, see <http://www.gnu.org/licenses/>.
21
#include "generic-types.h"
23
// Marshall the Solid::Control::Ip4ConfigType data into a D-BUS argument
24
QDBusArgument &operator << (QDBusArgument &arg,
25
const Solid::Control::ModemInterface::Ip4ConfigType &config)
28
arg << config.ip4Address << config.dns1 << config.dns2 << config.dns3;
33
// Retrieve the Solid::Control::Ip4ConfigType data from the D-BUS argument
34
const QDBusArgument &operator >> (const QDBusArgument &arg,
35
Solid::Control::ModemInterface::Ip4ConfigType &config)
38
arg >> config.ip4Address >> config.dns1 >> config.dns2 >> config.dns3;
44
// Marshall the Solid::Control::ModemManager::Modem::InfoType data into a D-BUS argument
45
QDBusArgument &operator << (QDBusArgument &arg,
46
const Solid::Control::ModemInterface::InfoType &info)
49
arg << info.manufacturer << info.model << info.version;
54
// Retrieve the Solid::Control::ModemManager::Modem::InfoType data from the D-BUS argument
55
const QDBusArgument &operator >> (const QDBusArgument &arg,
56
Solid::Control::ModemInterface::InfoType &info)
59
arg >> info.manufacturer >> info.model >> info.version;
64
// Marshall the Solid::Control::ModemCdmaInterface::ServingSystemType data into a D-BUS argument
65
QDBusArgument &operator << (QDBusArgument &arg,
66
const Solid::Control::ModemCdmaInterface::ServingSystemType &servingSystem)
69
arg << servingSystem.bandClass << servingSystem.band << servingSystem.systemId;
74
// Retrieve the Solid::Control::ModemCdmaInterface::ServingSystemType data from the D-BUS argument
75
const QDBusArgument &operator >> (const QDBusArgument &arg,
76
Solid::Control::ModemCdmaInterface::ServingSystemType &servingSystem)
80
arg >> temp >> servingSystem.band >> servingSystem.systemId;
81
servingSystem.bandClass = (Solid::Control::ModemCdmaInterface::BandClass) temp;
86
// Marshall the Solid::Control::ModemGsmContactsInterface::ContactType data into a D-BUS argument
87
QDBusArgument &operator << (QDBusArgument &arg,
88
const Solid::Control::ModemGsmContactsInterface::ContactType &contact)
91
arg << contact.index << contact.name << contact.number;
96
// Retrieve the Solid::Control::ModemGsmContactsInterface::ContactType data from the D-BUS argument
97
const QDBusArgument &operator >> (const QDBusArgument &arg,
98
Solid::Control::ModemGsmContactsInterface::ContactType &contact)
100
arg.beginStructure();
101
arg >> contact.index >> contact.name >> contact.number;
106
// Marshall the RegistrationInfoType data into a D-BUS argument
107
QDBusArgument &operator << (QDBusArgument &arg,
108
const Solid::Control::ModemGsmNetworkInterface::RegistrationInfoType &info)
112
temp = (uint) info.status;
113
arg.beginStructure();
114
arg << temp << info.operatorCode << info.operatorName;
119
// Retrieve the RegistrationInfoType data from the D-BUS argument
120
const QDBusArgument &operator >> (const QDBusArgument &arg,
121
Solid::Control::ModemGsmNetworkInterface::RegistrationInfoType &info)
125
arg.beginStructure();
126
arg >> temp >> info.operatorCode >> info.operatorName;
127
info.status = (Solid::Control::ModemGsmNetworkInterface::RegistrationStatus) temp;