qtmobility/src/sensors/qorientationsensor.h
changeset 4 90517678cc4f
parent 1 2b40d63a9c3d
child 11 06b8e2af4411
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
    55     Q_PROPERTY(Orientation orientation READ orientation)
    55     Q_PROPERTY(Orientation orientation READ orientation)
    56     DECLARE_READING(QOrientationReading)
    56     DECLARE_READING(QOrientationReading)
    57 public:
    57 public:
    58     enum Orientation {
    58     enum Orientation {
    59         Undefined = 0,
    59         Undefined = 0,
    60         BottomUp,
    60         TopUp,
    61         BottomDown,
    61         TopDown,
    62         LeftUp,
    62         LeftUp,
    63         RightUp,
    63         RightUp,
       
    64         FaceUp,
    64         FaceDown,
    65         FaceDown,
    65         FaceUp
       
    66     };
    66     };
    67 
    67 
    68     Orientation orientation() const;
    68     Orientation orientation() const;
    69     void setOrientation(Orientation orientation);
    69     void setOrientation(Orientation orientation);
    70 };
    70 };
    71 
       
    72 // begin generated code
       
    73 
    71 
    74 class Q_SENSORS_EXPORT QOrientationFilter : public QSensorFilter
    72 class Q_SENSORS_EXPORT QOrientationFilter : public QSensorFilter
    75 {
    73 {
    76 public:
    74 public:
    77     virtual bool filter(QOrientationReading *reading) = 0;
    75     virtual bool filter(QOrientationReading *reading) = 0;
    81 
    79 
    82 class Q_SENSORS_EXPORT QOrientationSensor : public QSensor
    80 class Q_SENSORS_EXPORT QOrientationSensor : public QSensor
    83 {
    81 {
    84     Q_OBJECT
    82     Q_OBJECT
    85 public:
    83 public:
    86     explicit QOrientationSensor(QObject *parent = 0) : QSensor(parent)
    84     explicit QOrientationSensor(QObject *parent = 0) : QSensor(QOrientationSensor::type, parent) {}
    87     { setType(QOrientationSensor::type); }
       
    88     virtual ~QOrientationSensor() {}
    85     virtual ~QOrientationSensor() {}
    89     QOrientationReading *reading() const { return static_cast<QOrientationReading*>(QSensor::reading()); }
    86     QOrientationReading *reading() const { return static_cast<QOrientationReading*>(QSensor::reading()); }
    90     static const char *type;
    87     static const char *type;
    91 };
    88 };
    92 // end generated code
       
    93 
    89 
    94 QTM_END_NAMESPACE
    90 QTM_END_NAMESPACE
    95 
    91 
    96 #endif
    92 #endif
    97 
    93