1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 #ifndef XQDEVICEORIENTATION_H |
|
18 #define XQDEVICEORIENTATION_H |
|
19 |
|
20 #include <QObject> |
|
21 #include "sensor_global.h" |
|
22 |
|
23 class XQDeviceOrientationPrivate; |
|
24 |
|
25 class XQDeviceOrientation : public QObject |
|
26 { |
|
27 Q_OBJECT |
|
28 |
|
29 public: |
|
30 enum DisplayOrientation |
|
31 { |
|
32 OrientationUndefined = 0, |
|
33 OrientationDisplayUp, |
|
34 OrientationDisplayDown, |
|
35 OrientationDisplayLeftUp, |
|
36 OrientationDisplayRightUp, |
|
37 OrientationDisplayUpwards, |
|
38 OrientationDisplayDownwards |
|
39 }; |
|
40 |
|
41 public: |
|
42 XQDeviceOrientation(QObject* parent = 0); |
|
43 virtual ~XQDeviceOrientation(); |
|
44 |
|
45 void open(); |
|
46 void close(); |
|
47 |
|
48 void setResolution(int resolution); |
|
49 int resolution() const; |
|
50 |
|
51 int xRotation() const; |
|
52 int yRotation() const; |
|
53 int zRotation() const; |
|
54 XQDeviceOrientation::DisplayOrientation orientation() const; |
|
55 |
|
56 Q_SIGNALS: |
|
57 void rotationChanged(int xRotation, int yRotation, int zRotation); |
|
58 void orientationChanged(XQDeviceOrientation::DisplayOrientation orientation); |
|
59 |
|
60 private: |
|
61 friend class XQDeviceOrientationPrivate; |
|
62 XQDeviceOrientationPrivate* d; |
|
63 }; |
|
64 |
|
65 #endif /*XQDEVICEORIENTATION_H*/ |
|
66 |
|
67 // End of file |
|