Go to the documentation of this file.00001
00033 #ifndef __QMKEYS_H__
00034 #define __QMKEYS_H__
00035
00036 #include "system_global.h"
00037 #include <QtCore/qobject.h>
00038 QT_BEGIN_HEADER
00039
00040 namespace MeeGo
00041 {
00042
00043 class QmKeysPrivate;
00044
00060 class MEEGO_SYSTEM_EXPORT QmKeys : public QObject
00061 {
00062 Q_OBJECT
00063
00064 Q_ENUMS(KeyboardSliderPosition)
00065 Q_ENUMS(LensCoverPosition)
00066 Q_ENUMS(CameraKeyPosition)
00067 Q_ENUMS(Key)
00068 Q_ENUMS(State)
00069
00070 public:
00071
00073 enum KeyboardSliderPosition
00074 {
00075 KeyboardSliderIn = 0,
00076 KeyboardSliderOut
00077 };
00078
00080 enum LensCoverPosition
00081 {
00082 LensCovered = 0,
00083 LensUnCovered,
00084 Unknown
00085 };
00086
00088 enum CameraKeyPosition
00089 {
00090 Up = 0,
00091 Down,
00092 Through,
00093 Invalid
00094 };
00095
00097 enum Key
00098 {
00099 UnknownKey = -1,
00100 KeyboardSlider = 0,
00101 Camera,
00102 VolumeUp,
00103 VolumeDown,
00104 Phone,
00105 PlayPause,
00106 Stop,
00107 Forward,
00108 Rewind,
00109 Mute,
00110 LeftKey,
00111 RightKey,
00112 UpKey,
00113 DownKey,
00114 End,
00115 NextSong,
00116 PreviousSong,
00117 Pause,
00118 Play,
00119 RightCtrl,
00120 PowerKey
00121 };
00122
00124 enum State
00125 {
00126 KeyUp = 0,
00127 KeyHalfDown,
00128 KeyDown,
00129 KeyInvalid
00130 };
00131
00132 public:
00137 QmKeys(QObject *parent = 0);
00138
00139
00147 virtual ~QmKeys();
00148
00154 QmKeys::KeyboardSliderPosition getSliderPosition();
00155
00161 QmKeys::LensCoverPosition getLensCoverPosition();
00162
00168 QmKeys::CameraKeyPosition getCameraLauncherPosition();
00169
00175 bool isVolumeUpDown();
00176
00182 bool isVolumeDownDown();
00183
00189 State getKeyState(Key key);
00190
00191 Q_SIGNALS:
00192
00198 void keyboardSliderMoved(QmKeys::KeyboardSliderPosition where);
00199
00205 void lensCoverMoved(QmKeys::LensCoverPosition where);
00206
00212 void cameraLauncherMoved(QmKeys::CameraKeyPosition where);
00213
00219 void volumeUpMoved(bool Is);
00220
00226 void volumeDownMoved(bool Is);
00227
00233 void keyEvent(MeeGo::QmKeys::Key key, MeeGo::QmKeys::State state);
00234
00235 private:
00236 Q_DISABLE_COPY(QmKeys)
00237 QmKeysPrivate *priv;
00238 };
00239
00240 }
00241
00242 QT_END_HEADER
00243
00244 #endif // __QMKEYS_H__
00245