Add more Q_PROPERTY declarations
[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     
44     Q_PROPERTY(QString path READ path)
45     Q_PROPERTY(QString errorName READ errorName)
46     Q_PROPERTY(QString errorMessage READ errorMessage)
47     
48     Q_PROPERTY(QString lineIdentification READ lineIdentification NOTIFY lineIdentificationChanged)
49     Q_PROPERTY(QString incomingLine READ incomingLine NOTIFY incomingLineChanged)
50     Q_PROPERTY(QString name READ name NOTIFY nameChanged)
51     Q_PROPERTY(QString state READ state NOTIFY stateChanged)
52     Q_PROPERTY(QString startTime READ startTime NOTIFY startTimeChanged)
53     Q_PROPERTY(QString information READ information NOTIFY informationChanged)
54     Q_PROPERTY(bool multiparty READ multiparty NOTIFY multipartyChanged)
55     Q_PROPERTY(bool emergency READ emergency NOTIFY emergencyChanged)
56     Q_PROPERTY(quint8 icon READ icon NOTIFY iconChanged)
57
58 public:
59     OfonoVoiceCall(const QString &callId, QObject *parent=0);
60     OfonoVoiceCall(const OfonoVoiceCall &op);
61     ~OfonoVoiceCall();
62
63     OfonoVoiceCall operator=(const OfonoVoiceCall &op);
64     bool operator==(const OfonoVoiceCall &op);
65
66     //! Returns the D-Bus object path of the voice call object
67     QString path() const;
68
69     //! Get the D-Bus error name of the last operation.
70     /*!
71      * Returns the D-Bus error name of the last operation (setting a property
72      * or calling a method) if it has failed
73      */
74     QString errorName() const;
75
76     //! Get the D-Bus error message of the last operation.
77     /*!
78      * Returns the D-Bus error message of the last operation (setting a property
79      * or calling a method) if it has failed
80      */
81     QString errorMessage() const;
82
83     void answer();
84     void hangup();
85     void deflect(const QString &number);
86     QString lineIdentification() const;
87     QString incomingLine() const;
88     QString name() const;
89     QString state() const;
90     QString startTime() const;
91     QString information() const;
92     bool multiparty() const;
93     bool emergency() const;
94     quint8 icon() const;
95
96 signals:
97     void answerComplete(bool status);
98     void hangupComplete(bool status);
99     void deflectComplete(bool status);
100     void lineIdentificationChanged(const QString &name);
101     void nameChanged(const QString &name);
102     void stateChanged(const QString &state);
103     void startTimeChanged(const QString &time);
104     void informationChanged(const QString &mcc);
105     void incomingLineChanged(const QString &line);
106     void disconnectReason(const QString &reason);
107     void multipartyChanged(const bool multiparty);
108     void iconChanged(const quint8 &icon);
109     void emergencyChanged(const bool emergency);
110
111 private slots:
112     void propertyChanged(const QString &property, const QVariant &value);
113     void answerResp();
114     void answerErr(const QDBusError &error);
115     void hangupResp();
116     void hangupErr(const QDBusError &error);
117     void deflectResp();
118     void deflectErr(const QDBusError &error);
119
120 private:
121     OfonoInterface *m_if;
122
123 };
124
125 #endif // OFONOVOICECALL_H