9#include <QDBusConnection>
10#include <QDBusMessage>
12Modem3gpp::Modem3gpp(
QObject *parent)
14 , m_enabledNotifications(false)
15 , m_enabledFacilityLocks(0)
16 , m_registrationState(0)
17 , m_subscriptionState(0)
21Modem3gpp::~Modem3gpp()
25uint Modem3gpp::enabledFacilityLocks()
const
27 return m_enabledFacilityLocks;
35QString Modem3gpp::operatorCode()
const
37 return m_operatorCode;
40QString Modem3gpp::operatorName()
const
42 return m_operatorName;
45uint Modem3gpp::registrationState()
const
47 return m_registrationState;
50uint Modem3gpp::subscriptionState()
const
52 return m_subscriptionState;
55void Modem3gpp::Register(
const QString &operator_id)
57 Q_UNUSED(operator_id);
60ModemManager::QVariantMapList Modem3gpp::Scan()
62 return ModemManager::QVariantMapList();
65void Modem3gpp::setModemPath(
const QString &path)
70void Modem3gpp::setEnableNotifications(
bool enable)
72 m_enabledNotifications = enable;
75void Modem3gpp::setEnabledFacilityLocks(uint enabledFacilityLocks)
77 m_enabledFacilityLocks = enabledFacilityLocks;
79 if (m_enabledNotifications) {
81 map.insert(QLatin1String(
"EnabledFacilityLocks"), m_enabledFacilityLocks);
82 QDBusMessage message =
QDBusMessage::createSignal(m_modemPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
83 message << QLatin1String(
"org.kde.fakemodem.Modem.Modem3gpp") <<
map << QStringList();
88void Modem3gpp::setImei(
const QString &imei)
92 if (m_enabledNotifications) {
94 map.insert(QLatin1String(
"Imei"), m_imei);
95 QDBusMessage message =
QDBusMessage::createSignal(m_modemPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
96 message << QLatin1String(
"org.kde.fakemodem.Modem.Modem3gpp") <<
map << QStringList();
101void Modem3gpp::setOperatorCode(
const QString &operatorCode)
103 m_operatorCode = operatorCode;
105 if (m_enabledNotifications) {
107 map.insert(QLatin1String(
"OperatorCode"), m_operatorCode);
108 QDBusMessage message =
QDBusMessage::createSignal(m_modemPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
109 message << QLatin1String(
"org.kde.fakemodem.Modem.Modem3gpp") <<
map << QStringList();
114void Modem3gpp::setOperatorName(
const QString &operatorName)
116 m_operatorName = operatorName;
118 if (m_enabledNotifications) {
120 map.insert(QLatin1String(
"OperatorName"), m_operatorName);
121 QDBusMessage message =
QDBusMessage::createSignal(m_modemPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
122 message << QLatin1String(
"org.kde.fakemodem.Modem.Modem3gpp") <<
map << QStringList();
127void Modem3gpp::setRegistrationState(uint registrationState)
129 m_registrationState = registrationState;
131 if (m_enabledNotifications) {
133 map.insert(QLatin1String(
"RegistrationState"), m_registrationState);
134 QDBusMessage message =
QDBusMessage::createSignal(m_modemPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
135 message << QLatin1String(
"org.kde.fakemodem.Modem.Modem3gpp") <<
map << QStringList();
140void Modem3gpp::setSubscriptionState(uint subscriptionState)
142 m_subscriptionState = subscriptionState;
144 if (m_enabledNotifications) {
146 map.insert(QLatin1String(
"SubscriptionState"), m_subscriptionState);
147 QDBusMessage message =
QDBusMessage::createSignal(m_modemPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
148 message << QLatin1String(
"org.kde.fakemodem.Modem.Modem3gpp") <<
map << QStringList();
153QVariantMap Modem3gpp::toMap()
const
156 map.insert(QLatin1String(MM_MODEM_MODEM3GPP_PROPERTY_IMEI), m_imei);
157 map.insert(QLatin1String(MM_MODEM_MODEM3GPP_PROPERTY_REGISTRATIONSTATE), m_registrationState);
158 map.insert(QLatin1String(MM_MODEM_MODEM3GPP_PROPERTY_OPERATORCODE), m_operatorCode);
159 map.insert(QLatin1String(MM_MODEM_MODEM3GPP_PROPERTY_OPERATORNAME), m_operatorName);
160 map.insert(QLatin1String(MM_MODEM_MODEM3GPP_PROPERTY_ENABLEDFACILITYLOCKS), m_enabledFacilityLocks);
161#if MM_CHECK_VERSION(1, 2, 0)
162 map.insert(QLatin1String(MM_MODEM_MODEM3GPP_PROPERTY_SUBSCRIPTIONSTATE), m_subscriptionState);
167#include "moc_modem3gpp.cpp"
QString path(const QString &relativePath)
bool send(const QDBusMessage &message) const const
QDBusConnection sessionBus()
QDBusMessage createSignal(const QString &path, const QString &interface, const QString &name)
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)