4 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Youngae Kang <youngae.kang@samsung.com>, Yunhan Kim <yhan.kim@samsung.com>,
7 * Genie Kim <daejins.kim@samsung.com>, Minjune Kim <sena06.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.
22 #ifndef __LOCATION_SETTING_H__
23 #define __LOCATION_SETTING_H__
27 #include <vconf-keys.h>
30 * @file location-setting.h
31 * @brief This file contains the definitions and functions for setting.
34 #define VCONF_LOCATION_PATH "db/location"
36 #define GPS_ENABLED VCONFKEY_LOCATION_ENABLED
37 #define LOCATION_SETTING_PATH VCONF_LOCATION_PATH"/setting"
38 #define AGPS_ENABLED LOCATION_SETTING_PATH"/AgpsEnabled"
39 #define NETWORK_ENABLED LOCATION_SETTING_PATH"/NetworkEnabled"
40 #define SENSOR_ENABLED LOCATION_SETTING_PATH"/SensorEnabled"
42 #define LOCATION_UPDATE_INTERVAL_MIN 1
43 #define LOCATION_UPDATE_INTERVAL_MAX 120
44 #define LOCATION_UPDATE_INTERVAL_DEFAULT LOCATION_UPDATE_INTERVAL_MIN
46 typedef void (*SettingCB)(keynode_t *key, gpointer data);
48 gint location_setting_get_key_val(keynode_t *key);
49 gint location_setting_get_int(const gchar* path);
50 gchar *location_setting_get_string(const gchar* path);
51 gint location_setting_add_notify(const gchar* path, SettingCB setting_cb, gpointer self);
52 gint location_setting_ignore_notify(const gchar* path, SettingCB setting_cb);
54 #define setting_retval_if_fail(path) {\
55 if(!location_setting_get_int(path)){\
56 return LOCATION_ERROR_NOT_ALLOWED;\
60 #define setting_ret_if_fail(path) {\
61 if(!location_setting_get_int(path)){\