Adding CallVolume interface support in ofono-qt Bindings Signed-off-by: Arun Ravindra...
[profile/ivi/ofono-qt.git] / lib / ofonovoicecall.h
1 /*
2  * This file is part of ofono-qt
3  *
4  * Copyright (C) 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 #ifndef OFONOVOICECALL_H
24 #define OFONOVOICECALL_H
25
26 #include <QtCore/QObject>
27 #include <QVariant>
28 #include <QStringList>
29 #include <QDBusError>
30
31 #include "libofono-qt_global.h"
32
33 class OfonoInterface;
34
35 //! This class is used to access oFono voice call API
36 /*!
37  * The API is documented in
38  * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=doc/voicecall-api.txt
39  */
40 class OFONO_QT_EXPORT OfonoVoiceCall : public QObject
41 {
42     Q_OBJECT
43 public:
44     OfonoVoiceCall(const QString &callId, QObject *parent=0);
45     OfonoVoiceCall(const OfonoVoiceCall &op);
46     ~OfonoVoiceCall();
47
48     bool operator==(const OfonoVoiceCall &op);
49
50     //! Returns the D-Bus object path of the voice call object
51     QString path() const;
52
53     //! Get the D-Bus error name of the last operation.
54     /*!
55      * Returns the D-Bus error name of the last operation (setting a property
56      * or calling a method) if it has failed
57      */
58     QString errorName() const;
59
60     //! Get the D-Bus error message of the last operation.
61     /*!
62      * Returns the D-Bus error message of the last operation (setting a property
63      * or calling a method) if it has failed
64      */
65     QString errorMessage() const;
66
67     void answer();
68     void hangup();
69     void deflect(const QString &number);
70     QString lineIdentification() const;
71     QString incomingLine() const;
72     QString name() const;
73     QString state() const;
74     QString startTime() const;
75     QString information() const;
76     bool multiparty() const;
77     bool emergency() const;
78
79 signals:
80     void answerComplete(bool status);
81     void hangupComplete(bool status);
82     void deflectComplete(bool status);
83     void lineIdentificationChanged(const QString &name);
84     void nameChanged(const QString &name);
85     void stateChanged(const QString &state);
86     void startTimeChanged(const QString &time);
87     void informationChanged(const QString &mcc);
88     void incomingLineChanged(const QString &line);
89     void disconnectReason(const QString &reason);
90     void multipartyChanged(const bool multiparty);
91     void iconChanged(const quint8 &icon);
92     void emergencyChanged(const bool emergency);
93
94 private slots:
95     void propertyChanged(const QString &property, const QVariant &value);
96     void answerResp();
97     void answerErr(const QDBusError &error);
98     void hangupResp();
99     void hangupErr(const QDBusError &error);
100     void deflectResp();
101     void deflectErr(const QDBusError &error);
102
103 private:
104     OfonoInterface *m_if;
105
106 };
107
108 #endif // OFONOVOICECALL_H