2 * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_LOCATION_INTERNAL_H__
18 #define __TIZEN_LOCATION_INTERNAL_H__
21 #include <locations.h>
31 #define LOG_TAG "CAPI_LOCATION_MANAGER"
37 #define LOCATIONS_LOGD(fmt, args...) LOGD(fmt, ##args)
38 #define LOCATIONS_LOGW(fmt, args...) LOGW(fmt, ##args)
39 #define LOCATIONS_LOGI(fmt, args...) LOGI(fmt, ##args)
40 #define LOCATIONS_LOGE(fmt, args...) LOGE(fmt, ##args)
42 #define LOCATIONS_CHECK_CONDITION(condition, error, msg) \
46 LOCATIONS_LOGE("%s(0x%08x)", msg, error); \
52 #define LOCATIONS_PRINT_ERROR_CODE(error, msg) \
54 LOCATIONS_LOGE("%s(0x%08x)", msg, error); \
58 #define LOCATIONS_NULL_ARG_CHECK(arg) \
59 LOCATIONS_CHECK_CONDITION((arg != NULL), LOCATION_BOUNDS_ERROR_INVALID_PARAMETER, "LOCATION_BOUNDS_ERROR_INVALID_PARAMETER") \
61 #define LOCATIONS_NOT_SUPPORTED_CHECK(arg) \
62 LOCATIONS_CHECK_CONDITION((arg == LOCATIONS_ERROR_NONE), LOCATIONS_ERROR_NOT_SUPPORTED, "LOCATIONS_ERROR_NOT_SUPPORTED") \
65 _LOCATIONS_EVENT_TYPE_SERVICE_STATE,
66 _LOCATIONS_EVENT_TYPE_POSITION,
67 _LOCATIONS_EVENT_TYPE_VELOCITY,
68 _LOCATIONS_EVENT_TYPE_BOUNDARY,
69 _LOCATIONS_EVENT_TYPE_SATELLITE,
70 _LOCATIONS_EVENT_TYPE_FOREACH_BOUNDS,
71 _LOCATIONS_EVENT_TYPE_COLLECTION_STATE,
72 _LOCATIONS_EVENT_TYPE_LOCATION,
73 _LOCATIONS_EVENT_TYPE_BATCH,
74 _LOCATIONS_EVENT_TYPE_DISTANCE,
75 _LOCATIONS_EVENT_TYPE_POS_VEL,
76 _LOCATIONS_EVENT_TYPE_NUM
80 _LOCATION_SIGNAL_SERVICE_ENABLED,
81 _LOCATION_SIGNAL_SERVICE_DISABLED,
82 _LOCATION_SIGNAL_SERVICE_UPDATED,
83 _LOCATION_SIGNAL_ZONE_IN,
84 _LOCATION_SIGNAL_ZONE_OUT,
85 _LOCATION_SIGNAL_LOCATION_UPDATED,
86 _LOCATION_SIGNAL_BATCH_UPDATED,
87 _LOCATION_SIGNAL_ERROR_EMITTED,
88 _LOCATION_SIGNAL_STATUS_CHANGED,
92 typedef struct _location_manager_s {
93 LocationObject *object;
94 const void *user_cb[_LOCATIONS_EVENT_TYPE_NUM];
95 void *user_data[_LOCATIONS_EVENT_TYPE_NUM];
96 location_method_e method;
97 bool is_continue_foreach_bounds;
101 gulong sig_id[_LOCATION_SIGNAL_NUM];
102 } location_manager_s;
104 typedef struct _location_bounds_s {
105 LocationBoundary *boundary;
111 typedef struct _location_setting_changed_s {
112 location_setting_changed_cb callback;
114 } location_setting_changed_s;
119 int __convert_error_code(int code);
120 int __is_gps_supported(void);
121 int __is_gps_satellite_supported(void);
122 int __is_wps_supported(void);
123 int __is_batch_supported(void);
124 int __is_location_supported(void);
125 int __set_callback(_location_event_e type, location_manager_h manager, void *callback, void *user_data);
126 int __unset_callback(_location_event_e type, location_manager_h manager);
132 #endif /* __TIZEN_LOCATION_INTERNAL_H__ */