1 #ifndef QMAEMO5ROTATOR_H
2 #define QMAEMO5ROTATOR_H
4 // Provides a means of WORKING automatic rotation for Maemo 5 apps. (The default Qt solution is buggy.)
6 #include <X11/extensions/Xrandr.h>
12 class QMaemo5Rotator : private QObject
21 AutomaticBehavior = 0,
22 LandscapeBehavior = 1,
35 LandscapeOrientation = 0,
36 PortraitOrientation = 1
42 RotationBehavior _currentBehavior;
43 Orientation _currentOrientation;
44 static bool setRotation(direction);
48 explicit QMaemo5Rotator(RotationBehavior behavior = LandscapeBehavior, QWidget *parent = NULL);
51 const RotationBehavior currentBehavior();
52 const Orientation currentOrientation();
53 void setCurrentBehavior(RotationBehavior value);
54 void setCurrentOrientation(Orientation value);
59 void on_orientation_changed(const QString& newOrienation);
63 void orientationChanged(Orientation orientation);
66 #endif // QMAEMO5ROTATOR_H