a36bee4e20e97a48676ceecfc882848f0996aa59
[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 <alexander.kanavin@nokia.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 OFONOVOICECALLMANAGER_H
25 #define OFONOVOICECALLMANAGER_H
26
27 #include <QtCore/QObject>
28 #include <QStringList>
29 #include <QDBusError>
30 #include <QDBusObjectPath>
31
32 #include "ofonomodeminterface.h"
33 #include "libofono-qt_global.h"
34
35 struct OfonoVoiceCallManagerStruct {
36     QDBusObjectPath path;
37     QVariantMap properties;
38 };
39 typedef QList<OfonoVoiceCallManagerStruct> OfonoVoiceCallManagerList;
40
41 Q_DECLARE_METATYPE(OfonoVoiceCallManagerStruct)
42 Q_DECLARE_METATYPE(OfonoVoiceCallManagerList)
43
44 //! This class is used to access oFono voice call manager API
45 /*!
46  * The API is documented in
47  * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/voicecallmanager-api.txt
48  */
49 class OFONO_QT_EXPORT OfonoVoiceCallManager : public OfonoModemInterface
50 {
51     Q_OBJECT
52
53 public:
54     OfonoVoiceCallManager(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0);
55     ~OfonoVoiceCallManager();
56
57     /* Properties */
58     QStringList emergencyNumbers() const;
59     QStringList getCalls() const;
60     void dial(const QString &number, const QString &callerid_hide);
61     void hangupAll();
62     void sendTones(const QString &tonestring);
63     void transfer();
64     void swapCalls();
65     void releaseAndAnswer();
66     void holdAndAnswer();
67
68 signals:
69     void emergencyNumbersChanged(const QStringList &numbers);
70     void callAdded(const QString &call);
71     void callRemoved(const QString &call);
72     void dialComplete(const bool status);
73     void hangupAllComplete(const bool status);
74     void sendTonesComplete(const bool status);
75     void transferComplete(const bool status);
76     void swapCallsComplete(const bool status);
77     void releaseAndAnswerComplete(const bool status);
78     void holdAndAnswerComplete(const bool status);
79
80 private slots:
81     void propertyChanged(const QString &property, const QVariant &value);
82     void callAddedChanged(const QDBusObjectPath &call, const QVariantMap &properties);
83     void callRemovedChanged(const QDBusObjectPath &call);
84     void dialResp();
85     void dialErr(const QDBusError &error);
86     void hangupAllResp();
87     void hangupAllErr(const QDBusError &error);
88     void sendTonesResp();
89     void sendTonesErr(const QDBusError &error);
90     void transferResp();
91     void transferErr(const QDBusError &error);
92     void swapCallsResp();
93     void swapCallsErr(const QDBusError &error);
94     void releaseAndAnswerResp();
95     void releaseAndAnswerErr(const QDBusError &error);
96     void holdAndAnswerResp();
97     void holdAndAnswerErr(const QDBusError &error);
98
99
100 private:
101     QStringList m_calllist;
102 };
103
104 #endif  /* !OFONOVOICECALLMANAGER_H */