GeolocationService.hpp Example File
bpstoqml/src/GeolocationService.hpp
#ifndef GEOLOCATIONSERVICE_H_
#define GEOLOCATIONSERVICE_H_
#include "BlackBerryPlatformService.hpp"
namespace bb {
namespace cascades {
namespace bps {
class GeolocationService: public BlackBerryPlatformService {
Q_OBJECT
Q_PROPERTY( unsigned int period READ period WRITE setPeriod )
public:
GeolocationService(QObject *parent = 0);
~GeolocationService();
virtual void requestEvents();
virtual int eventDomain();
virtual void handleEvent(bps_event_t *event);
unsigned int period();
void setPeriod(unsigned int period);
Q_SIGNALS:
void cancel();
void locationUpdate(double latitude, double longitude, double accuracy,
bool isCoarse);
void altitudeUpdate(double altitude, bool isAltitudeValid,
double altitudeAccuracy, bool isAltitudeAccuracyValid);
void headingUpdate(double heading, bool isHeadingValid);
void speedUpdate(double speed, bool isSpeedValid);
private:
unsigned int m_period;
};
}
}
}
QML_DECLARE_TYPE(bb::cascades::bps::GeolocationService)
#endif /* GEOLOCATIONSERVICE_H_ */