summaryrefslogtreecommitdiffstats
path: root/bluetooth
diff options
context:
space:
mode:
authorRaquel Medina <raquel.medina@konsulko.com>2020-03-04 19:32:03 +0100
committerRaquel Medina <raquel.medina@konsulko.com>2020-03-09 15:03:20 +0100
commit5c750385d02116a92fa4c120ccc26abb8267bc97 (patch)
treea1ac931e48956a5d94e275447d061e630376d0aa /bluetooth
parentcd1a7f3bcbaef1e9c23549f472bce4ae42b2afad (diff)
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 <raquel.medina@konsulko.com> Change-Id: I12fd9cdc034aa1166f6448c07befadd9d2042b05
Diffstat (limited to 'bluetooth')
-rw-r--r--bluetooth/bluetooth.cpp15
-rw-r--r--bluetooth/bluetooth.h12
2 files changed, 18 insertions, 9 deletions
diff --git a/bluetooth/bluetooth.cpp b/bluetooth/bluetooth.cpp
index 79cc5f1..f74d60d 100644
--- a/bluetooth/bluetooth.cpp
+++ b/bluetooth/bluetooth.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,11 +14,16 @@
* limitations under the License.
*/
+#include <QDebug>
+
#include "message.h"
-#include "messageengine.h"
-#include "bluetooth.h"
#include "bluetoothmessage.h"
#include "responsemessage.h"
+#include "messageengine.h"
+#include "bluetoothmodel.h"
+#include "bluetooth.h"
+
+
Bluetooth::Bluetooth (QUrl &url, QQmlContext *context, QObject * parent) :
QObject(parent),
@@ -258,7 +263,7 @@ void Bluetooth::processAdapterChangesEvent(QJsonObject data)
void Bluetooth::onMessageReceived(MessageType type, Message *msg)
{
- if (msg->isEvent() && type == BluetoothEventMessage) {
+ if (msg->isEvent() && type == MessageType::BluetoothEventMessage) {
BluetoothMessage *tmsg = qobject_cast<BluetoothMessage*>(msg);
if (tmsg->isDeviceChangesEvent()) {
@@ -269,7 +274,7 @@ void Bluetooth::onMessageReceived(MessageType type, Message *msg)
emit requestConfirmationEvent(tmsg->eventData());
}
- } else if (msg->isReply() && type == ResponseRequestMessage) {
+ } else if (msg->isReply() && type == MessageType::ResponseRequestMessage) {
ResponseMessage *tmsg = qobject_cast<ResponseMessage*>(msg);
if (tmsg->requestVerb() == "managed_objects") {
diff --git a/bluetooth/bluetooth.h b/bluetooth/bluetooth.h
index b79e0f4..815e180 100644
--- a/bluetooth/bluetooth.h
+++ b/bluetooth/bluetooth.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,12 +17,16 @@
#ifndef BLUETOOTH_H
#define BLUETOOTH_H
-#include <QDebug>
#include <QObject>
#include <QJsonArray>
+#include <QJsonObject>
+#include <QtQml/QQmlContext>
-#include "messageengine.h"
-#include "bluetoothmodel.h"
+class BluetoothModel;
+class MessageEngine;
+class Message;
+
+enum class MessageType;
class Bluetooth : public QObject
{