diff options
author | aavit <eirik.aavitsland@digia.com> | 2014-09-10 14:50:28 +0200 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@digia.com> | 2014-10-08 11:37:49 +0300 |
commit | 3d6bb94a9e7c80edc4b2a2321b464533a4a7f60b (patch) | |
tree | c164a2bd67eb0b172398c38c471b9be5d9bea4ce /src/utils/b2qtdevice.h | |
parent | 20b464d745b7ae319a89d9c2b14c5dcf7364c250 (diff) |
Rename DroidUtils -> B2QtUtils and refactor the API
Preparing this module for being documented and presented for
external users.
- Renamed since this is for eLinux as well as eAndroid
- Provide all settings as proper Q_PROPERTYs for easy QML access
- Hide all the detailed audio stuff that's not useful for users
- Implement a getter function for current backlight, so that we don't
have to reset it to full every time this module is loaded
- qmake now groks this as internal module, so get rid build kludges
- hostname setting on eLinux fixed
- getIPAddress() now returns ALL active addresses, and implentation
is simplified
Task-number: QTEE-704
Change-Id: I9f22d5531b5963ae7e78c840bcfe1edd6197f82a
Reviewed-by: Samuli Piippo <samuli.piippo@digia.com>
Diffstat (limited to 'src/utils/b2qtdevice.h')
-rw-r--r-- | src/utils/b2qtdevice.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/utils/b2qtdevice.h b/src/utils/b2qtdevice.h new file mode 100644 index 0000000..fb3232a --- /dev/null +++ b/src/utils/b2qtdevice.h @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use the contact form at +** http://qt.digia.com/ +** +** This file is part of Qt Enterprise Embedded. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** the contact form at http://qt.digia.com/ +** +****************************************************************************/ +#ifndef B2QTDEVICE_H +#define B2QTDEVICE_H + +#include <qobject.h> + +class Q_DECL_EXPORT B2QtDevice : public QObject +{ + Q_OBJECT + + Q_PROPERTY(quint8 displayBrightness READ displayBrightness WRITE setDisplayBrightness NOTIFY displayBrightnessChanged) + Q_PROPERTY(QString hostname READ hostname WRITE setHostname NOTIFY hostnameChanged) + Q_PROPERTY(QString ipAddress READ getIPAddress NOTIFY ipAddressChanged) + Q_PROPERTY(int masterVolume READ masterVolume WRITE setMasterVolume NOTIFY masterVolumeChanged) + +public: + B2QtDevice(QObject *parent = 0); + ~B2QtDevice(); + + quint8 displayBrightness() const; + QString hostname() const; + QString getIPAddress() const; + int masterVolume() const; + + void initAudio(); + +public Q_SLOTS: + void reboot(); + void powerOff(); + + bool setDisplayBrightness(quint8 value); + bool setHostname(const QString &name); + void setMasterVolume(int volume); + +signals: + void displayBrightnessChanged(quint8 newValue); + void hostnameChanged(const QString &newName); + void ipAddressChanged(const QString &newAddress); + void masterVolumeChanged(int newVolume); +}; + +#endif // B2QTDEVICE_H |