Clean spec file for yocto complaince.
[platform/core/api/location-manager.git] / include / locations_private.h
1 /*
2  * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef __TIZEN_LOCATION_LOCATIONS_PRIVATE_H__
18 #define __TIZEN_LOCATION_LOCATIONS_PRIVATE_H__
19
20 #include <location/location.h>
21 #include <locations.h>
22 #include <dlog.h>
23
24 #ifdef LOG_TAG
25 #undef LOG_TAG
26 #endif
27 #define LOG_TAG "CAPI_LOCATION_MANAGER"
28
29 /*
30 * Internal Macros
31 */
32 #define LOCATIONS_LOGD(fmt,args...)  LOGD(fmt, ##args)
33 #define LOCATIONS_LOGW(fmt,args...)  LOGW(fmt, ##args)
34 #define LOCATIONS_LOGI(fmt,args...)  LOGI(fmt, ##args)
35 #define LOCATIONS_LOGE(fmt,args...)  LOGE(fmt, ##args)
36
37 #define LOCATIONS_CHECK_CONDITION(condition, error, msg)        \
38                 do { \
39                         if (condition) { \
40                         } else { \
41                                 LOCATIONS_LOGE("%s(0x%08x)", msg, error); \
42                                 return error; \
43                         } \
44                 } while (0)
45
46
47 #define LOCATIONS_PRINT_ERROR_CODE(error, msg)  \
48                 do { \
49                         LOCATIONS_LOGE("%s(0x%08x)", msg, error); \
50                         return error; \
51                 } while (0)
52
53
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57
58 typedef enum {
59         _LOCATIONS_EVENT_TYPE_SERVICE_STATE,
60         _LOCATIONS_EVENT_TYPE_POSITION,
61         _LOCATIONS_EVENT_TYPE_VELOCITY,
62         _LOCATIONS_EVENT_TYPE_BOUNDARY,
63         _LOCATIONS_EVENT_TYPE_SATELLITE,
64         _LOCATIONS_EVENT_TYPE_FOREACH_BOUNDS,
65         _LOCATIONS_EVENT_TYPE_NUM
66 } _location_event_e;
67
68 typedef enum {
69         _LOCATION_SIGNAL_SERVICE_ENABLED,
70         _LOCATION_SIGNAL_SERVICE_DISABLED,
71         _LOCATION_SIGNAL_SERVICE_UPDATED,
72         _LOCATION_SIGNAL_ZONE_IN,
73         _LOCATION_SIGNAL_ZONE_OUT,
74         _LOCATION_SIGNAL_NUM
75 } _location_signal_e;
76
77 typedef struct _location_manager_s {
78         LocationObject* object;
79         const void* user_cb[_LOCATIONS_EVENT_TYPE_NUM];
80         void* user_data[_LOCATIONS_EVENT_TYPE_NUM];
81         location_method_e method;
82         bool is_continue_foreach_bounds;
83         GList *bounds_list;
84         gulong sig_id[_LOCATION_SIGNAL_NUM];
85 } location_manager_s;
86
87 typedef struct _location_bounds_s {
88         LocationBoundary* boundary;
89         const void* user_cb;
90         void* user_data;
91         bool is_added;
92 } location_bounds_s;
93 #ifdef __cplusplus
94 }
95 #endif
96
97 #endif //__TIZEN_LOCATION_LOCATIONS_PRIVATE_H__