Changeset View
Changeset View
Standalone View
Standalone View
src/imports/declarativedevice.h
Show All 20 Lines | |||||
21 | */ | 21 | */ | ||
22 | 22 | | |||
23 | #ifndef DECLARATIVEDEVICE_H | 23 | #ifndef DECLARATIVEDEVICE_H | ||
24 | #define DECLARATIVEDEVICE_H | 24 | #define DECLARATIVEDEVICE_H | ||
25 | 25 | | |||
26 | #include "device.h" | 26 | #include "device.h" | ||
27 | 27 | | |||
28 | class DeclarativeAdapter; | 28 | class DeclarativeAdapter; | ||
29 | class DeclarativeBattery; | ||||
29 | class DeclarativeInput; | 30 | class DeclarativeInput; | ||
30 | class DeclarativeMediaPlayer; | 31 | class DeclarativeMediaPlayer; | ||
31 | 32 | | |||
32 | class DeclarativeDevice : public QObject | 33 | class DeclarativeDevice : public QObject | ||
33 | { | 34 | { | ||
34 | Q_OBJECT | 35 | Q_OBJECT | ||
35 | 36 | | |||
36 | Q_PROPERTY(QString ubi READ ubi CONSTANT) | 37 | Q_PROPERTY(QString ubi READ ubi CONSTANT) | ||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | 58 | public: | |||
89 | qint16 rssi() const; | 90 | qint16 rssi() const; | ||
90 | 91 | | |||
91 | bool isConnected() const; | 92 | bool isConnected() const; | ||
92 | 93 | | |||
93 | QStringList uuids() const; | 94 | QStringList uuids() const; | ||
94 | 95 | | |||
95 | QString modalias() const; | 96 | QString modalias() const; | ||
96 | 97 | | |||
98 | DeclarativeBattery *battery() const; | ||||
99 | | ||||
97 | DeclarativeInput *input() const; | 100 | DeclarativeInput *input() const; | ||
98 | 101 | | |||
99 | DeclarativeMediaPlayer *mediaPlayer() const; | 102 | DeclarativeMediaPlayer *mediaPlayer() const; | ||
100 | 103 | | |||
101 | DeclarativeAdapter *adapter() const; | 104 | DeclarativeAdapter *adapter() const; | ||
102 | 105 | | |||
103 | public Q_SLOTS: | 106 | public Q_SLOTS: | ||
104 | BluezQt::PendingCall *connectToDevice(); | 107 | BluezQt::PendingCall *connectToDevice(); | ||
Show All 16 Lines | 114 | Q_SIGNALS: | |||
121 | void pairedChanged(bool paired); | 124 | void pairedChanged(bool paired); | ||
122 | void trustedChanged(bool trusted); | 125 | void trustedChanged(bool trusted); | ||
123 | void blockedChanged(bool blocked); | 126 | void blockedChanged(bool blocked); | ||
124 | void legacyPairingChanged(bool legacyPairing); | 127 | void legacyPairingChanged(bool legacyPairing); | ||
125 | void rssiChanged(qint16 rssi); | 128 | void rssiChanged(qint16 rssi); | ||
126 | void connectedChanged(bool connected); | 129 | void connectedChanged(bool connected); | ||
127 | void uuidsChanged(const QStringList &uuids); | 130 | void uuidsChanged(const QStringList &uuids); | ||
128 | void modaliasChanged(const QString &modalias); | 131 | void modaliasChanged(const QString &modalias); | ||
132 | void batteryChanged(DeclarativeBattery *battery); | ||||
129 | void inputChanged(DeclarativeInput *input); | 133 | void inputChanged(DeclarativeInput *input); | ||
130 | void mediaPlayerChanged(DeclarativeMediaPlayer *mediaPlayer); | 134 | void mediaPlayerChanged(DeclarativeMediaPlayer *mediaPlayer); | ||
131 | 135 | | |||
132 | private: | 136 | private: | ||
137 | void updateBattery(); | ||||
133 | void updateInput(); | 138 | void updateInput(); | ||
134 | void updateMediaPlayer(); | 139 | void updateMediaPlayer(); | ||
135 | 140 | | |||
136 | BluezQt::DevicePtr m_device; | 141 | BluezQt::DevicePtr m_device; | ||
137 | DeclarativeAdapter *m_adapter; | 142 | DeclarativeAdapter *m_adapter; | ||
143 | DeclarativeBattery *m_battery; | ||||
138 | DeclarativeInput *m_input; | 144 | DeclarativeInput *m_input; | ||
139 | DeclarativeMediaPlayer *m_mediaPlayer; | 145 | DeclarativeMediaPlayer *m_mediaPlayer; | ||
140 | }; | 146 | }; | ||
141 | 147 | | |||
142 | #endif // DECLARATIVEDEVICE_H | 148 | #endif // DECLARATIVEDEVICE_H |