controller.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_CONTROLLER_H_
#define UBUNTU_APPLICATION_LOCATION_SERVICE_CONTROLLER_H_
#include <ubuntu/status.h>
#include <ubuntu/visibility.h>
#ifdef __cplusplus
extern "C"
{
#endif
typedef enum
{
UA_LOCATION_SERVICE_ENABLED = 1 << 0,
UA_LOCATION_SERVICE_DISABLED = 1 << 1,
UA_LOCATION_SERVICE_GPS_ENABLED = 1 << 2,
UA_LOCATION_SERVICE_GPS_DISABLED = 1 << 3,
} UbuntuApplicationLocationServiceStatus;
typedef UbuntuApplicationLocationServiceStatus UALocationServiceStatus;
typedef unsigned int UALocationServiceStatusFlags;
typedef void (*UALocationServiceStatusChangedHandler)(
UALocationServiceStatusFlags flags,
void *context);
typedef struct UbuntuApplicationLocationServiceController UALocationServiceController;
UBUNTU_DLL_PUBLIC void
ua_location_service_controller_ref(
UALocationServiceController *controller);
UBUNTU_DLL_PUBLIC void
ua_location_service_controller_unref(
UALocationServiceController *controller);
UBUNTU_DLL_PUBLIC void
ua_location_service_controller_set_status_changed_handler(
UALocationServiceController *controller,
UALocationServiceStatusChangedHandler handler,
void *context);
UBUNTU_DLL_PUBLIC UStatus
ua_location_service_controller_query_status(
UALocationServiceController *controller,
UALocationServiceStatusFlags *out_flags);
UBUNTU_DLL_PUBLIC UStatus
ua_location_service_controller_enable_service(
UALocationServiceController *controller);
UBUNTU_DLL_PUBLIC UStatus
ua_location_service_controller_disable_service(
UALocationServiceController *controller);
UBUNTU_DLL_PUBLIC UStatus
ua_location_service_controller_enable_gps(
UALocationServiceController *controller);
UBUNTU_DLL_PUBLIC UStatus
ua_location_service_controller_disable_gps(
UALocationServiceController *controller);
#ifdef __cplusplus
}
#endif
#endif // UBUNTU_APPLICATION_LOCATION_SERVICE_CONTROLLER_H_
UA_LOCATION_SERVICE_GPS_ENABLED
Definition: controller.h:38
UbuntuStatus
UbuntuStatus
Indicates the status of an operation.
Definition: status.h:26
UALocationServiceStatusFlags
unsigned int UALocationServiceStatusFlags
Definition: controller.h:44
UALocationServiceStatus
UbuntuApplicationLocationServiceStatus UALocationServiceStatus
Definition: controller.h:42
ua_location_service_controller_disable_service
UBUNTU_DLL_PUBLIC UStatus ua_location_service_controller_disable_service(UALocationServiceController *controller)
Disables the location service completely.
UA_LOCATION_SERVICE_DISABLED
Definition: controller.h:37
UA_LOCATION_SERVICE_ENABLED
Definition: controller.h:36
ua_location_service_controller_set_status_changed_handler
UBUNTU_DLL_PUBLIC void ua_location_service_controller_set_status_changed_handler(UALocationServiceController *controller, UALocationServiceStatusChangedHandler handler, void *context)
Sets the status changed handler of the controller instance.
visibility.h
ua_location_service_controller_query_status
UBUNTU_DLL_PUBLIC UStatus ua_location_service_controller_query_status(UALocationServiceController *controller, UALocationServiceStatusFlags *out_flags)
Query the status of the location service.
ua_location_service_controller_enable_gps
UBUNTU_DLL_PUBLIC UStatus ua_location_service_controller_enable_gps(UALocationServiceController *controller)
Enables all gps providers known to the location service.
ua_location_service_controller_enable_service
UBUNTU_DLL_PUBLIC UStatus ua_location_service_controller_enable_service(UALocationServiceController *controller)
Enables the location service.
UALocationServiceStatusChangedHandler
void(* UALocationServiceStatusChangedHandler)(UALocationServiceStatusFlags flags, void *context)
Callback type that is invoked when the location service status changes.
Definition: controller.h:50
ua_location_service_controller_ref
UBUNTU_DLL_PUBLIC void ua_location_service_controller_ref(UALocationServiceController *controller)
Increments the reference count of the controller instance.
status.h
UBUNTU_DLL_PUBLIC
#define UBUNTU_DLL_PUBLIC
Definition: visibility.h:26
ua_location_service_controller_disable_gps
UBUNTU_DLL_PUBLIC UStatus ua_location_service_controller_disable_gps(UALocationServiceController *controller)
Disables all gps providers known to the location service.
UALocationServiceController
struct UbuntuApplicationLocationServiceController UALocationServiceController
Opaque type encapsulating a controller the location service.
Definition: controller.h:58
ua_location_service_controller_unref
UBUNTU_DLL_PUBLIC void ua_location_service_controller_unref(UALocationServiceController *controller)
Decrements the reference count of the controller instance.
UA_LOCATION_SERVICE_GPS_DISABLED
Definition: controller.h:39
UbuntuApplicationLocationServiceStatus
UbuntuApplicationLocationServiceStatus
Location service status.
Definition: controller.h:34