4 * Copyright (c) 2010-2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Youngae Kang <youngae.kang@samsung.com>, Minjune Kim <sena06.kim@samsung.com>
7 * Genie Kim <daejins.kim@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
26 #include "location-log.h"
27 #include "location-ielement.h"
30 location_ielement_base_init (gpointer g_class)
32 static gboolean is_initialized = FALSE;
35 /* add properties and signals to the interface here */
37 is_initialized = TRUE;
42 location_ielement_get_type (void)
44 static GType iface_type = 0;
46 if (iface_type == 0) {
47 static const GTypeInfo info = {
48 sizeof (LocationIElementInterface),
49 location_ielement_base_init, /* base_init */
50 NULL /* base_finalize */
53 iface_type = g_type_register_static (G_TYPE_INTERFACE, "LocationIElement",
61 location_ielement_start (LocationIElement *self)
63 g_return_val_if_fail (LOCATION_IS_IELEMENT (self), LOCATION_ERROR_PARAMETER);
64 g_return_val_if_fail (LOCATION_IELEMENT_GET_INTERFACE (self)->start, LOCATION_ERROR_NOT_AVAILABLE);
65 return LOCATION_IELEMENT_GET_INTERFACE (self)->start (self);
69 location_ielement_stop (LocationIElement *self)
71 g_return_val_if_fail (LOCATION_IS_IELEMENT (self), LOCATION_ERROR_PARAMETER);
72 g_return_val_if_fail (LOCATION_IELEMENT_GET_INTERFACE (self)->stop, LOCATION_ERROR_NOT_AVAILABLE);
73 return LOCATION_IELEMENT_GET_INTERFACE (self)->stop (self);
77 location_ielement_get_position (LocationIElement *self,
78 LocationPosition **position,
79 LocationAccuracy **accuracy)
81 g_return_val_if_fail (LOCATION_IS_IELEMENT (self), LOCATION_ERROR_PARAMETER);
82 g_return_val_if_fail (position, LOCATION_ERROR_PARAMETER);
83 g_return_val_if_fail (accuracy, LOCATION_ERROR_PARAMETER);
84 g_return_val_if_fail (LOCATION_IELEMENT_GET_INTERFACE (self)->get_position, LOCATION_ERROR_NOT_AVAILABLE);
86 return LOCATION_IELEMENT_GET_INTERFACE (self)->get_position (self, position, accuracy);
90 location_ielement_get_position_ext (LocationIElement *self,
91 LocationPosition **position,
92 LocationVelocity **velocity,
93 LocationAccuracy **accuracy)
95 g_return_val_if_fail (LOCATION_IS_IELEMENT (self), LOCATION_ERROR_PARAMETER);
96 g_return_val_if_fail (position, LOCATION_ERROR_PARAMETER);
97 g_return_val_if_fail (velocity, LOCATION_ERROR_PARAMETER);
98 g_return_val_if_fail (accuracy, LOCATION_ERROR_PARAMETER);
99 g_return_val_if_fail (LOCATION_IELEMENT_GET_INTERFACE (self)->get_position_ext, LOCATION_ERROR_NOT_AVAILABLE);
101 return LOCATION_IELEMENT_GET_INTERFACE (self)->get_position_ext (self, position, velocity, accuracy);
106 location_ielement_get_last_position (LocationIElement *self,
107 LocationPosition **position,
108 LocationAccuracy **accuracy)
110 g_return_val_if_fail (LOCATION_IS_IELEMENT (self), LOCATION_ERROR_PARAMETER);
111 g_return_val_if_fail (position, LOCATION_ERROR_PARAMETER);
112 g_return_val_if_fail (accuracy, LOCATION_ERROR_PARAMETER);
113 g_return_val_if_fail (LOCATION_IELEMENT_GET_INTERFACE (self)->get_last_position, LOCATION_ERROR_NOT_AVAILABLE);
115 return LOCATION_IELEMENT_GET_INTERFACE (self)->get_last_position (self, position, accuracy);
119 location_ielement_get_last_position_ext (LocationIElement *self,
120 LocationPosition **position,
121 LocationVelocity **velocity,
122 LocationAccuracy **accuracy)
124 g_return_val_if_fail (LOCATION_IS_IELEMENT (self), LOCATION_ERROR_PARAMETER);
125 g_return_val_if_fail (position, LOCATION_ERROR_PARAMETER);
126 g_return_val_if_fail (velocity, LOCATION_ERROR_PARAMETER);
127 g_return_val_if_fail (accuracy, LOCATION_ERROR_PARAMETER);
128 g_return_val_if_fail (LOCATION_IELEMENT_GET_INTERFACE (self)->get_last_position_ext, LOCATION_ERROR_NOT_AVAILABLE);
130 return LOCATION_IELEMENT_GET_INTERFACE (self)->get_last_position_ext (self, position, velocity, accuracy);
135 location_ielement_get_satellite (LocationIElement *self,
136 LocationSatellite **satellite)
138 g_return_val_if_fail (LOCATION_IS_IELEMENT (self), LOCATION_ERROR_PARAMETER);
139 g_return_val_if_fail (satellite, LOCATION_ERROR_PARAMETER);
140 g_return_val_if_fail (LOCATION_IELEMENT_GET_INTERFACE (self)->get_satellite, LOCATION_ERROR_NOT_AVAILABLE);
142 return LOCATION_IELEMENT_GET_INTERFACE (self)->get_satellite (self, satellite);
146 location_ielement_get_last_satellite (LocationIElement *self,
147 LocationSatellite **satellite)
149 g_return_val_if_fail (LOCATION_IS_IELEMENT (self), LOCATION_ERROR_PARAMETER);
150 g_return_val_if_fail (satellite, LOCATION_ERROR_PARAMETER);
151 g_return_val_if_fail (LOCATION_IELEMENT_GET_INTERFACE (self)->get_last_satellite, LOCATION_ERROR_NOT_AVAILABLE);
153 return LOCATION_IELEMENT_GET_INTERFACE (self)->get_last_satellite (self, satellite);
158 location_ielement_get_velocity (LocationIElement *self,
159 LocationVelocity **velocity,
160 LocationAccuracy **accuracy)
162 g_return_val_if_fail (LOCATION_IS_IELEMENT (self), LOCATION_ERROR_PARAMETER);
163 g_return_val_if_fail (velocity, LOCATION_ERROR_PARAMETER);
164 g_return_val_if_fail (LOCATION_IELEMENT_GET_INTERFACE (self)->get_velocity, LOCATION_ERROR_NOT_AVAILABLE);
165 return LOCATION_IELEMENT_GET_INTERFACE (self)->get_velocity (self, velocity, accuracy);
169 location_ielement_get_last_velocity (LocationIElement *self,
170 LocationVelocity **velocity,
171 LocationAccuracy **accuracy)
173 g_return_val_if_fail (LOCATION_IS_IELEMENT (self), LOCATION_ERROR_PARAMETER);
174 g_return_val_if_fail (velocity, LOCATION_ERROR_PARAMETER);
175 g_return_val_if_fail (LOCATION_IELEMENT_GET_INTERFACE (self)->get_last_velocity, LOCATION_ERROR_NOT_AVAILABLE);
176 return LOCATION_IELEMENT_GET_INTERFACE (self)->get_last_velocity (self, velocity, accuracy);