summaryrefslogtreecommitdiffstats
path: root/messageengine.cpp
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2020-01-15 14:22:17 -0500
committerScott Murray <scott.murray@konsulko.com>2020-01-16 14:23:13 -0500
commitcd5c8fee6f24d3704c3fc7d94b36d86c07c0369f (patch)
treeaee51b644cd7fd7a2e9c0464474a78e6d1cd156f /messageengine.cpp
parent68cb7fec30353f3aaffb06c32f172effe6262874 (diff)
Add initial voice-capabilities binding support
Add support for subscribing to and using the guimetadata events from the vshl-capabilities binding. A GuiMetadata class is used to wrap things as it is likely that users of the other voice capabilities would not overlap if e.g. navigation event support is later added. At the moment, only the BodyTemplate1, BodyTemplate2, and WeatherTemplate guimetadata types are handled, and there is room for significant improvement in the Qt model exposed, which is somewhat crude with respect to image URL handling. As well, the weather template handling does not expose the full forecast, a full implementation of that would require adding an actual model that maps to a list view rather than a simple QObject. Bug-AGL: SPEC-3110 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I33fc2440ebdc2a4a2de79ff0a49acbc422c47da2
Diffstat (limited to 'messageengine.cpp')
-rw-r--r--messageengine.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/messageengine.cpp b/messageengine.cpp
index d2644e8..115dde7 100644
--- a/messageengine.cpp
+++ b/messageengine.cpp
@@ -17,6 +17,7 @@
#include "message.h"
#include "messageengine.h"
#include "bluetoothmessage.h"
+#include "guimetadatamessage.h"
#include "mapmessage.h"
#include "mediaplayermessage.h"
#include "navigationmessage.h"
@@ -24,10 +25,10 @@
#include "pbapmessage.h"
#include "radiomessage.h"
#include "responsemessage.h"
+#include "signalcomposermessage.h"
#include "telephonymessage.h"
#include "weathermessage.h"
#include "voicemessage.h"
-#include "signalcomposermessage.h"
#include <QJsonArray>
@@ -143,6 +144,12 @@ void MessageEngine::onTextMessageReceived(QString jsonStr)
} else if (api == "vshl-core" ) {
message = new VoiceMessage;
type = VoiceEventMessage;
+ } else if (api == "vshl-capabilities" ) {
+ // NOTE: Will need to look at event name to differentiate
+ // capabilities if more support (e.g. navigation or
+ // local media control) is added.
+ message = new GuiMetadataCapabilityMessage;
+ type = GuiMetadataCapabilityEventMessage;
} else if (api == "signal-composer") {
message = new SignalComposerMessage;
type = SignalComposerEventMessage;