2 * Copyright (C) 2015 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 readonly property int useNativeOrientation: -1
24 // The only writable property in the API
25 // all other properties are set according to the device name
26 property alias name: priv.state
28 readonly property alias primaryOrientation: priv.primaryOrientation
29 readonly property alias supportedOrientations: priv.supportedOrientations
30 readonly property alias landscapeOrientation: priv.landscapeOrientation
31 readonly property alias invertedLandscapeOrientation: priv.invertedLandscapeOrientation
32 readonly property alias portraitOrientation: priv.portraitOrientation
33 readonly property alias invertedPortraitOrientation: priv.invertedPortraitOrientation
35 readonly property alias category: priv.category
37 readonly property var priv: StateGroup {
40 property int primaryOrientation: root.useNativeOrientation
42 property int supportedOrientations: Qt.PortraitOrientation
43 | Qt.InvertedPortraitOrientation
44 | Qt.LandscapeOrientation
45 | Qt.InvertedLandscapeOrientation
47 property int landscapeOrientation: Qt.LandscapeOrientation
48 property int invertedLandscapeOrientation: Qt.InvertedLandscapeOrientation
49 property int portraitOrientation: Qt.PortraitOrientation
50 property int invertedPortraitOrientation: Qt.InvertedPortraitOrientation
52 // Supported values so far:
53 // "phone", "tablet" or "desktop"
54 property string category: "phone"
61 supportedOrientations: Qt.PortraitOrientation
62 | Qt.LandscapeOrientation
63 | Qt.InvertedLandscapeOrientation
70 supportedOrientations: Qt.PortraitOrientation
71 | Qt.LandscapeOrientation
72 | Qt.InvertedLandscapeOrientation
79 supportedOrientations: Qt.PortraitOrientation
80 | Qt.LandscapeOrientation
81 | Qt.InvertedLandscapeOrientation
95 landscapeOrientation: Qt.InvertedLandscapeOrientation
96 invertedLandscapeOrientation: Qt.LandscapeOrientation
97 primaryOrientation: Qt.InvertedLandscapeOrientation
106 supportedOrientations: root.useNativeOrientation