• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

adaptors/kbslideradaptor/kbslideradaptor.h

Go to the documentation of this file.
00001 
00027 #ifndef KBSLIDERADAPTOR_H
00028 #define KBSLIDERADAPTOR_H
00029 
00030 #include "inputdevadaptor.h"
00031 #include "deviceadaptorringbuffer.h"
00032 
00040 class KeyboardSliderAdaptor : public InputDevAdaptor
00041 {
00042     Q_OBJECT;
00043 public:
00044     /* Enumerates the possible states for keyboard */
00045     enum KeyboardSliderState {
00046         KeyboardSliderStateOpen = 0, 
00047         KeyboardSliderStateClosed,   
00048         KeyboardSliderStateUnknown   
00049     };
00050 
00055     static DeviceAdaptor* factoryMethod(const QString& id)
00056     {
00057         return new KeyboardSliderAdaptor(id);
00058     }
00059 
00060 protected:
00065     KeyboardSliderAdaptor(const QString& id);
00066     ~KeyboardSliderAdaptor();
00067 
00068     virtual unsigned int interval() const;
00069     virtual bool setInterval(unsigned int value, int sessionId);
00070 
00071 private:
00072 
00073     DeviceAdaptorRingBuffer<KeyboardSliderState>* kbstateBuffer_;
00074     bool                                          newKbEventRecorded_;
00075     KeyboardSliderState                           currentState_;
00076 
00077     void interpretEvent(int src, struct input_event *ev);
00078     void commitOutput();
00079     void interpretSync(int src, struct input_event *ev);
00080 };
00081 
00082 #endif

Generated on Mon Jun 27 2011 14:38:47 for sensorfw by  doxygen 1.7.1