Update VoiceCallManager to match latest oFono
[profile/ivi/ofono-qt.git] / lib / ofonovoicecallmanager.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  * Portions of this file are Copyright (C) 2011 Intel Corporation
9  * Contact: Shane Bryan <shane.bryan@linux.intel.com>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public License
13  * version 2.1 as published by the Free Software Foundation.
14  *
15  * This library is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23  * 02110-1301 USA
24  *
25  */
26
27 #ifndef OFONOVOICECALLMANAGER_H
28 #define OFONOVOICECALLMANAGER_H
29
30 #include <QtCore/QObject>
31 #include <QStringList>
32 #include <QDBusError>
33 #include <QDBusObjectPath>
34
35 #include "ofonomodeminterface.h"
36 #include "libofono-qt_global.h"
37
38 struct OfonoVoiceCallManagerStruct {
39     QDBusObjectPath path;
40     QVariantMap properties;
41 };
42 typedef QList<OfonoVoiceCallManagerStruct> OfonoVoiceCallManagerList;
43
44 Q_DECLARE_METATYPE(OfonoVoiceCallManagerStruct)
45 Q_DECLARE_METATYPE(OfonoVoiceCallManagerList)
46
47 //! This class is used to access oFono voice call manager API
48 /*!
49  * The API is documented in
50  * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/voicecallmanager-api.txt
51  */
52 class OFONO_QT_EXPORT OfonoVoiceCallManager : public OfonoModemInterface
53 {
54     Q_OBJECT
55
56     Q_PROPERTY(QStringList emergencyNumbers READ emergencyNumbers NOTIFY emergencyNumbersChanged)
57
58 public:
59     OfonoVoiceCallManager(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0);
60     ~OfonoVoiceCallManager();
61
62     /* Properties */
63     QStringList emergencyNumbers() const;
64
65     Q_INVOKABLE QStringList getCalls() const;
66
67 public slots:
68     void dial(const QString &number, const QString &callerid_hide);
69     void hangupAll();
70     void sendTones(const QString &tonestring);
71     void transfer();
72     void swapCalls();
73     void releaseAndAnswer();
74     void holdAndAnswer();
75     void privateChat(const QString &path);
76     void createMultiparty();
77     void hangupMultiparty();
78
79 signals:
80     void emergencyNumbersChanged(const QStringList &numbers);
81     void callAdded(const QString &call);
82     void callRemoved(const QString &call);
83     void dialComplete(const bool status);
84     void hangupAllComplete(const bool status);
85     void sendTonesComplete(const bool status);
86     void transferComplete(const bool status);
87     void swapCallsComplete(const bool status);
88     void releaseAndAnswerComplete(const bool status);
89     void holdAndAnswerComplete(const bool status);
90     void privateChatComplete(const bool status, const QStringList& calls);
91     void createMultipartyComplete(const bool status, const QStringList& calls);
92     void hangupMultipartyComplete(const bool status);
93
94     void barringActive(const QString &type);
95     void forwarded(const QString &type);
96
97 private slots:
98     void validityChanged(bool);
99     void pathChanged(const QString& path);
100     void propertyChanged(const QString &property, const QVariant &value);
101     void callAddedChanged(const QDBusObjectPath &call, const QVariantMap &properties);
102     void callRemovedChanged(const QDBusObjectPath &call);
103     void dialResp();
104     void dialErr(const QDBusError &error);
105     void hangupAllResp();
106     void hangupAllErr(const QDBusError &error);
107     void sendTonesResp();
108     void sendTonesErr(const QDBusError &error);
109     void transferResp();
110     void transferErr(const QDBusError &error);
111     void swapCallsResp();
112     void swapCallsErr(const QDBusError &error);
113     void releaseAndAnswerResp();
114     void releaseAndAnswerErr(const QDBusError &error);
115     void holdAndAnswerResp();
116     void holdAndAnswerErr(const QDBusError &error);
117     void privateChatResp(const QList<QDBusObjectPath> &paths);
118     void privateChatErr(const QDBusError &error);
119     void createMultipartyResp(const QList<QDBusObjectPath> &paths);
120     void createMultipartyErr(const QDBusError &error);
121     void hangupMultipartyResp();
122     void hangupMultipartyErr(const QDBusError &error);
123
124 private:
125     QStringList getCallList();
126     void connectDbusSignals(const QString& path);
127 private:
128     QStringList m_calllist;
129 };
130
131 #endif  /* !OFONOVOICECALLMANAGER_H */