2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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 __CONTEXT_PLACE_MYPLACE_HANDLE_H__
18 #define __CONTEXT_PLACE_MYPLACE_HANDLE_H__
23 #include <geofence_manager.h>
27 class myplace_handle {
29 typedef std::map<int, geofence_state_e> geo_state_map_t;
30 typedef std::set<std::string> string_set_t;
36 bool start_monitor(int place_id);
37 void add_zone(const char* zone);
38 void remove_zone(const char* zone);
45 geofence_state_e prev_state;
46 geofence_manager_h geo_handle;
47 geo_state_map_t geo_state_map;
49 void emit_state_change();
51 bool start_fence(int fence_id);
52 void remove_fence(int fence_id);
53 void update_fence(int fence_id, geofence_manage_e manage);
54 void update_state(int fence_id, geofence_state_e state);
56 static bool fence_list_cb(int geofence_id, geofence_h fence, int fence_index, int fence_cnt, void* user_data);
57 static void fence_event_cb(int place_id, int geofence_id, geofence_manager_error_e error, geofence_manage_e manage, void* user_data);
58 static void fence_state_cb(int geofence_id, geofence_state_e state, void* user_data);
63 #endif /* __CONTEXT_PLACE_MYPLACE_HANDLE_H__ */