From cd5c8fee6f24d3704c3fc7d94b36d86c07c0369f Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Wed, 15 Jan 2020 14:22:17 -0500 Subject: 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 Change-Id: I33fc2440ebdc2a4a2de79ff0a49acbc422c47da2 --- messageengine.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'messageengine.cpp') 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 @@ -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; -- cgit 1.2.3-korg