2
Copyright 2013 Anant Kamath <kamathanant@gmail.com>
3
Copyright 2013 Lukas Tinkl <ltinkl@redhat.com>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Lesser General Public
7
License as published by the Free Software Foundation; either
8
version 2.1 of the License, or (at your option) version 3, or any
9
later version accepted by the membership of KDE e.V. (or its
10
successor approved by the membership of KDE e.V.), which shall
11
act as a proxy defined in Section 6 of version 3 of the license.
13
This library is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
Lesser General Public License for more details.
18
You should have received a copy of the GNU Lesser General Public
19
License along with this library. If not, see <http://www.gnu.org/licenses/>.
22
#ifndef MODEMMANAGER_SMS_H
23
#define MODEMMANAGER_SMS_H
25
#include "ModemManagerQt-export.h"
28
#include <QSharedPointer>
29
#include <QDBusPendingReply>
31
#include "generic-types.h"
35
namespace ModemManager
38
* Provides an interface to manipulate and control an SMS
40
* Note: MMSmsStorage, MMSmsState, MMSmsPduType and MMSmsDeliveryState enums are defined in <ModemManager/ModemManager-enums.h>
41
* See http://www.freedesktop.org/software/ModemManager/api/0.8.0/ModemManager-Flags-and-Enumerations.html
43
class MODEMMANAGERQT_EXPORT Sms : public QObject
46
Q_DECLARE_PRIVATE(Sms)
49
typedef QSharedPointer<Sms> Ptr;
50
typedef QList<Ptr> List;
52
Sms(const QString &path, QObject *parent);
58
QDBusPendingReply<> send();
63
* @param storage the storage location of the SMS
65
QDBusPendingReply<> store(MMSmsStorage storage);
68
* This method returns the state of the SMS
70
MMSmsState state() const;
73
* This method returns the Protocol Data Unit (PDU) type of the SMS
75
MMSmsPduType pduType() const;
78
* This method returns the phone number to which the SMS is addressed to
80
QString number() const;
83
* This method returns the text of the SMS. text() and data() are not valid at the same time
88
* This method returns the SMS service center number
93
* This method returns the SMS message data. text() and data() are not valid at the same time
95
QByteArray data() const;
98
* This method returns the validity of the SMS
100
* @return A ValidityPair struct composed of a MMSmsValidityType type and a value indicating the validity of the SMS
102
ValidityPair validity() const;
105
* This method returns the 3GPP class of the SMS
107
int smsClass() const;
110
* @return @c true if a delivery report is requested, @c false otherwise
112
bool deliveryReportRequest() const;
115
* This method returns the message reference of the last PDU sent/received in the SMS.
116
* The message reference is the number used to identify the SMS in the SMSC.
117
* If the PDU type is MM_SMS_PDU_TYPE_STATUS_REPORT, this field identifies the Message Reference of the PDU associated to the status report
119
uint messageReference() const;
122
* Time when the SMS arrived at the SMSC
124
QDateTime timestamp() const;
127
* Time when the SMS left the SMSC
129
QDateTime dischargeTimestamp() const;
132
* This method returns the delivery state of the SMS
134
MMSmsDeliveryState deliveryState() const;
137
* This method returns the storage area/location of the SMS
139
MMSmsStorage storage() const;
143
* This signal is emitted when the state of the SMS has changed
145
* @param newState the new state of the SMS
147
void stateChanged(MMSmsState newState);
150
* This signal is emitted when the delivery state of the SMS has changed
152
* @param newDeliveryState the new delivery state of the SMS
154
void deliveryStateChanged(MMSmsDeliveryState newDeliveryState);
157
void onPropertiesChanged(const QString &interface, const QVariantMap &changedProperties, const QStringList &invalidatedProps);
163
} // namespace ModemManager