BluezQt

declarativedevicesmodel.h
1 /*
2  * BluezQt - Asynchronous Bluez wrapper library
3  *
4  * SPDX-FileCopyrightText: 2014 David Rosca <[email protected]>
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 
14 #include "declarativemanager.h"
15 #include "devicesmodel.h"
16 
17 class DeclarativeDevicesModel : public QSortFilterProxyModel
18 {
19  Q_OBJECT
20  Q_PROPERTY(DeclarativeManager *manager READ manager WRITE setManager)
21 
22 public:
23  enum DeclarativeDeviceRoles {
24  DeviceRole = BluezQt::DevicesModel::LastRole + 1,
25  AdapterRole = BluezQt::DevicesModel::LastRole + 2,
26  MediaPlayerRole = BluezQt::DevicesModel::LastRole + 3,
27  BatteryRole = BluezQt::DevicesModel::LastRole + 4,
28  };
29 
30  explicit DeclarativeDevicesModel(QObject *parent = nullptr);
31 
32  DeclarativeManager *manager() const;
33  void setManager(DeclarativeManager *manager);
34 
35  QHash<int, QByteArray> roleNames() const override;
36  QVariant data(const QModelIndex &index, int role) const override;
37 
38 private:
39  DeclarativeManager *m_manager;
40  BluezQt::DevicesModel *m_model;
41 };
42 
43 #endif // DECLARATIVEMANAGER_H
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
@ LastRole
Last role used by DevicesModel.
Definition: devicesmodel.h:99
virtual QHash< int, QByteArray > roleNames() const const
virtual QVariant data(const QModelIndex &index, int role) const const override
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Sep 25 2022 04:19:10 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.