e914e4da1515f3f45cbb19c07f056c4c78309574
[platform/core/location/lbs-location.git] / location / manager / location-ielement.h
1 /*
2  * libslp-location
3  *
4  * Copyright (c) 2010-2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #ifndef __LOCATION_IELEMENT_H__
20 #define __LOCATION_IELEMENT_H__
21
22 #include <glib-object.h>
23 #include <location-types.h>
24 #include <location-position.h>
25 #include <location-batch.h>
26 #include <location-velocity.h>
27 #include <location-accuracy.h>
28 #include <location-boundary.h>
29 #include <location-satellite.h>
30
31 /**
32  * @file location-ielement.h
33  * @brief This file contains the internal definitions and structures related to location interface.
34  */
35
36 G_BEGIN_DECLS
37
38 typedef struct _LocationIElement                        LocationIElement;
39 typedef struct _LocationIElementInterface       LocationIElementInterface;
40
41 #define LOCATION_TYPE_IELEMENT                                  (location_ielement_get_type())
42 #define LOCATION_IELEMENT(obj)                                  (G_TYPE_CHECK_INSTANCE_CAST((obj), LOCATION_TYPE_IELEMENT, LocationIElement))
43 #define LOCATION_IS_IELEMENT(obj)                               (G_TYPE_CHECK_INSTANCE_TYPE((obj), LOCATION_TYPE_IELEMENT))
44 #define LOCATION_IELEMENT_GET_INTERFACE(obj)    (G_TYPE_INSTANCE_GET_INTERFACE((obj), LOCATION_TYPE_IELEMENT, LocationIElementInterface))
45
46 enum {
47         SERVICE_ENABLED,
48         SERVICE_DISABLED,
49         SERVICE_UPDATED,
50         ZONE_IN,
51         ZONE_OUT,
52         LOCATION_UPDATED,
53         BATCH_UPDATED,
54         STATUS_CHANGED,
55         LAST_SIGNAL,
56 };
57
58 typedef int (*TYPE_START_FUNC)(LocationIElement *self);
59 typedef int (*TYPE_STOP_FUNC)(LocationIElement *self);
60 typedef int (*TYPE_GET_POSITION)(LocationIElement *self, LocationPosition **position, LocationAccuracy **accuracy);
61 typedef int (*TYPE_GET_POSITION_EXT)(LocationIElement *self, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy);
62 typedef int (*TYPE_GET_VELOCITY)(LocationIElement *self, LocationVelocity **velocity, LocationAccuracy **accuracy);
63 typedef int (*TYPE_GET_SATELLITE)(LocationIElement *self, LocationSatellite **satellite);
64 typedef int (*TYPE_SET_OPTION)(LocationIElement *self, const char *option);
65 typedef int (*TYPE_REQUEST_SINGLE_LOCATION)(LocationIElement *self, int timeout);
66 typedef int (*TYPE_CANCEL_SINGLE_LOCATION)(LocationIElement *self);
67 typedef int (*TYPE_GET_BATCH)(LocationIElement *self, LocationBatch **batch);
68 typedef int (*TYPE_START_BATCH)(LocationIElement *self);
69 typedef int (*TYPE_STOP_BATCH)(LocationIElement *self);
70 typedef int (*TYPE_GET_NMEA)(LocationIElement *self, char **nmea);
71
72 /* Tizen 3.0 */
73 typedef int (*TYPE_SET_MOCK_LOCATION)(LocationIElement *self, const LocationPosition *position, const LocationVelocity *velocity, const LocationAccuracy *accuracy);
74 typedef int (*TYPE_CLEAR_MOCK_LOCATION)(LocationIElement *self);
75
76 struct _LocationIElementInterface {
77         GTypeInterface parent_iface;
78
79         TYPE_START_FUNC start;
80         TYPE_STOP_FUNC stop;
81         TYPE_GET_POSITION get_position;
82         TYPE_GET_POSITION_EXT get_position_ext;
83         TYPE_GET_POSITION get_last_position;
84         TYPE_GET_POSITION_EXT get_last_position_ext;
85         TYPE_GET_VELOCITY get_velocity;
86         TYPE_GET_VELOCITY get_last_velocity;
87         TYPE_GET_SATELLITE get_satellite;
88         TYPE_GET_SATELLITE get_last_satellite;
89         TYPE_SET_OPTION set_option;
90         TYPE_REQUEST_SINGLE_LOCATION request_single_location;
91         TYPE_CANCEL_SINGLE_LOCATION cancel_single_location;
92         TYPE_GET_BATCH get_batch;
93         TYPE_START_BATCH start_batch;
94         TYPE_STOP_BATCH stop_batch;
95         TYPE_GET_NMEA get_nmea;
96
97         /* Tizen 3.0 */
98         TYPE_SET_MOCK_LOCATION set_mock_location;
99         TYPE_CLEAR_MOCK_LOCATION clear_mock_location;
100 };
101
102 GType location_ielement_get_type(void);
103
104 int location_ielement_start(LocationIElement *self);
105 int location_ielement_stop(LocationIElement *self);
106 int location_ielement_get_position(LocationIElement *self, LocationPosition **position, LocationAccuracy **accuracy);
107 int location_ielement_get_position_ext(LocationIElement *self, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy);
108 int location_ielement_get_last_position(LocationIElement *self, LocationPosition **position, LocationAccuracy **accuracy);
109 int location_ielement_get_last_position_ext(LocationIElement *self, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy);
110 int location_ielement_get_velocity(LocationIElement *self, LocationVelocity **velocity, LocationAccuracy **accuracy);
111 int location_ielement_get_last_velocity(LocationIElement *self, LocationVelocity **velocity, LocationAccuracy **accuracy);
112 int location_ielement_get_satellite(LocationIElement *self, LocationSatellite **satellite);
113 int location_ielement_get_last_satellite(LocationIElement *self, LocationSatellite **satellite);
114 int location_ielement_set_option(LocationIElement *self, const char *option);
115 int location_ielement_request_single_location(LocationIElement *self, int timeout);
116 int location_ielement_cancel_single_location(LocationIElement *self);
117 int location_ielement_get_batch(LocationIElement *self, LocationBatch **batch);
118 int location_ielement_start_batch(LocationIElement *self);
119 int location_ielement_stop_batch(LocationIElement *self);
120 int location_ielement_get_nmea(LocationIElement *self, char **nmea);
121
122 /* Tizen 3.0 */
123 int location_ielement_set_mock_location(LocationIElement *self, const LocationPosition *position, const LocationVelocity *velocity, const LocationAccuracy *accuracy);
124 int location_ielement_clear_mock_location(LocationIElement *self);
125
126 G_END_DECLS
127
128 #endif