BPSMonitor.cpp Example File
bpstoqml/src/BPSMonitor.cpp
#include "AccelerometerService.hpp"
#include "AzimuthPitchRollService.hpp"
#include "BPSEventHandler.hpp"
#include "BPSMonitor.hpp"
#include "GeolocationService.hpp"
#include "LightService.hpp"
#include "MagnetometerService.hpp"
#include "ProximityService.hpp"
#include "VirtualKeyboardService.hpp"
namespace bb {
namespace cascades {
namespace bps {
BPSMonitor::BPSMonitor(QObject *parent)
: QObject(parent)
, m_bpsEventHandler(new BPSEventHandler())
, m_virtualKeyboardService(0)
, m_geolocationService(0)
, m_accelerometerService(0)
, m_magnetometerService(0)
, m_proximityService(0)
, m_azimuthPitchRollService(0)
, m_lightService(0)
{
}
BPSMonitor::~BPSMonitor() {
delete m_bpsEventHandler;
delete m_virtualKeyboardService;
delete m_geolocationService;
delete m_accelerometerService;
delete m_magnetometerService;
delete m_proximityService;
delete m_azimuthPitchRollService;
delete m_lightService;
}
VirtualKeyboardService *BPSMonitor::virtualKeyboardService() {
return m_virtualKeyboardService;
}
void BPSMonitor::setVirtualKeyboardService(VirtualKeyboardService *service) {
m_bpsEventHandler->registerService(service);
m_virtualKeyboardService = service;
}
GeolocationService *BPSMonitor::geolocationService() {
return m_geolocationService;
}
void BPSMonitor::setGeolocationService(GeolocationService *service) {
m_bpsEventHandler->registerService(service);
m_geolocationService = service;
}
AccelerometerService *BPSMonitor::accelerometerService() {
return m_accelerometerService;
}
void BPSMonitor::setAccelerometerService(AccelerometerService *service) {
m_bpsEventHandler->registerService(service);
m_accelerometerService = service;
}
MagnetometerService *BPSMonitor::magnetometerService() {
return m_magnetometerService;
}
void BPSMonitor::setMagnetometerService(MagnetometerService *service) {
m_bpsEventHandler->registerService(service);
m_magnetometerService = service;
}
ProximityService *BPSMonitor::proximityService() {
return m_proximityService;
}
void BPSMonitor::setProximityService(ProximityService *service) {
m_bpsEventHandler->registerService(service);
m_proximityService = service;
}
AzimuthPitchRollService *BPSMonitor::azimuthPitchRollService() {
return m_azimuthPitchRollService;
}
void BPSMonitor::setAzimuthPitchRollService(AzimuthPitchRollService *service) {
m_bpsEventHandler->registerService(service);
m_azimuthPitchRollService = service;
}
LightService *BPSMonitor::lightService() {
return m_lightService;
}
void BPSMonitor::setLightService(LightService *service) {
m_bpsEventHandler->registerService(service);
m_lightService = service;
}
}
}
}