Playlist support (basic) and download progress dialogs
[groove] / qmaemo5rotator.h
1 #ifndef QMAEMO5ROTATOR_H
2 #define QMAEMO5ROTATOR_H
3
4 //----------
5 // Provides a means of WORKING automatic rotation for Maemo 5 apps. (The default Qt solution is buggy.)
6 //----------
7
8 #include <Qt>
9 #include <QtGui>
10 #include <QtCore>
11
12 class QMaemo5Rotator : private QObject
13 {
14
15     Q_OBJECT
16
17 public:
18
19     enum RotationBehavior
20     {
21         AutomaticBehavior = 0,
22         LandscapeBehavior = 1,
23         PortraitBehavior = 2
24     };
25
26     enum Orientation
27     {
28         LandscapeOrientation = 0,
29         PortraitOrientation = 1
30     };
31
32 private:
33
34     bool isSetUp;
35     RotationBehavior _currentBehavior;
36     Orientation _currentOrientation;
37
38 public:
39
40     explicit QMaemo5Rotator(RotationBehavior behavior = LandscapeBehavior, QWidget *parent = NULL);
41     ~QMaemo5Rotator();
42
43     const RotationBehavior currentBehavior();
44     const Orientation currentOrientation();
45     void setCurrentBehavior(RotationBehavior value);
46     void setCurrentOrientation(Orientation value);
47
48 private slots:
49
50     void on_orientation_changed(const QString& newOrienation);
51
52 signals:
53
54     void orientationChanged(Orientation orientation);
55
56 };
57
58 #endif // QMAEMO5ROTATOR_H