2 * This file is part of ofono-qt
4 * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies).
6 * Contact: Alexander Kanavin <alexander.kanavin@nokia.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * version 2.1 as published by the Free Software Foundation.
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 #ifndef OFONOMESSAGEMANAGER_H
25 #define OFONOMESSAGEMANAGER_H
27 #include <QtCore/QObject>
29 #include <QDBusObjectPath>
30 #include "ofonomodeminterface.h"
31 #include "libofono-qt_global.h"
33 struct OfonoMessageManagerStruct {
35 QVariantMap properties;
37 typedef QList<OfonoMessageManagerStruct> OfonoMessageManagerList;
39 Q_DECLARE_METATYPE(OfonoMessageManagerStruct)
40 Q_DECLARE_METATYPE(OfonoMessageManagerList)
42 //! This class is used to access oFono message manager API
44 * oFono message manager API is documented in
45 * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/messagemanager-api.txt
47 class OFONO_QT_EXPORT OfonoMessageManager : public OfonoModemInterface
52 OfonoMessageManager(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0);
53 ~OfonoMessageManager();
56 void requestServiceCenterAddress();
57 void setServiceCenterAddress(QString address);
58 void requestUseDeliveryReports();
59 void setUseDeliveryReports(bool useDeliveryReports);
61 void setBearer(QString bearer);
62 void requestAlphabet();
63 void setAlphabet(QString alphabet);
65 QStringList getMessages() const;
66 void sendMessage(const QString &to, const QString &message);
69 void serviceCenterAddressChanged(const QString &address);
70 void useDeliveryReportsChanged(const bool &useDeliveryReports);
71 void bearerChanged(const QString &bearer);
72 void alphabetChanged(const QString &alphabet);
74 void serviceCenterAddressComplete(bool success, const QString &address);
75 void useDeliveryReportsComplete(bool success, const bool &useDeliveryReports);
76 void bearerComplete(bool success, const QString &bearer);
77 void alphabetComplete(bool success, const QString &alphabet);
78 void sendMessageComplete(bool success, const QDBusObjectPath& objectPath);
80 void setServiceCenterAddressFailed();
81 void setUseDeliveryReportsFailed();
82 void setBearerFailed();
83 void setAlphabetFailed();
85 void messageAdded(const QString &message);
86 void messageRemoved(const QString &message);
87 void immediateMessage(const QString &message, const QVariantMap &info);
88 void incomingMessage(const QString &message, const QVariantMap &info);
91 void propertyChanged(const QString &property, const QVariant &value);
92 void setPropertyFailed(const QString &property);
93 void requestPropertyComplete(bool success, const QString &property, const QVariant &value);
94 void onMessageAdded(const QDBusObjectPath &message, const QVariantMap &properties);
95 void onMessageRemoved(const QDBusObjectPath &message);
96 void sendMessageResp(const QDBusObjectPath& objectPath);
97 void sendMessageErr(QDBusError error);
100 QStringList m_messagelist;
103 #endif /* !OFONOMESSAGEMANAGER_H */