GeolocationClientBlackBerry.h [plain text]
#ifndef GeolocationClientBlackBerry_h
#define GeolocationClientBlackBerry_h
#include <BlackBerryPlatformGeoTracker.h>
#include <BlackBerryPlatformGeoTrackerListener.h>
#include <GeolocationClient.h>
#include <wtf/HashMap.h>
#include <wtf/RefPtr.h>
#include <wtf/text/WTFString.h>
namespace BlackBerry {
namespace WebKit {
class WebPagePrivate;
}
}
namespace WebCore {
class GeolocationClientBlackBerry : public GeolocationClient, public BlackBerry::Platform::GeoTrackerListener {
public:
GeolocationClientBlackBerry(BlackBerry::WebKit::WebPagePrivate*);
virtual void geolocationDestroyed();
virtual void startUpdating();
virtual void stopUpdating();
virtual GeolocationPosition* lastPosition();
virtual void setEnableHighAccuracy(bool);
virtual void requestPermission(Geolocation*);
virtual void cancelPermissionRequest(Geolocation*);
virtual bool requiresHighAccuracy() { return m_accuracy; }
virtual void onLocationUpdate(double timestamp, double latitude, double longitude, double accuracy, double altitude, bool altitudeValid, double altitudeAccuracy,
bool altitudeAccuracyValid, double speed, bool speedValid, double heading, bool headingValid);
virtual void onLocationError(const char* error);
virtual void onPermission(const BlackBerry::Platform::String& origin, bool isAllowed);
private:
BlackBerry::WebKit::WebPagePrivate* m_webPagePrivate;
RefPtr<GeolocationPosition> m_lastPosition;
HashMap<String, Vector<RefPtr<Geolocation> > > m_geolocationRequestMap;
bool m_accuracy;
bool m_isActive;
};
}
#endif // GeolocationClientBlackBerry_h