diff options
author | Topi Reinio <topi.reinio@digia.com> | 2014-04-08 13:22:20 +0200 |
---|---|---|
committer | Samuli Piippo <samuli.piippo@theqtcompany.com> | 2014-11-12 16:06:31 +0200 |
commit | 16a7842ddbd88f87db0b1486d5c2f418860e3e98 (patch) | |
tree | 7108c5687dce1edc0be12143358d031df62ac215 | |
parent | 2f487b2f432fde6231af464aaabfc569931c30c2 (diff) |
Doc: Document B2Qt.Utils module
Task-number: QTEE-474
Change-Id: I95064ac5908a067751d8182f6a0d883f07f7e756
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
-rw-r--r-- | src/doc/config/b2qt.qdocconf | 3 | ||||
-rw-r--r-- | src/doc/src/qtee-qml-reference.qdoc | 4 | ||||
-rw-r--r-- | src/imports/utils/plugin.cpp | 103 |
3 files changed, 109 insertions, 1 deletions
diff --git a/src/doc/config/b2qt.qdocconf b/src/doc/config/b2qt.qdocconf index 9928640..1e4b5ff 100644 --- a/src/doc/config/b2qt.qdocconf +++ b/src/doc/config/b2qt.qdocconf @@ -9,7 +9,8 @@ description = Qt Enterprise Embedded Documentation version = 3.1.1 sourcedirs = ../src \ - ../../imports/wifi + ../../imports/wifi \ + ../../imports/utils headerdirs = ../../imports/wifi diff --git a/src/doc/src/qtee-qml-reference.qdoc b/src/doc/src/qtee-qml-reference.qdoc index a1f4e4f..c085ad7 100644 --- a/src/doc/src/qtee-qml-reference.qdoc +++ b/src/doc/src/qtee-qml-reference.qdoc @@ -27,6 +27,10 @@ \annotatedlist qtee-qmlmodules + \section1 B2Qt Utils Module + + \annotatedlist utils-qmltypes + \section1 WiFi Module \annotatedlist wifi-qmltypes diff --git a/src/imports/utils/plugin.cpp b/src/imports/utils/plugin.cpp index 46aa4d2..3adf633 100644 --- a/src/imports/utils/plugin.cpp +++ b/src/imports/utils/plugin.cpp @@ -19,6 +19,109 @@ #include <b2qtdevice.h> #include <QtQml> +/*! + \qmlmodule B2Qt.Utils 1.0 + \title B2Qt Utils Module + \ingroup qtee-qmlmodules + \brief A collection of utility functions, accessible from QML. + + Provides various utility functions for controlling an embedded + device, such as display brightness, IP address and hostname, and + device shutdown/reboot. + + Import the module as follows: + + \badcode + import B2Qt.Utils 1.0 + \endcode + + This will give you access to the singleton QML type B2QtDevice. + + \note Some functions are currently only implemented for one of + the platforms. + + \section1 QML Types +*/ + +/*! + \qmltype B2QtDevice + \inqmlmodule B2Qt.Utils + \ingroup utils-qmltypes + \brief Singleton QML type providing access to utility functions. + + B2QtDevice QML type is the interface to various utility + functions. + + There is no need to create an instance of this object. To use it, + simply import the \c {B2Qt.Utils} module: + + \qml + import B2Qt.Utils 1.0 + + Text { + text: qsTr("IP Address:") + B2QtDevice.ipAddress + } + \endqml + + \note Some functions are currently only implemented for one of + the platforms. +*/ + +/*! + \qmlmethod B2Qt.Utils::B2QtDevice::reboot() + + Reboots the system. Does not return. + + \sa powerOff() +*/ + +/*! + \qmlmethod B2Qt.Utils::B2QtDevice::powerOff() + + Shuts down the system. Does not return. + + \sa reboot() +*/ + +/*! + \qmlproperty int B2Qt.Utils::B2QtDevice::masterVolume + + This property holds the master volume of the device. + The volume can range from \c 0 to \c 100 and is linear. + Changing the master volume will affect all audio streams. + + \note Currently implemented only for \B2QA. +*/ + +/*! + \qmlproperty int B2Qt.Utils::B2QtDevice::displayBrightness + This property holds the display brightness (the intensity of the backlight). + The value is in the range from \c 0 to \c 255, where 255 is the maximum + brightness, and 0 is the minimum (typically, the backlight is turned off). + + \note Currently implemented only for \B2QA. +*/ + +/*! + \qmlproperty string B2Qt.Utils::B2QtDevice::ipAddress + \readonly + + This property holds the current IP address(es) of the device + for all active network interfaces. If multiple IP addresses are defined, + this property holds a comma-separated list. The localhost (loopback) + IP addresses are omitted. + + \sa hostname +*/ + +/*! + \qmlproperty string B2Qt.Utils::B2QtDevice::hostname + + This property holds the current hostname of the device. + + \sa ipAddress +*/ + static QObject *module_api_factory(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) |