BluezQt

bluezqtextensionplugin.cpp
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
18 object.setProperty(QStringLiteral("ServiceDiscoveryServer"), BluezQt::Services::ServiceDiscoveryServer);
19 object.setProperty(QStringLiteral("SerialPort"), BluezQt::Services::SerialPort);
20 object.setProperty(QStringLiteral("DialupNetworking"), BluezQt::Services::DialupNetworking);
21 object.setProperty(QStringLiteral("ObexObjectPush"), BluezQt::Services::ObexObjectPush);
22 object.setProperty(QStringLiteral("ObexFileTransfer"), BluezQt::Services::ObexFileTransfer);
23 object.setProperty(QStringLiteral("Headset"), BluezQt::Services::Headset);
24 object.setProperty(QStringLiteral("AudioSource"), BluezQt::Services::AudioSource);
25 object.setProperty(QStringLiteral("AudioSink"), BluezQt::Services::AudioSink);
26 object.setProperty(QStringLiteral("AudioVideoRemoteControlTarget"), BluezQt::Services::AudioVideoRemoteControlTarget);
27 object.setProperty(QStringLiteral("AdvancedAudioDistribution"), BluezQt::Services::AdvancedAudioDistribution);
28 object.setProperty(QStringLiteral("AudioVideoRemoteControl"), BluezQt::Services::AudioVideoRemoteControl);
29 object.setProperty(QStringLiteral("HeadsetAudioGateway"), BluezQt::Services::HeadsetAudioGateway);
30 object.setProperty(QStringLiteral("Panu"), BluezQt::Services::Panu);
31 object.setProperty(QStringLiteral("Nap"), BluezQt::Services::Nap);
32 object.setProperty(QStringLiteral("Handsfree"), BluezQt::Services::Handsfree);
33 object.setProperty(QStringLiteral("HandsfreeAudioGateway"), BluezQt::Services::HandsfreeAudioGateway);
34 object.setProperty(QStringLiteral("HumanInterfaceDevice"), BluezQt::Services::HumanInterfaceDevice);
35 object.setProperty(QStringLiteral("SimAccess"), BluezQt::Services::SimAccess);
36 object.setProperty(QStringLiteral("PhonebookAccessServer"), BluezQt::Services::PhonebookAccessServer);
37 object.setProperty(QStringLiteral("MessageAccessServer"), BluezQt::Services::MessageAccessServer);
38 object.setProperty(QStringLiteral("PnpInformation"), BluezQt::Services::PnpInformation);
39
40 // Bluetooth Low Energy
41 object.setProperty(QStringLiteral("GenericAccess"), BluezQt::Services::GenericAccess);
42 object.setProperty(QStringLiteral("GenericAcces"), BluezQt::Services::GenericAccess); // TODO KF7: Remove the one with typo
43 object.setProperty(QStringLiteral("GenericAttribute"), BluezQt::Services::GenericAttribute);
44 object.setProperty(QStringLiteral("ImmediateAlert"), BluezQt::Services::ImmediateAlert);
45 object.setProperty(QStringLiteral("LinkLoss"), BluezQt::Services::LinkLoss);
46 object.setProperty(QStringLiteral("TxPower"), BluezQt::Services::TxPower);
47 object.setProperty(QStringLiteral("HeartRate"), BluezQt::Services::HeartRate);
48 object.setProperty(QStringLiteral("CoordinatedSetIdentification"), BluezQt::Services::CoordinatedSetIdentification);
49 object.setProperty(QStringLiteral("MicrophoneControl"), BluezQt::Services::MicrophoneControl);
50 object.setProperty(QStringLiteral("BroadcastAudioScan"), BluezQt::Services::BroadcastAudioScan);
51 object.setProperty(QStringLiteral("PublishedAudioCapabilities"), BluezQt::Services::PublishedAudioCapabilities);
52 object.setProperty(QStringLiteral("CommonAudio"), BluezQt::Services::CommonAudio);
53
54 return object;
55}
56
57void BluezQtExtensionPlugin::registerTypes(const char *uri)
58{
59 using namespace BluezQt;
60
61 Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.bluezqt"));
62
63 qmlRegisterSingletonType(uri, 1, 0, "Services", services_singleton);
64}
65
66#include "moc_bluezqtextensionplugin.cpp"
QJSValue newObject()
void setProperty(const QString &name, const QJSValue &value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.