Qt bindings for oFono cellular services 1.30
ofonomessagemanager.h
1/*
2 * This file is part of ofono-qt
3 *
4 * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies).
5 *
6 * Contact: Alexander Kanavin <alex.kanavin@gmail.com>
7 *
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.
11 *
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.
16 *
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
20 * 02110-1301 USA
21 *
22 */
23
24#ifndef OFONOMESSAGEMANAGER_H
25#define OFONOMESSAGEMANAGER_H
26
27#include <QtCore/QObject>
28#include <QDBusError>
29#include <QDBusObjectPath>
30#include "ofonomodeminterface.h"
31#include "libofono-qt_global.h"
32
34 QDBusObjectPath path;
35 QVariantMap properties;
36};
37typedef QList<OfonoMessageManagerStruct> OfonoMessageManagerList;
38
39Q_DECLARE_METATYPE(OfonoMessageManagerStruct)
40Q_DECLARE_METATYPE(OfonoMessageManagerList)
41
42
47class OFONO_QT_EXPORT OfonoMessageManager : public OfonoModemInterface
48{
49 Q_OBJECT
50
51public:
52 OfonoMessageManager(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0);
53 ~OfonoMessageManager();
54
55 Q_INVOKABLE QStringList getMessages() const;
56public Q_SLOTS:
57 /* Properties */
58 void requestServiceCenterAddress();
59 void setServiceCenterAddress(QString address);
60 void requestUseDeliveryReports();
61 void setUseDeliveryReports(bool useDeliveryReports);
62 void requestBearer();
63 void setBearer(QString bearer);
64 void requestAlphabet();
65 void setAlphabet(QString alphabet);
66
67 QDBusObjectPath sendMessage(const QString &to, const QString &message, bool &success);
68
69Q_SIGNALS:
70 void serviceCenterAddressChanged(const QString &address);
71 void useDeliveryReportsChanged(const bool &useDeliveryReports);
72 void bearerChanged(const QString &bearer);
73 void alphabetChanged(const QString &alphabet);
74
75 void serviceCenterAddressComplete(bool success, const QString &address);
76 void useDeliveryReportsComplete(bool success, const bool &useDeliveryReports);
77 void bearerComplete(bool success, const QString &bearer);
78 void alphabetComplete(bool success, const QString &alphabet);
79
80 void setServiceCenterAddressFailed();
81 void setUseDeliveryReportsFailed();
82 void setBearerFailed();
83 void setAlphabetFailed();
84
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);
89 void statusReport(const QString &message, const QVariantMap &info);
90
91private Q_SLOTS:
92 void validityChanged(bool);
93 void pathChanged(const QString& path);
94 void propertyChanged(const QString &property, const QVariant &value);
95 void setPropertyFailed(const QString &property);
96 void requestPropertyComplete(bool success, const QString &property, const QVariant &value);
97 void onMessageAdded(const QDBusObjectPath &message, const QVariantMap &properties);
98 void onMessageRemoved(const QDBusObjectPath &message);
99
100private:
101 QStringList getMessageList();
102 void connectDbusSignals(const QString& path);
103
104private:
105 QStringList m_messagelist;
106};
107
108#endif /* !OFONOMESSAGEMANAGER_H */
OfonoModemInterface(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, const QString &ifname, OfonoGetPropertySetting propertySetting, QObject *parent=0)
Construct a modem interface object.
SelectionSetting
How the modem object should select a modem.
Definition ofonomodem.h:68
Definition ofonomessagemanager.h:33