summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
Diffstat (limited to 'daemon')
-rw-r--r--daemon/voicecallhandler.cpp30
-rw-r--r--daemon/voicecallhandler.h4
2 files changed, 30 insertions, 4 deletions
diff --git a/daemon/voicecallhandler.cpp b/daemon/voicecallhandler.cpp
index cce1792..180fa5b 100644
--- a/daemon/voicecallhandler.cpp
+++ b/daemon/voicecallhandler.cpp
@@ -19,7 +19,8 @@ class VoiceCallHandlerPrivate
public:
VoiceCallHandlerPrivate(VoiceCallHandler *q, const QString &pHandlerId)
: q_ptr(q), handlerId(pHandlerId), interface(NULL)
- , duration(0), status(0), emergency(false), multiparty(false), forwarded(false)
+ , duration(0), status(0), emergency(false), incoming(false)
+ , multiparty(false) , forwarded(false), remoteHeld(false)
{ /* ... */ }
VoiceCallHandler *q_ptr;
@@ -35,8 +36,10 @@ public:
QString providerId;
QDateTime startedAt;
bool emergency;
+ bool incoming;
bool multiparty;
bool forwarded;
+ bool remoteHeld;
};
/*!
@@ -83,6 +86,7 @@ void VoiceCallHandler::initialize(bool notifyError)
connect(d->interface, SIGNAL(emergencyChanged(bool)), SLOT(onEmergencyChanged(bool)));
connect(d->interface, SIGNAL(multipartyChanged(bool)), SLOT(onMultipartyChanged(bool)));
connect(d->interface, SIGNAL(forwardedChanged(bool)), SLOT(onForwardedChanged(bool)));
+ connect(d->interface, SIGNAL(remoteHeldChanged(bool)), SLOT(onRemoteHeldChanged(bool)));
}
else {
if (notifyError) emit this->error("Failed to get VoiceCall properties from VCM D-Bus service.");
@@ -113,6 +117,8 @@ bool VoiceCallHandler::getProperties()
d->multiparty = props["isMultiparty"].toBool();
d->emergency = props["isEmergency"].toBool();
d->forwarded = props["isForwarded"].toBool();
+ d->incoming = props["isIncoming"].toBool();
+ d->remoteHeld = props["isIncoming"].toBool();
return true;
}
else {
@@ -135,8 +141,7 @@ void VoiceCallHandler::onStatusChanged(int status, QString statusText)
qCDebug(l) <<"onStatusChanged" << status << statusText;
d->status = status;
d->statusText = statusText;
- // we still fetch all properties to be sure all properties are present.
- getProperties();
+ if (status) getProperties(); // make sure all properties are present
emit statusChanged();
}
@@ -180,6 +185,14 @@ void VoiceCallHandler::onForwardedChanged(bool isForwarded)
emit forwardedChanged();
}
+void VoiceCallHandler::onRemoteHeldChanged(bool isRemoteHeld)
+{
+ Q_D(VoiceCallHandler);
+ qCDebug(l) << "onRemoteHeldChanged" << isRemoteHeld;
+ d->forwarded = isRemoteHeld;
+ emit remoteHeldChanged();
+}
+
/*!
Returns this voice calls' handler id.
*/
@@ -249,7 +262,7 @@ int VoiceCallHandler::duration() const
bool VoiceCallHandler::isIncoming() const
{
Q_D(const VoiceCallHandler);
- return d->interface->property("isIncoming").toBool();
+ return d->incoming;
}
/*!
@@ -280,6 +293,15 @@ bool VoiceCallHandler::isEmergency() const
}
/*!
+ Returns this voice calls' remoteHeld flag property.
+ */
+bool VoiceCallHandler::isRemoteHeld() const
+{
+ Q_D(const VoiceCallHandler);
+ return d->remoteHeld;
+}
+
+/*!
Initiates answering this call, if the call is an incoming call.
*/
void VoiceCallHandler::answer()
diff --git a/daemon/voicecallhandler.h b/daemon/voicecallhandler.h
index fb20ac7..6d671ce 100644
--- a/daemon/voicecallhandler.h
+++ b/daemon/voicecallhandler.h
@@ -24,6 +24,7 @@ class VoiceCallHandler : public QObject
Q_PROPERTY(bool isEmergency READ isEmergency NOTIFY emergencyChanged)
Q_PROPERTY(bool isMultiparty READ isMultiparty NOTIFY multipartyChanged)
Q_PROPERTY(bool isForwarded READ isForwarded NOTIFY forwardedChanged)
+ Q_PROPERTY(bool isRemoteHeld READ isRemoteHeld NOTIFY remoteHeldChanged)
public:
enum VoiceCallStatus {
@@ -51,6 +52,7 @@ public:
bool isMultiparty() const;
bool isEmergency() const;
bool isForwarded() const;
+ bool isRemoteHeld() const;
Q_SIGNALS:
void error(const QString &error);
@@ -61,6 +63,7 @@ Q_SIGNALS:
void emergencyChanged();
void multipartyChanged();
void forwardedChanged();
+ void remoteHeldChanged();
public Q_SLOTS:
void answer();
@@ -81,6 +84,7 @@ protected Q_SLOTS:
void onEmergencyChanged(bool isEmergency);
void onMultipartyChanged(bool isMultiparty);
void onForwardedChanged(bool isForwarded);
+ void onRemoteHeldChanged(bool isRemoteHeld);
private:
class VoiceCallHandlerPrivate *d_ptr;