remove dep for doxygen
[profile/ivi/ofono-qt.git] / lib / 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
33 struct OfonoMessageManagerStruct {
34     QDBusObjectPath path;
35     QVariantMap properties;
36 };
37 typedef QList<OfonoMessageManagerStruct> OfonoMessageManagerList;
38
39 Q_DECLARE_METATYPE(OfonoMessageManagerStruct)
40 Q_DECLARE_METATYPE(OfonoMessageManagerList)
41
42 //! This class is used to access oFono message manager API
43 /*!
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
46  */
47 class OFONO_QT_EXPORT OfonoMessageManager : public OfonoModemInterface
48 {
49     Q_OBJECT
50
51 public:
52     OfonoMessageManager(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0);
53     ~OfonoMessageManager();
54
55     Q_INVOKABLE QStringList getMessages() const;
56 public 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     void sendMessage(const QString &to, const QString &message);
68
69 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     void sendMessageComplete(bool success, const QString& path);
80
81     void setServiceCenterAddressFailed();
82     void setUseDeliveryReportsFailed();
83     void setBearerFailed();
84     void setAlphabetFailed();
85
86     void messageAdded(const QString &message);
87     void messageRemoved(const QString &message);
88     void immediateMessage(const QString &message, const QVariantMap &info);
89     void incomingMessage(const QString &message, const QVariantMap &info);
90
91 private 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     void sendMessageResp(const QDBusObjectPath& objectPath);
100     void sendMessageErr(QDBusError error);
101
102 private:
103     QStringList getMessageList();
104     void connectDbusSignals(const QString& path);
105
106 private:
107     QStringList m_messagelist;
108 };
109
110 #endif  /* !OFONOMESSAGEMANAGER_H */