4 * Copyright (c) 2010-2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and "1
16 * limitations under the License.
19 #ifndef __LOCATION_SETTING_H__
20 #define __LOCATION_SETTING_H__
24 #include <vconf-internal-location-keys.h>
27 * @file location-setting.h
28 * @brief This file contains the definitions and functions for setting.
31 #define LOCATION_UPDATE_INTERVAL_NONE 0
32 #define LOCATION_UPDATE_INTERVAL_MIN 1
33 #define LOCATION_UPDATE_INTERVAL_MAX 120
34 #define LOCATION_UPDATE_INTERVAL_DEFAULT LOCATION_UPDATE_INTERVAL_MIN
35 #define LOCATION_BATCH_INTERVAL_MAX 255
36 #define LOCATION_BATCH_PERIOD_MIN 1
37 #define LOCATION_BATCH_PERIOD_MAX 60000
38 #define LOCATION_BATCH_PERIOD_DEFAULT 150
39 #define LOCATION_MIN_INTERVAL_MIN 1
40 #define LOCATION_MIN_INTERVAL_MAX 120
41 #define LOCATION_MIN_INTERVAL_DEFAULT LOCATION_MIN_INTERVAL_MIN
42 #define LOCATION_MIN_DISTANCE_MIN 1.0
43 #define LOCATION_MIN_DISTANCE_MAX 120.0
44 #define LOCATION_MIN_DISTANCE_DEFAULT LOCATION_MIN_DISTANCE_MIN
46 typedef void (*SettingCB)(keynode_t *key, gpointer data);
49 gint location_setting_get_key_val(keynode_t *key);
50 gint location_setting_get_int(const gchar *path);
51 gboolean location_setting_get_bool(const gchar *path);
52 gint location_setting_add_notify(const gchar *path, SettingCB setting_cb, gpointer self);
53 gint location_setting_ignore_notify(const gchar *path, SettingCB setting_cb);
54 gint location_state_add_notify(const gchar *path, SettingCB setting_cb, gpointer self);
55 gint location_state_ignore_notify(const gchar *path, SettingCB setting_cb);
58 #define setting_retval_if_fail(path) {\
59 int val = location_setting_get_int(path);\
61 return LOCATION_ERROR_UNKNOWN;\
62 } else if (val == 0) {\
63 return LOCATION_ERROR_SETTING_OFF;\
67 #endif /* __LOCATION_SETTING_H__ */