9#include <QDBusConnection>
10#include <QDBusMessage>
14 , m_enabledNotifications(false)
16 , m_deliveryReportRequest(false)
18 , m_messageReference(0)
20 , m_serviceCategory(0)
24 , m_validity({MM_SMS_VALIDITY_TYPE_RELATIVE, MM_SMS_VALIDITY_TYPE_ENHANCED})
32int Sms::smsClass()
const
42bool Sms::deliveryReportRequest()
const
44 return m_deliveryReportRequest;
47uint Sms::deliveryState()
const
49 return m_deliveryState;
52QString Sms::dischargeTimestamp()
const
54 return m_dischargeTimestamp;
57uint Sms::messageReference()
const
59 return m_messageReference;
67uint Sms::pduType()
const
77uint Sms::serviceCategory()
const
79 return m_serviceCategory;
82uint Sms::state()
const
87uint Sms::storage()
const
92uint Sms::teleserviceId()
const
94 return m_teleserviceId;
107ModemManager::ValidityPair Sms::validity()
const
116void Sms::Store(uint storage)
126void Sms::setSmsPath(
const QString &path)
131void Sms::setEnableNotifications(
bool enable)
133 m_enabledNotifications = enable;
136void Sms::setSmsClass(
int smsClass)
138 m_smsClass = smsClass;
140 if (m_enabledNotifications) {
142 map.insert(QLatin1String(
"Class"), m_smsClass);
143 QDBusMessage message =
QDBusMessage::createSignal(m_smsPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
144 message << QLatin1String(
"org.kde.fakemodem.Sms") <<
map << QStringList();
153 if (m_enabledNotifications) {
155 map.insert(QLatin1String(
"Data"), m_data);
156 QDBusMessage message =
QDBusMessage::createSignal(m_smsPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
157 message << QLatin1String(
"org.kde.fakemodem.Sms") <<
map << QStringList();
162void Sms::setDeliveryReportRequest(
bool deliveryReportRequest)
164 m_deliveryReportRequest = deliveryReportRequest;
166 if (m_enabledNotifications) {
168 map.insert(QLatin1String(
"DeliveryReportRequest"), m_deliveryReportRequest);
169 QDBusMessage message =
QDBusMessage::createSignal(m_smsPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
170 message << QLatin1String(
"org.kde.fakemodem.Sms") <<
map << QStringList();
175void Sms::setDeliveryState(uint state)
177 m_deliveryState = state;
179 if (m_enabledNotifications) {
181 map.insert(QLatin1String(
"DeliveryState"), m_deliveryState);
182 QDBusMessage message =
QDBusMessage::createSignal(m_smsPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
183 message << QLatin1String(
"org.kde.fakemodem.Sms") <<
map << QStringList();
188void Sms::setDischargeTimestamp(
const QString ×tamp)
190 m_dischargeTimestamp = timestamp;
192 if (m_enabledNotifications) {
194 map.insert(QLatin1String(
"DischargeTimestamp"), m_dischargeTimestamp);
195 QDBusMessage message =
QDBusMessage::createSignal(m_smsPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
196 message << QLatin1String(
"org.kde.fakemodem.Sms") <<
map << QStringList();
201void Sms::setMessageReference(uint messageReference)
203 m_messageReference = messageReference;
205 if (m_enabledNotifications) {
207 map.insert(QLatin1String(
"MessageReference"), m_messageReference);
208 QDBusMessage message =
QDBusMessage::createSignal(m_smsPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
209 message << QLatin1String(
"org.kde.fakemodem.Sms") <<
map << QStringList();
214void Sms::setNumber(
const QString &number)
218 if (m_enabledNotifications) {
220 map.insert(QLatin1String(
"Number"), m_number);
221 QDBusMessage message =
QDBusMessage::createSignal(m_smsPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
222 message << QLatin1String(
"org.kde.fakemodem.Sms") <<
map << QStringList();
226void Sms::setPduType(uint pduType)
230 if (m_enabledNotifications) {
232 map.insert(QLatin1String(
"PduType"), m_pduType);
233 QDBusMessage message =
QDBusMessage::createSignal(m_smsPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
234 message << QLatin1String(
"org.kde.fakemodem.Sms") <<
map << QStringList();
239void Sms::setSMSC(
const QString &smsc)
243 if (m_enabledNotifications) {
245 map.insert(QLatin1String(
"SMSC"), m_SMSC);
246 QDBusMessage message =
QDBusMessage::createSignal(m_smsPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
247 message << QLatin1String(
"org.kde.fakemodem.Sms") <<
map << QStringList();
252void Sms::setServiceCategory(uint serviceCategory)
254 m_serviceCategory = serviceCategory;
256 if (m_enabledNotifications) {
258 map.insert(QLatin1String(
"ServiceCategory"), m_serviceCategory);
259 QDBusMessage message =
QDBusMessage::createSignal(m_smsPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
260 message << QLatin1String(
"org.kde.fakemodem.Sms") <<
map << QStringList();
265void Sms::setState(uint state)
269 if (m_enabledNotifications) {
271 map.insert(QLatin1String(
"State"), m_state);
272 QDBusMessage message =
QDBusMessage::createSignal(m_smsPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
273 message << QLatin1String(
"org.kde.fakemodem.Sms") <<
map << QStringList();
278void Sms::setStorage(uint storage)
282 if (m_enabledNotifications) {
284 map.insert(QLatin1String(
"Storage"), m_storage);
285 QDBusMessage message =
QDBusMessage::createSignal(m_smsPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
286 message << QLatin1String(
"org.kde.fakemodem.Sms") <<
map << QStringList();
291void Sms::setTeleserviceId(uint teleserviceId)
293 m_teleserviceId = teleserviceId;
295 if (m_enabledNotifications) {
297 map.insert(QLatin1String(
"TeleserviceId"), m_teleserviceId);
298 QDBusMessage message =
QDBusMessage::createSignal(m_smsPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
299 message << QLatin1String(
"org.kde.fakemodem.Sms") <<
map << QStringList();
304void Sms::setText(
const QString &text)
308 if (m_enabledNotifications) {
310 map.insert(QLatin1String(
"Text"), m_text);
311 QDBusMessage message =
QDBusMessage::createSignal(m_smsPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
312 message << QLatin1String(
"org.kde.fakemodem.Sms") <<
map << QStringList();
317void Sms::setTimestamp(
const QString ×tamp)
319 m_timestamp = timestamp;
321 if (m_enabledNotifications) {
323 map.insert(QLatin1String(
"Timestamp"), m_timestamp);
324 QDBusMessage message =
QDBusMessage::createSignal(m_smsPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
325 message << QLatin1String(
"org.kde.fakemodem.Sms") <<
map << QStringList();
330void Sms::setValidity(
const ModemManager::ValidityPair &validity)
332 m_validity.validity = validity.validity;
333 m_validity.value = validity.value;
335 if (m_enabledNotifications) {
338 QDBusMessage message =
QDBusMessage::createSignal(m_smsPath, QLatin1String(
"org.freedesktop.DBus.Properties"), QLatin1String(
"PropertiesChanged"));
339 message << QLatin1String(
"org.kde.fakemodem.Sms") <<
map << QStringList();
344#include "moc_sms.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)
QVariant fromValue(T &&value)