service.h
Go to the documentation of this file.
/*
* Copyright © 2013 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Thomas Voß <thomas.voss@canonical.com>
*/
#ifndef UBUNTU_APPLICATION_LOCATION_SERVICE_H_
#define UBUNTU_APPLICATION_LOCATION_SERVICE_H_
#include <ubuntu/visibility.h>
#include <ubuntu/application/location/controller.h>
#include <ubuntu/application/location/session.h>
#ifdef __cplusplus
extern "C"
{
#endif
typedef enum
{
UA_LOCATION_SERVICE_REQUIRE_ALTITUDE = 1 << 0,
UA_LOCATION_SERVICE_REQUIRE_HEADING = 1 << 1,
UA_LOCATION_SERVICE_REQUIRE_VELOCITY = 1 << 2
} UbuntuApplicationLocationServiceRequirement;
typedef UbuntuApplicationLocationServiceRequirement UALocationServiceRequirement;
typedef unsigned int UALocationServiceRequirementsFlags;
typedef enum
{
UA_LOCATION_SERVICE_ERROR_NONE = 0,
UA_LOCATION_SERVICE_ERROR_NO_CONNECTION = 1,
UA_LOCATION_SERVICE_ERROR_NO_ACCESS = 2,
UA_LOCATION_SERVICE_ERROR_GENERIC_ERROR = 3
} UbuntuApplicationLocationServiceError;
typedef UbuntuApplicationLocationServiceError UALocationServiceError;
UBUNTU_DLL_PUBLIC UALocationServiceSession*
ua_location_service_create_session_for_low_accuracy(
UALocationServiceRequirementsFlags flags);
UBUNTU_DLL_PUBLIC UALocationServiceSession*
ua_location_service_try_create_session_for_low_accuracy(
UALocationServiceRequirementsFlags flags,
UALocationServiceError* status);
UBUNTU_DLL_PUBLIC UALocationServiceSession*
ua_location_service_create_session_for_high_accuracy(
UALocationServiceRequirementsFlags flags);
UBUNTU_DLL_PUBLIC UALocationServiceSession*
ua_location_service_try_create_session_for_high_accuracy(
UALocationServiceRequirementsFlags flags,
UALocationServiceError* status);
UBUNTU_DLL_PUBLIC UALocationServiceController*
ua_location_service_create_controller();
#ifdef __cplusplus
}
#endif
#endif // UBUNTU_APPLICATION_LOCATION_SERVICE_H_
ua_location_service_create_session_for_high_accuracy
UBUNTU_DLL_PUBLIC UALocationServiceSession * ua_location_service_create_session_for_high_accuracy(UALocationServiceRequirementsFlags flags)
Creates a new session with the location service for high positional accuracy requirements.
UA_LOCATION_SERVICE_REQUIRE_ALTITUDE
Definition: service.h:58
session.h
UALocationServiceRequirement
UbuntuApplicationLocationServiceRequirement UALocationServiceRequirement
Definition: service.h:63
ua_location_service_create_session_for_low_accuracy
UBUNTU_DLL_PUBLIC UALocationServiceSession * ua_location_service_create_session_for_low_accuracy(UALocationServiceRequirementsFlags flags)
Creates a new session with the location service for low positional accuracy requirements.
ua_location_service_try_create_session_for_high_accuracy
UBUNTU_DLL_PUBLIC UALocationServiceSession * ua_location_service_try_create_session_for_high_accuracy(UALocationServiceRequirementsFlags flags, UALocationServiceError *status)
Tries to reate a new session with the location service for high positional accuracy requirements...
ua_location_service_try_create_session_for_low_accuracy
UBUNTU_DLL_PUBLIC UALocationServiceSession * ua_location_service_try_create_session_for_low_accuracy(UALocationServiceRequirementsFlags flags, UALocationServiceError *status)
Tries to reate a new session with the location service for low positional accuracy requirements...
UALocationServiceSession
struct UbuntuApplicationLocationServiceSession UALocationServiceSession
Opaque type encapsulating a session with the location service.
Definition: session.h:38
UA_LOCATION_SERVICE_REQUIRE_VELOCITY
Definition: service.h:60
UA_LOCATION_SERVICE_ERROR_NO_CONNECTION
Definition: service.h:78
visibility.h
UbuntuApplicationLocationServiceRequirement
UbuntuApplicationLocationServiceRequirement
Application-specific requirements.
Definition: service.h:56
controller.h
UA_LOCATION_SERVICE_ERROR_NO_ACCESS
Definition: service.h:79
UALocationServiceError
UbuntuApplicationLocationServiceError UALocationServiceError
Definition: service.h:83
UA_LOCATION_SERVICE_ERROR_NONE
Definition: service.h:77
UBUNTU_DLL_PUBLIC
#define UBUNTU_DLL_PUBLIC
Definition: visibility.h:26
ua_location_service_create_controller
UBUNTU_DLL_PUBLIC UALocationServiceController * ua_location_service_create_controller()
Creates a new controller for the location service.
UA_LOCATION_SERVICE_ERROR_GENERIC_ERROR
Definition: service.h:80
UA_LOCATION_SERVICE_REQUIRE_HEADING
Definition: service.h:59
UALocationServiceRequirementsFlags
unsigned int UALocationServiceRequirementsFlags
Bitfield type for summarizing an application's requirements.
Definition: service.h:69
UALocationServiceController
struct UbuntuApplicationLocationServiceController UALocationServiceController
Opaque type encapsulating a controller the location service.
Definition: controller.h:58
UbuntuApplicationLocationServiceError
UbuntuApplicationLocationServiceError
Possible error codes reported when trying to create a session.
Definition: service.h:75