BluezQt

declarativedevicesmodel.h
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#ifndef DECLARATIVEDEVICESMODEL_H
10#define DECLARATIVEDEVICESMODEL_H
11
12#include <QSortFilterProxyModel>
13#include <qqmlregistration.h>
14
15#include "devicesmodel.h"
16
17class DeclarativeManager;
18
19class DeclarativeDevicesModel : public QSortFilterProxyModel
20{
22 QML_NAMED_ELEMENT(DevicesModelPrivate)
23 Q_PROPERTY(DeclarativeManager *manager READ manager WRITE setManager)
24
25public:
26 enum DeclarativeDeviceRoles {
27 DeviceRole = BluezQt::DevicesModel::LastRole + 1,
28 AdapterRole = BluezQt::DevicesModel::LastRole + 2,
29 MediaPlayerRole = BluezQt::DevicesModel::LastRole + 3,
30 BatteryRole = BluezQt::DevicesModel::LastRole + 4,
31 };
32
33 explicit DeclarativeDevicesModel(QObject *parent = nullptr);
34
35 DeclarativeManager *manager() const;
36 void setManager(DeclarativeManager *manager);
37
38 QHash<int, QByteArray> roleNames() const override;
39 QVariant data(const QModelIndex &index, int role) const override;
40
41private:
42 DeclarativeManager *m_manager;
43 BluezQt::DevicesModel *m_model;
44};
45
46#endif // DECLARATIVEMANAGER_H
Model of all devices.
@ LastRole
Last role used by DevicesModel.
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
QObject * parent() const const
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:47 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.