10#include "bluezqt_export.h"
12#include "obexmanager.h"
14#include <QDBusArgument>
15#include <QDBusConnection>
23 explicit GlobalData();
27 QString orgFreedesktopDBusProperties;
33 QString orgBluezGattCharateristic1;
34 QString orgBluezGattDescriptor1;
37 QString orgBluezLEAdvertisingManager1;
40 QString orgBluezMediaTransport1;
42 QString orgBluezProfileManager1;
45 QString orgBluezObexAgentManager1;
52GlobalData::GlobalData()
55 orgFreedesktopDBus = QStringLiteral(
"org.freedesktop.DBus");
56 orgFreedesktopDBusProperties = QStringLiteral(
"org.freedesktop.DBus.Properties");
57 orgBluez = QStringLiteral(
"org.bluez");
58 orgBluezAdapter1 = QStringLiteral(
"org.bluez.Adapter1");
59 orgBluezBattery1 = QStringLiteral(
"org.bluez.Battery1");
60 orgBluezDevice1 = QStringLiteral(
"org.bluez.Device1");
61 orgBluezGattService1 = QStringLiteral(
"org.bluez.GattService1");
62 orgBluezGattCharateristic1 = QStringLiteral(
"org.bluez.GattCharacteristic1");
63 orgBluezGattDescriptor1 = QStringLiteral(
"org.bluez.GattDescriptor1");
64 orgBluezInput1 = QStringLiteral(
"org.bluez.Input1");
65 orgBluezGattManager1 = QStringLiteral(
"org.bluez.GattManager1");
66 orgBluezLEAdvertisingManager1 = QStringLiteral(
"org.bluez.LEAdvertisingManager1");
67 orgBluezMedia1 = QStringLiteral(
"org.bluez.Media1");
68 orgBluezMediaPlayer1 = QStringLiteral(
"org.bluez.MediaPlayer1");
69 orgBluezMediaTransport1 = QStringLiteral(
"org.bluez.MediaTransport1");
70 orgBluezAgentManager1 = QStringLiteral(
"org.bluez.AgentManager1");
71 orgBluezProfileManager1 = QStringLiteral(
"org.bluez.ProfileManager1");
72 orgBluezObex = QStringLiteral(
"org.bluez.obex");
73 orgBluezObexClient1 = QStringLiteral(
"org.bluez.obex.Client1");
74 orgBluezObexAgentManager1 = QStringLiteral(
"org.bluez.obex.AgentManager1");
75 orgBluezObexSession1 = QStringLiteral(
"org.bluez.obex.Session1");
76 orgBluezObexTransfer1 = QStringLiteral(
"org.bluez.obex.Transfer1");
79Q_GLOBAL_STATIC(GlobalData, globalData)
82BLUEZQT_EXPORT
void bluezqt_initFakeBluezTestRun()
84 globalData->testRun =
true;
85 globalData->orgBluez = QStringLiteral(
"org.kde.bluezqt.fakebluez");
86 globalData->orgBluezObex = QStringLiteral(
"org.kde.bluezqt.fakebluez");
89QString Strings::orgFreedesktopDBus()
91 return globalData->orgFreedesktopDBus;
94QString Strings::orgFreedesktopDBusProperties()
96 return globalData->orgFreedesktopDBusProperties;
101 return globalData->orgBluez;
104QString Strings::orgBluezAdapter1()
106 return globalData->orgBluezAdapter1;
109QString Strings::orgBluezBattery1()
111 return globalData->orgBluezBattery1;
114QString Strings::orgBluezDevice1()
116 return globalData->orgBluezDevice1;
119QString Strings::orgBluezGattService1()
121 return globalData->orgBluezGattService1;
124QString Strings::orgBluezGattCharacteristic1()
126 return globalData->orgBluezGattCharateristic1;
129QString Strings::orgBluezGattDescriptor1()
131 return globalData->orgBluezGattDescriptor1;
134QString Strings::orgBluezInput1()
136 return globalData->orgBluezInput1;
139QString Strings::orgBluezGattManager1()
141 return globalData->orgBluezGattManager1;
144QString Strings::orgBluezLEAdvertisingManager1()
146 return globalData->orgBluezLEAdvertisingManager1;
149QString Strings::orgBluezMedia1()
151 return globalData->orgBluezMedia1;
154QString Strings::orgBluezMediaPlayer1()
156 return globalData->orgBluezMediaPlayer1;
159QString Strings::orgBluezMediaTransport1()
161 return globalData->orgBluezMediaTransport1;
164QString Strings::orgBluezAgentManager1()
166 return globalData->orgBluezAgentManager1;
169QString Strings::orgBluezProfileManager1()
171 return globalData->orgBluezProfileManager1;
176 return globalData->orgBluezObex;
179QString Strings::orgBluezObexClient1()
181 return globalData->orgBluezObexClient1;
184QString Strings::orgBluezObexAgentManager1()
186 return globalData->orgBluezObexAgentManager1;
189QString Strings::orgBluezObexSession1()
191 return globalData->orgBluezObexSession1;
194QString Strings::orgBluezObexTransfer1()
196 return globalData->orgBluezObexTransfer1;
201 if (globalData->testRun) {
214 return globalData->manager;
217void Instance::setManager(
Manager *manager)
219 globalData->manager = manager;
222ObexManager *Instance::obexManager()
224 return globalData->obexManager;
227void Instance::setObexManager(ObexManager *obexManager)
229 globalData->obexManager = obexManager;
236 for (
const QString &str : list) {
237 converted.
append(str.toUpper());
242ManData variantToManData(
const QVariant &v) {
258 const uint16_t &key = i.key();
266 switch ((classNum & 0x1f00) >> 8) {
270 switch ((classNum & 0xfc) >> 2) {
279 switch ((classNum & 0xfc) >> 2) {
289 switch ((classNum & 0xc0) >> 6) {
291 switch ((classNum & 0x1e) >> 2) {
300 switch ((classNum & 0x1e) >> 2) {
309 if (classNum & 0x80) {
311 }
else if (classNum & 0x20) {
328 switch ((appearance & 0xffc0) >> 6) {
342 switch (appearance & 0x3f) {
@ Modem
The device is a modem.
@ Wearable
The device is a wearable device.
@ Uncategorized
The device is not of any of the known types.
@ Headset
The device is a headset.
@ Imaging
The device is an uncategorized imaging device.
@ Tablet
The device is a graphics tablet (input device).
@ Camera
The device is a camera.
@ Peripheral
The device is an uncategorized peripheral device.
@ AudioVideo
The device is an uncategorized audio video device.
@ Toy
The device is a toy.
@ Network
The device is a network.
@ Mouse
The device is a mouse.
@ Phone
The device is a phone.
@ Headphones
The device is a headphones.
@ Computer
The device is a computer.
@ Joypad
The device is a joypad.
@ Printer
The device is a printer.
@ Keyboard
The device is a keyboard.
@ Health
The device is a health device.
KIOCORE_EXPORT QStringList list(const QString &fileClass)
QDBusConnection sessionBus()
QDBusConnection systemBus()
void append(QList< T > &&value)
void reserve(qsizetype size)
qsizetype size() const const
const_iterator constBegin() const const
const_iterator constEnd() const const
bool isValid() const const
QByteArray toByteArray() const const