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

adaptors/proximityadaptor-evdev/proximityadaptor-evdev.h

Go to the documentation of this file.
00001 
00029 #ifndef PROXIMITYADAPTOR_EVDEV_H
00030 #define PROXIMITYADAPTOR_EVDEV_H
00031 
00032 #include "inputdevadaptor.h"
00033 #include "deviceadaptorringbuffer.h"
00034 #include "datatypes/orientationdata.h"
00035 
00043 class ProximityAdaptorEvdev : public InputDevAdaptor
00044 {
00045     Q_OBJECT;
00046 public:
00047     /* Enumerates the possible states for proximity */
00048     enum ProximityState {
00049         ProximityStateUnknown = -1, 
00050         ProximityStateOpen = 0,     
00051         ProximityStateClosed = 1    
00052     };
00053 
00058     static DeviceAdaptor* factoryMethod(const QString& id)
00059     {
00060         return new ProximityAdaptorEvdev(id);
00061     }
00062 
00063 protected:
00068     ProximityAdaptorEvdev(const QString& id);
00069     ~ProximityAdaptorEvdev();
00070 
00071 private:
00072 
00073     DeviceAdaptorRingBuffer<ProximityData>*   proximityBuffer_;
00074     ProximityState                            currentState_;
00075 
00076     void interpretEvent(int src, struct input_event *ev);
00077     void commitOutput(struct input_event *ev);
00078     void interpretSync(int src, struct input_event *ev);
00079 };
00080 
00081 #endif

Generated on Tue Jun 10 2014 06:25:07 for sensorfw by  doxygen 1.7.1