1/*
2 * BluezQt - Asynchronous BlueZ wrapper library
3 *
4 * SPDX-FileCopyrightText: 2014 David Rosca <nowrep@gmail.com>
5 *
6 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8
9#include "bluezqtextensionplugin.h"
10#include "services.h"
11
12static QJSValue services_singleton(QQmlEngine *engine, QJSEngine *scriptEngine)
13{
14 Q_UNUSED(engine)
15
16 QJSValue object = scriptEngine->newObject();
17 object.setProperty(QStringLiteral("ServiceDiscoveryServer"), value: BluezQt::Services::ServiceDiscoveryServer);
18 object.setProperty(QStringLiteral("SerialPort"), value: BluezQt::Services::SerialPort);
19 object.setProperty(QStringLiteral("DialupNetworking"), value: BluezQt::Services::DialupNetworking);
20 object.setProperty(QStringLiteral("ObexObjectPush"), value: BluezQt::Services::ObexObjectPush);
21 object.setProperty(QStringLiteral("ObexFileTransfer"), value: BluezQt::Services::ObexFileTransfer);
22 object.setProperty(QStringLiteral("Headset"), value: BluezQt::Services::Headset);
23 object.setProperty(QStringLiteral("AudioSource"), value: BluezQt::Services::AudioSource);
24 object.setProperty(QStringLiteral("AudioSink"), value: BluezQt::Services::AudioSink);
25 object.setProperty(QStringLiteral("AudioVideoRemoteControlTarget"), value: BluezQt::Services::AudioVideoRemoteControlTarget);
26 object.setProperty(QStringLiteral("AdvancedAudioDistribution"), value: BluezQt::Services::AdvancedAudioDistribution);
27 object.setProperty(QStringLiteral("AudioVideoRemoteControl"), value: BluezQt::Services::AudioVideoRemoteControl);
28 object.setProperty(QStringLiteral("HeadsetAudioGateway"), value: BluezQt::Services::HeadsetAudioGateway);
29 object.setProperty(QStringLiteral("Panu"), value: BluezQt::Services::Panu);
30 object.setProperty(QStringLiteral("Nap"), value: BluezQt::Services::Nap);
31 object.setProperty(QStringLiteral("Handsfree"), value: BluezQt::Services::Handsfree);
32 object.setProperty(QStringLiteral("HandsfreeAudioGateway"), value: BluezQt::Services::HandsfreeAudioGateway);
33 object.setProperty(QStringLiteral("HumanInterfaceDevice"), value: BluezQt::Services::HumanInterfaceDevice);
34 object.setProperty(QStringLiteral("SimAccess"), value: BluezQt::Services::SimAccess);
35 object.setProperty(QStringLiteral("PhonebookAccessServer"), value: BluezQt::Services::PhonebookAccessServer);
36 object.setProperty(QStringLiteral("MessageAccessServer"), value: BluezQt::Services::MessageAccessServer);
37 object.setProperty(QStringLiteral("PnpInformation"), value: BluezQt::Services::PnpInformation);
38 object.setProperty(QStringLiteral("GenericAccess"), value: BluezQt::Services::GenericAccess);
39 object.setProperty(QStringLiteral("GenericAcces"), value: BluezQt::Services::GenericAccess); // TODO KF6: Remove the one with typo
40 object.setProperty(QStringLiteral("GenericAttribute"), value: BluezQt::Services::GenericAttribute);
41 object.setProperty(QStringLiteral("ImmediateAlert"), value: BluezQt::Services::ImmediateAlert);
42 object.setProperty(QStringLiteral("LinkLoss"), value: BluezQt::Services::LinkLoss);
43 object.setProperty(QStringLiteral("TxPower"), value: BluezQt::Services::TxPower);
44 object.setProperty(QStringLiteral("HeartRate"), value: BluezQt::Services::HeartRate);
45 return object;
46}
47
48void BluezQtExtensionPlugin::registerTypes(const char *uri)
49{
50 using namespace BluezQt;
51
52 Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.bluezqt"));
53
54 qmlRegisterSingletonType(uri, versionMajor: 1, versionMinor: 0, typeName: "Services", callback: services_singleton);
55}
56
57#include "moc_bluezqtextensionplugin.cpp"
58

source code of bluez-qt/src/imports/bluezqtextensionplugin.cpp