sensorfw: adaptors/lidsensoradaptor-evdev/lidsensoradaptor-evdev.h Source File

sensorfw

lidsensoradaptor-evdev.h
Go to the documentation of this file.
1
26 #ifndef LIDADAPTOR_EVDEV_H
27 #define LIDADAPTOR_EVDEV_H
28
29 #include "inputdevadaptor.h"
30 #include "deviceadaptorringbuffer.h"
31 #include "datatypes/liddata.h"
32
40 class LidSensorAdaptorEvdev : public InputDevAdaptor
41 {
42 Q_OBJECT
43 public:
44 // /* Enumerates the possible states for proximity */
45 // enum ProximityState {
46 // ProximityStateUnknown = -1, /**< Proximity state unknown */
47 // ProximityStateOpen = 0, /**< Proximity open (no target detected)*/
48 // ProximityStateClosed = 1 /**< Proximity closed (target nearby)*/
49 // };
50
55 static DeviceAdaptor* factoryMethod(const QString& id)
56 {
57 return new LidSensorAdaptorEvdev(id);
58 }
59 virtual bool startSensor();
60
61 virtual void stopSensor();
62
63 virtual bool standby();
64
65 virtual bool resume();
66 virtual void init();
67 protected:
72 LidSensorAdaptorEvdev(const QString& id);
73 ~LidSensorAdaptorEvdev();
74
75 private:
76
77 DeviceAdaptorRingBuffer<LidData> *lidBuffer_;
78 LidData::Type currentType_;
79 LidData::Type lastType;
80 qreal currentValue_;
81 qreal lastValue;
82 bool usingFront;
83
84 void interpretEvent(int src, struct input_event *ev);
85 void commitOutput(struct input_event *ev);
86 void interpretSync(int src, struct input_event *ev);
87 QByteArray powerStatePath_;
88 };
89
90 #endif
LidData::Type
Type
Type of lid.
Definition: liddata.h:42
LidSensorAdaptorEvdev
Adaptor for lid sensor.
Definition: lidsensoradaptor-evdev.h:41
LidSensorAdaptorEvdev::standby
virtual bool standby()
LidSensorAdaptorEvdev::factoryMethod
static DeviceAdaptor * factoryMethod(const QString &id)
Factory method for gaining a new instance of LidsensorAdaptorEvdev class.
Definition: lidsensoradaptor-evdev.h:55
LidSensorAdaptorEvdev::~LidSensorAdaptorEvdev
~LidSensorAdaptorEvdev()
LidSensorAdaptorEvdev::init
virtual void init()
LidSensorAdaptorEvdev::startSensor
virtual bool startSensor()
LidSensorAdaptorEvdev::resume
virtual bool resume()
LidSensorAdaptorEvdev::LidSensorAdaptorEvdev
LidSensorAdaptorEvdev(const QString &id)
Constructor.
LidSensorAdaptorEvdev::stopSensor
virtual void stopSensor()
liddata.h
Datatype for device tap events.