sensorfw
rotationsensor_i.h
Go to the documentation of this file.
1 
27 #ifndef ROTATIONSENSOR_I_H
28 #define ROTATIONSENSOR_I_H
29 
30 #include <QtDBus/QtDBus>
31 #include <QVector>
32 
33 #include "abstractsensor_i.h"
34 #include <datatypes/xyz.h>
35 
40 {
41  Q_OBJECT
42  Q_DISABLE_COPY(RotationSensorChannelInterface)
43  Q_PROPERTY(XYZ rotation READ rotation)
44  Q_PROPERTY(bool hasZ READ hasZ)
45 
46 public:
52  static const char* staticInterfaceName;
53 
61  static AbstractSensorChannelInterface* factoryMethod(const QString& id, int sessionId);
62 
68  XYZ rotation();
69 
75  bool hasZ();
76 
83  RotationSensorChannelInterface(const QString& path, int sessionId);
84 
92  static const RotationSensorChannelInterface* listenInterface(const QString& id);
93 
101  static RotationSensorChannelInterface* controlInterface(const QString& id);
102 
109  static RotationSensorChannelInterface* interface(const QString& id);
110 
111 protected:
112  virtual void connectNotify(const char* signal);
113  virtual bool dataReceivedImpl();
114 
115 private:
116  bool frameAvailableConnected;
118 Q_SIGNALS:
124  void dataAvailable(const XYZ& data);
125 
133  void frameAvailable(const QVector<XYZ>& frame);
134 };
135 
136 namespace local {
137  typedef ::RotationSensorChannelInterface RotationSensor;
138 }
139 
140 #endif /* ROTATIONSENSOR_I_H */
QObject based datatype for TimedXYZData.
static RotationSensorChannelInterface * controlInterface(const QString &id)
Request a control interface to the sensor.
Base class for sensor interface.
Base-class for client facades of different sensor types.
virtual void connectNotify(const char *signal)
int sessionId() const
Get ID of the current session.
static RotationSensorChannelInterface * interface(const QString &id)
Request an interface to the sensor.
bool hasZ()
Does reported readings include Z coordinate.
XYZ rotation()
Get latest rotation reading from sensor daemon.
QObject facade for #TimedXYZData.
Definition: xyz.h:36
Client interface for listening device rotation changes.
static const char * staticInterfaceName
Get name of the D-Bus interface for this class.
static const RotationSensorChannelInterface * listenInterface(const QString &id)
Request a listening interface to the sensor.
static AbstractSensorChannelInterface * factoryMethod(const QString &id, int sessionId)
Create new instance of the class.
::RotationSensorChannelInterface RotationSensor
void dataAvailable(const XYZ &data)
Sent when device rotation has changed.
virtual bool dataReceivedImpl()
Callback for subclasses in which they must read their expected data from socket.
void frameAvailable(const QVector< XYZ > &frame)
Sent when new measurement frame has become available.