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 --- network/network.cpp | 12 +++++++----- network/network.h | 13 ++++++++----- 2 files changed, 15 insertions(+), 10 deletions(-) (limited to 'network') diff --git a/network/network.cpp b/network/network.cpp index c497c29..b858206 100644 --- a/network/network.cpp +++ b/network/network.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Konsulko Group + * Copyright (C) 2018-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. @@ -14,14 +14,16 @@ * limitations under the License. */ +#include #include #include "message.h" -#include "messageengine.h" -#include "network.h" #include "networkmessage.h" #include "responsemessage.h" +#include "messageengine.h" #include "networkadapter.h" +#include "network.h" + Network::Network (QUrl &url, QQmlContext *context, QObject * parent) : QObject(parent), @@ -313,9 +315,9 @@ void Network::processReply(ResponseMessage *rmsg) void Network::onMessageReceived(MessageType type, Message *msg) { - if (msg->isEvent() && (type == NetworkEventMessage)) { + if (msg->isEvent() && (type == MessageType::NetworkEventMessage)) { processEvent(qobject_cast(msg)); - } else if (msg->isReply() && (type == ResponseRequestMessage)) { + } else if (msg->isReply() && (type == MessageType::ResponseRequestMessage)) { processReply(qobject_cast(msg)); } diff --git a/network/network.h b/network/network.h index aa83fed..ebaeb6e 100644 --- a/network/network.h +++ b/network/network.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Konsulko Group + * Copyright (C) 2018-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,18 +17,21 @@ #ifndef NETWORK_H #define NETWORK_H -#include #include #include #include #include -#include "messageengine.h" -#include "networkmessage.h" -#include "responsemessage.h" #include "wifiadapter.h" #include "wiredadapter.h" +class MessageEngine; +class Message; +class NetworkMessage; +class ResponseMessage; + +enum class MessageType; + class Network : public QObject { Q_OBJECT -- cgit 1.2.3-korg