9#ifndef DECLARATIVEMANAGER_H
10#define DECLARATIVEMANAGER_H
14#include <QQmlListProperty>
18class DeclarativeDevice;
19class DeclarativeAdapter;
26 Q_PROPERTY(DeclarativeAdapter *usableAdapter READ usableAdapter NOTIFY usableAdapterChanged)
27 Q_PROPERTY(QQmlListProperty<DeclarativeAdapter> adapters READ declarativeAdapters NOTIFY adaptersChanged)
28 Q_PROPERTY(QQmlListProperty<DeclarativeDevice> devices READ declarativeDevices NOTIFY devicesChanged)
29 Q_PROPERTY(QQmlListProperty<DeclarativeDevice> connectedDevices READ declarativeConnectedDevices NOTIFY connectedDevicesChanged)
34 DeclarativeAdapter *usableAdapter()
const;
35 QQmlListProperty<DeclarativeAdapter> declarativeAdapters();
36 QQmlListProperty<DeclarativeDevice> declarativeDevices();
37 QQmlListProperty<DeclarativeDevice> declarativeConnectedDevices();
39 DeclarativeAdapter *declarativeAdapterFromPtr(BluezQt::AdapterPtr ptr)
const;
40 DeclarativeDevice *declarativeDeviceFromPtr(BluezQt::DevicePtr ptr)
const;
42 QHash<QString, DeclarativeAdapter *> m_adapters;
43 QHash<QString, DeclarativeDevice *> m_devices;
46 DeclarativeAdapter *adapterForAddress(
const QString &address)
const;
47 DeclarativeAdapter *adapterForUbi(
const QString &ubi)
const;
48 DeclarativeDevice *deviceForAddress(
const QString &address)
const;
49 DeclarativeDevice *deviceForUbi(
const QString &ubi)
const;
53 void initError(
const QString &errorText);
54 void adapterAdded(DeclarativeAdapter *adapter);
55 void adapterRemoved(DeclarativeAdapter *adapter);
56 void adapterChanged(DeclarativeAdapter *adapter);
57 void deviceAdded(DeclarativeDevice *device);
58 void deviceRemoved(DeclarativeDevice *device);
59 void deviceChanged(DeclarativeDevice *device);
60 void usableAdapterChanged(DeclarativeAdapter *adapter);
62 void adaptersChanged(QQmlListProperty<DeclarativeAdapter> adapters);
63 void devicesChanged(QQmlListProperty<DeclarativeDevice> devices);
64 void connectedDevicesChanged(QQmlListProperty<DeclarativeDevice> devices);
67 void initJobResult(BluezQt::InitManagerJob *job);
69 void slotAdapterAdded(BluezQt::AdapterPtr adapter);
70 void slotAdapterRemoved(BluezQt::AdapterPtr adapter);
71 void slotDeviceAdded(BluezQt::DevicePtr device);
72 void slotDeviceRemoved(BluezQt::DevicePtr device);
73 void slotUsableAdapterChanged(BluezQt::AdapterPtr adapter);
74 void slotDeviceConnectedChanged();
Manager(QObject *parent=nullptr)
Creates a new Manager object.
QObject * parent() const const