22 #ifndef INPUTMANAGER_H
23 #define INPUTMANAGER_H
30 #include <lunaservice.h>
56 static bool switchesRingerCallback(LSHandle* handle, LSMessage* msg,
void* userData);
57 static bool switchesSliderCallback(LSHandle* handle, LSMessage* msg,
void* userData);
65 bool isSwitch(Qt::Key key);
66 bool isHeadsetKey(Qt::Key key);
67 bool isAudioKey(Qt::Key key);
68 bool isMediaKey(Qt::Key key);
69 bool isBluetoothKey(Qt::Key key);
70 bool isPublicCategory(
const char* category);
72 static bool activityStartCallback(LSHandle* handle, LSMessage* msg,
void* userData);
74 json_object* createKeyJson(
const char* key,
const char* value);
75 json_object* createKeyJson(
const char* key,
QEvent::Type type);
77 void postKeyToSubscribers(QKeyEvent* event,
const char* category,
const char* keyString,
const char* keyValue = NULL);
78 static bool processSubscription(LSHandle* handle, LSMessage* msg,
void* userData);
79 bool processKeyState(LSHandle* handle, LSMessage* msg,
void* userData);
81 void handleBluetoothKey(
const QKeyEvent* event);
85 bool keyToString(Qt::Key key,
const char**
string);
86 qint32 stringToKey(
const char*
string);
88 LSPalmService* m_palmService;
90 LSHandle* m_publicService;
104 HeadsetType m_headsetType;
106 enum HeadsetButtonState {
110 PotentialDoublePress,
114 void headsetStateMachine(
QEvent* e);
115 bool headsetBtnTimerCallback(
void);
116 HeadsetButtonState m_headsetBtnState;
117 Timer<InputManager> m_headsetBtnTimer;
119 class CategoryMapEntry {
126 CategoryMapEntry(
const std::string& category,
bool isPublic)
128 m_category = category;
129 m_isPublic = isPublic;
138 std::string m_category;
142 std::map<std::string, CategoryMapEntry*> m_categoryMap;