sensorfw: adaptors/kbslideradaptor/kbslideradaptor.h Source File

sensorfw

kbslideradaptor.h
Go to the documentation of this file.
1
27#ifndef KBSLIDERADAPTOR_H
28#define KBSLIDERADAPTOR_H
29
30#include "inputdevadaptor.h"
31#include "deviceadaptorringbuffer.h"
32
40 class KeyboardSliderAdaptor : public InputDevAdaptor
41{
42 Q_OBJECT;
43public:
44 /* Enumerates the possible states for keyboard */
45 enum KeyboardSliderState {
46 KeyboardSliderStateOpen = 0,
47 KeyboardSliderStateClosed,
48 KeyboardSliderStateUnknown
49 };
50
55 static DeviceAdaptor* factoryMethod(const QString& id)
56 {
57 return new KeyboardSliderAdaptor(id);
58 }
59
60protected:
65 KeyboardSliderAdaptor(const QString& id);
66 ~KeyboardSliderAdaptor();
67
68 virtual unsigned int interval() const;
69 virtual bool setInterval(unsigned int value, int sessionId);
70
71private:
72
73 DeviceAdaptorRingBuffer<KeyboardSliderState>* kbstateBuffer_;
74 bool newKbEventRecorded_;
75 KeyboardSliderState currentState_;
76
77 void interpretEvent(int src, struct input_event *ev);
78 void commitOutput();
79 void interpretSync(int src, struct input_event *ev);
80};
81
82#endif
KeyboardSliderAdaptor
Adaptor for device keyboard slider state.
Definition: kbslideradaptor.h:41
KeyboardSliderAdaptor::factoryMethod
static DeviceAdaptor * factoryMethod(const QString &id)
Factory method for gaining a new instance of KeyboardSliderAdaptor class.
Definition: kbslideradaptor.h:55
KeyboardSliderAdaptor::~KeyboardSliderAdaptor
~KeyboardSliderAdaptor()
KeyboardSliderAdaptor::interval
virtual unsigned int interval() const
KeyboardSliderAdaptor::setInterval
virtual bool setInterval(unsigned int value, int sessionId)
KeyboardSliderAdaptor::KeyboardSliderAdaptor
KeyboardSliderAdaptor(const QString &id)
Constructor.
KeyboardSliderAdaptor::KeyboardSliderState
KeyboardSliderState
Definition: kbslideradaptor.h:45
KeyboardSliderAdaptor::KeyboardSliderStateOpen
@ KeyboardSliderStateOpen
Keyboard slider open.
Definition: kbslideradaptor.h:46
KeyboardSliderAdaptor::KeyboardSliderStateUnknown
@ KeyboardSliderStateUnknown
Keyboard slider state unknown.
Definition: kbslideradaptor.h:48
KeyboardSliderAdaptor::KeyboardSliderStateClosed
@ KeyboardSliderStateClosed
Keyboard slider closed.
Definition: kbslideradaptor.h:47