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 alias ignoredMice: priv.ignoredMice
39 readonly property var priv: StateGroup {
42 property int primaryOrientation: root.useNativeOrientation
44 property int supportedOrientations: Qt.PortraitOrientation
45 | Qt.InvertedPortraitOrientation
46 | Qt.LandscapeOrientation
47 | Qt.InvertedLandscapeOrientation
49 property int landscapeOrientation: Qt.LandscapeOrientation
50 property int invertedLandscapeOrientation: Qt.InvertedLandscapeOrientation
51 property int portraitOrientation: Qt.PortraitOrientation
52 property int invertedPortraitOrientation: Qt.InvertedPortraitOrientation
54 // Supported values so far:
55 // "phone", "tablet" or "desktop"
56 property string category: "phone"
58 property int ignoredMice: 0
65 supportedOrientations: Qt.PortraitOrientation
66 | Qt.LandscapeOrientation
67 | Qt.InvertedLandscapeOrientation
74 supportedOrientations: Qt.PortraitOrientation
75 | Qt.LandscapeOrientation
76 | Qt.InvertedLandscapeOrientation
83 supportedOrientations: Qt.PortraitOrientation
84 | Qt.LandscapeOrientation
85 | Qt.InvertedLandscapeOrientation
100 landscapeOrientation: Qt.InvertedLandscapeOrientation
101 invertedLandscapeOrientation: Qt.LandscapeOrientation
102 primaryOrientation: Qt.InvertedLandscapeOrientation
111 supportedOrientations: root.useNativeOrientation