From 5c750385d02116a92fa4c120ccc26abb8267bc97 Mon Sep 17 00:00:00 2001 From: Raquel Medina Date: Wed, 4 Mar 2020 19:32:03 +0100 Subject: eliminate unneeded dependencies on public headers - Remove unneeded dependencies from libqtappfw public headers, specifically MessageEngine and Message hierarchy header files, in preparation for refactoring work on these areas. This change helps shield client apps from the upcoming changes in the library, and highlight the separation between the library's core and the various modules providing public interfaces to those apps. - Make MessageType an scoped enum to fwd declare it. - Update Copyright statement on files updated by this patch. Bug-AGL: SPEC-3112 Signed-off-by: Raquel Medina Change-Id: I12fd9cdc034aa1166f6448c07befadd9d2042b05 --- voice/voice.cpp | 15 ++++++++------- voice/voice.h | 9 +++++---- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'voice') diff --git a/voice/voice.cpp b/voice/voice.cpp index c43e0b5..3c93960 100644 --- a/voice/voice.cpp +++ b/voice/voice.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 Konsulko Group + * Copyright (C) 2019, 2020 Konsulko Group * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,14 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +#include #include -#include "voice.h" + #include "message.h" -#include "messageengine.h" #include "responsemessage.h" #include "voicemessage.h" +#include "messageengine.h" #include "voiceagentregistry.h" +#include "voice.h" Voice::Voice (QUrl &url, QQmlContext *context, QObject *parent) : QObject(parent), @@ -181,11 +182,11 @@ void Voice::onDisconnected() void Voice::onMessageReceived(MessageType type, Message *msg) { - if (msg->isEvent() && type == VoiceEventMessage) { + if (msg->isEvent() && type == MessageType::VoiceEventMessage) { processEvent(qobject_cast(msg)); - } else if (msg->isReply() && (type == ResponseRequestMessage)) { + } else if (msg->isReply() && (type == MessageType::ResponseRequestMessage)) { processReply(qobject_cast(msg)); } else - qWarning() << "Received unknown message type:" << type; + qWarning() << "Received unknown message type:" << static_cast(type); msg->deleteLater(); } diff --git a/voice/voice.h b/voice/voice.h index d4c288e..e3132be 100644 --- a/voice/voice.h +++ b/voice/voice.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 Konsulko Group + * Copyright (C) 2019, 2020 Konsulko Group * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,16 +17,17 @@ #ifndef VOICE_H #define VOICE_H -#include #include #include #include -#include "message.h" +class VoiceAgentRegistry; class MessageEngine; +class Message; class ResponseMessage; class VoiceMessage; -class VoiceAgentRegistry; + +enum class MessageType; class Voice : public QObject { -- cgit 1.2.3-korg