Qt bindings for oFono cellular services  1.30
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 <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 #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 
36 
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 
67  QString path() const;
68 
70 
74  QString errorName() const;
75 
77 
81  QString errorMessage() const;
82 
83  QString lineIdentification() const;
84  QString incomingLine() const;
85  QString name() const;
86  QString state() const;
87  QString startTime() const;
88  QString information() const;
89  bool multiparty() const;
90  bool emergency() const;
91  quint8 icon() const;
92  bool remoteHeld() const;
93  bool remoteMultiparty() const;
94 
95 public Q_SLOTS:
96  void answer();
97  void hangup();
98  void deflect(const QString &number);
99 
100 Q_SIGNALS:
101  void answerComplete(bool status);
102  void hangupComplete(bool status);
103  void deflectComplete(bool status);
104  void lineIdentificationChanged(const QString &name);
105  void nameChanged(const QString &name);
106  void stateChanged(const QString &state);
107  void startTimeChanged(const QString &time);
108  void informationChanged(const QString &mcc);
109  void incomingLineChanged(const QString &line);
110  void disconnectReason(const QString &reason);
111  void multipartyChanged(const bool multiparty);
112  void iconChanged(const quint8 &icon);
113  void emergencyChanged(const bool emergency);
114  void remoteHeldChanged(const bool remoteHeld);
115  void remoteMultipartyChanged(const bool remoteMultiparty);
116 
117 private Q_SLOTS:
118  void propertyChanged(const QString &property, const QVariant &value);
119  void answerResp();
120  void answerErr(const QDBusError &error);
121  void hangupResp();
122  void hangupErr(const QDBusError &error);
123  void deflectResp();
124  void deflectErr(const QDBusError &error);
125 
126 private:
127  OfonoInterface *m_if;
128 
129 };
130 
131 #endif // OFONOVOICECALL_H
This class is used to access oFono voice call API.
Definition: ofonovoicecall.h:40