qtmobility/src/sensors/qcompass.h
changeset 4 90517678cc4f
parent 1 2b40d63a9c3d
child 11 06b8e2af4411
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
    49 class QCompassReadingPrivate;
    49 class QCompassReadingPrivate;
    50 
    50 
    51 class Q_SENSORS_EXPORT QCompassReading : public QSensorReading
    51 class Q_SENSORS_EXPORT QCompassReading : public QSensorReading
    52 {
    52 {
    53     Q_OBJECT
    53     Q_OBJECT
    54     Q_ENUMS(CalibrationLevel)
       
    55     Q_PROPERTY(qreal azimuth READ azimuth)
    54     Q_PROPERTY(qreal azimuth READ azimuth)
    56     Q_PROPERTY(CalibrationLevel calibrationLevel READ calibrationLevel)
    55     Q_PROPERTY(qreal calibrationLevel READ calibrationLevel)
    57     DECLARE_READING(QCompassReading)
    56     DECLARE_READING(QCompassReading)
    58 public:
    57 public:
    59     enum CalibrationLevel {
       
    60         Undefined = 0,
       
    61         Low       = 1,
       
    62         Middle    = 2,
       
    63         High      = 3
       
    64     };
       
    65 
       
    66     qreal azimuth() const;
    58     qreal azimuth() const;
    67     void setAzimuth(qreal azimuth);
    59     void setAzimuth(qreal azimuth);
    68 
    60 
    69     CalibrationLevel calibrationLevel() const;
    61     qreal calibrationLevel() const;
    70     void setCalibrationLevel(CalibrationLevel calibrationLevel);
    62     void setCalibrationLevel(qreal calibrationLevel);
    71 };
    63 };
    72 
       
    73 // begin generated code
       
    74 
    64 
    75 class Q_SENSORS_EXPORT QCompassFilter : public QSensorFilter
    65 class Q_SENSORS_EXPORT QCompassFilter : public QSensorFilter
    76 {
    66 {
    77 public:
    67 public:
    78     virtual bool filter(QCompassReading *reading) = 0;
    68     virtual bool filter(QCompassReading *reading) = 0;
    82 
    72 
    83 class Q_SENSORS_EXPORT QCompass : public QSensor
    73 class Q_SENSORS_EXPORT QCompass : public QSensor
    84 {
    74 {
    85     Q_OBJECT
    75     Q_OBJECT
    86 public:
    76 public:
    87     explicit QCompass(QObject *parent = 0) : QSensor(parent)
    77     explicit QCompass(QObject *parent = 0) : QSensor(QCompass::type, parent) {}
    88     { setType(QCompass::type); }
       
    89     virtual ~QCompass() {}
    78     virtual ~QCompass() {}
    90     QCompassReading *reading() const { return static_cast<QCompassReading*>(QSensor::reading()); }
    79     QCompassReading *reading() const { return static_cast<QCompassReading*>(QSensor::reading()); }
    91     static const char *type;
    80     static const char *type;
    92 };
    81 };
    93 // end generated code
       
    94 
    82 
    95 QTM_END_NAMESPACE
    83 QTM_END_NAMESPACE
    96 
    84 
    97 #endif
    85 #endif
    98 
    86