VisioDevKit-Sample
v2.0
|
This class provides access to the location services. More...
Public Member Functions | |
~VgMyLocationManager () | |
VgMyLocationProvider * | getProvider (const std::string &pName) |
Returns the information associated with the location provider of the given name, or null if no provider exists by that name. More... | |
std::vector< std::string > | getProviders (bool pEnabledOnly=false) |
Returns a list of the names of all known location providers. More... | |
void | addProvider (VgMyLocationProvider *pProvider) |
Adds the provider to the location manager. More... | |
void | removeProvider (VgMyLocationProvider *pProvider) |
Removes the provider from the location manager. More... | |
void | addListener (const std::string &pName, VgMyLocationListener *pListener) |
Adds the listener to the location manager and associates it with the provider name. More... | |
void | removeListener (const std::string &pName, VgMyLocationListener *pListener) |
Removes the listener from the location manager. More... | |
void | notifyPositionDidChange (const std::string &pProvider, const VgEngine::VgPosition &pPosition) |
Called when the location has changed. More... | |
void | notifyFloorDidChange (const std::string &pProvider, const std::string &pFloor) |
Called when the floor has changed. More... | |
void | notifyAccuracyDidChange (const std::string &pProvider, double pAccuracy) |
Called when the accuracy has changed. More... | |
void | notifyContextDidChange (const std::string &pProvider, int pContext) |
Called when the context has changed. More... | |
void | notifyHeadingDidChange (const std::string &pProvider, double pHeading) |
Called when the heading has changed. More... | |
void | notifyStatusDidChange (const std::string &pProvider, int pStatus) |
Called when the status has changed. More... | |
void | notifyLocationProviderEnabled (const std::string &pProvider) |
Called when the provider is enabled. More... | |
void | notifyLocationProviderDisabled (const std::string &pProvider) |
Called when the provider is disabled. More... | |
Static Public Member Functions | |
static VgMyLocationManager * | getInstance () |
Additional Inherited Members | |
![]() | |
virtual | ~VgMyLocationListener () |
This class provides access to the location services.
These services allow applications to obtain periodic updates of the device's geographical location.
You do not instantiate this class directly; instead, retrieve it via the VgMyLocationManager::getInstance() method.
VgMyLocationManager::~VgMyLocationManager | ( | ) |
void VgMyLocationManager::addListener | ( | const std::string & | pName, |
VgMyLocationListener * | pListener | ||
) |
Adds the listener to the location manager and associates it with the provider name.
It's possible to associate a listener with a provider name that hasn't been added to the location manager.
pName | The name of the provider |
pListener | The listener |
void VgMyLocationManager::addProvider | ( | VgMyLocationProvider * | pProvider | ) |
Adds the provider to the location manager.
If there are already associated listeners for this provider, they will be notified of the providers current state via either notifyLocationProviderEnabled() or notifyLocationProviderDisabled().
pProvider | The provider |
Referenced by VgMyNavigationProviderManager::notifyNavigationCreated().
|
static |
Referenced by VgMyNavigationProviderManager::destroyNavigationLocationProvider(), and VgMyNavigationProviderManager::notifyNavigationCreated().
VgMyLocationProvider* VgMyLocationManager::getProvider | ( | const std::string & | pName | ) |
Returns the information associated with the location provider of the given name, or null if no provider exists by that name.
pName | The provider name |
std::vector<std::string> VgMyLocationManager::getProviders | ( | bool | pEnabledOnly = false | ) |
Returns a list of the names of all known location providers.
pEnabledOnly | If true then only the providers which are currently enabled are returned. By default is false. |
Referenced by VgMyNavigationProviderManager::notifyNavigationCreated().
|
virtual |
Called when the accuracy has changed.
pProvider | The location provider responsible for sending the notification. |
pAccuracy | The new accuracy |
Implements VgMyLocationListener.
|
virtual |
Called when the context has changed.
pProvider | The location provider responsible for sending the notification. |
pContext | The new context |
Implements VgMyLocationListener.
|
virtual |
Called when the floor has changed.
pProvider | The location provider responsible for sending the notification. |
pFloor | The new floor |
Implements VgMyLocationListener.
|
virtual |
Called when the heading has changed.
Heading is the horizontal direction of travel of this device, and is not related to the device orientation.
pProvider | The location provider responsible for sending the notification. |
pHeading | The new heading. The valid range for the heading is [0.0, 360.0]. Where 0.0 is North, and increasing values starts towards the East. |
Implements VgMyLocationListener.
|
virtual |
Called when the provider is disabled.
pProvider | The location provider responsible for sending the notification. |
Implements VgMyLocationListener.
|
virtual |
Called when the provider is enabled.
pProvider | The location provider responsible for sending the notification. |
Implements VgMyLocationListener.
|
virtual |
Called when the location has changed.
pProvider | The location provider responsible for sending the notification |
pPosition | The new position |
Implements VgMyLocationListener.
|
virtual |
Called when the status has changed.
pProvider | The location provider responsible for sending the notification. |
pStatus | The new status. See for available values. |
Implements VgMyLocationListener.
void VgMyLocationManager::removeListener | ( | const std::string & | pName, |
VgMyLocationListener * | pListener | ||
) |
Removes the listener from the location manager.
pName | The name of the provider |
pListener | The listener |
void VgMyLocationManager::removeProvider | ( | VgMyLocationProvider * | pProvider | ) |
Removes the provider from the location manager.
If the provider is enabled, then disable() will be called automatically. Listeners associated with the provider will remain registered.
pProvider | The provider |
Referenced by VgMyNavigationProviderManager::destroyNavigationLocationProvider().