b938af01a68e7bdfb777d660ba502a7d2030bd47
[framework/location/gps-manager.git] / gps-manager / setting.h
1 /*
2  * gps-manager
3  *
4  * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
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>
8  *
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
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
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.
20  */
21
22 #ifndef _GPS_MANAGER_SETTING_H_
23 #define _GPS_MANAGER_SETTING_H_
24
25 #include <vconf.h>
26 #include <vconf-keys.h>
27
28 #define VCONFKEY_WPS_STATE      "memory/wps/state"
29
30 #define LOCATION_SETTING_PATH   "db/location"
31
32 #define GPS_SETTING             LOCATION_SETTING_PATH"/gps"
33 #define GPS_OPERATION           GPS_SETTING"/Operation"
34 #define GPS_STARTING            GPS_SETTING"/Starting"
35 #define GPS_SESSION             GPS_SETTING"/Session"
36
37 #define SUPL_SETTING            LOCATION_SETTING_PATH"/supl"
38 #define SUPL_SERVER             SUPL_SETTING"/Server"
39 #define SUPL_PORT               SUPL_SETTING"/Port"
40 #define SUPL_SSL                SUPL_SETTING"/SslEnabled"
41
42 #define NMEA_SETTING            LOCATION_SETTING_PATH"/nmea"
43 #define NMEA_LOGGING            NMEA_SETTING"/LoggingEnabled"
44
45 #define REPLAY_SETTING          LOCATION_SETTING_PATH"/replay"
46 #define REPLAY_ENABLED          REPLAY_SETTING"/ReplayEnabled"
47
48 #define LAST_POSITION           LOCATION_SETTING_PATH"/last"
49 #define METHOD_GPS              LAST_POSITION"/gps"
50
51 #define LAST_TIMESTAMP          METHOD_GPS"/Timestamp"
52 #define LAST_LATITUDE           METHOD_GPS"/Latitude"
53 #define LAST_LONGITUDE          METHOD_GPS"/Longitude"
54 #define LAST_ALTITUDE           METHOD_GPS"/Altitude"
55 #define LAST_SPEED              METHOD_GPS"/Speed"
56 #define LAST_DIRECTION          METHOD_GPS"/Direction"
57 #define LAST_HOR_ACCURACY       METHOD_GPS"/HorAccuracy"
58 #define LAST_VER_ACCURACY       METHOD_GPS"/VerAccuracy"
59
60 typedef enum {
61         POSITION_OFF = 0,
62         POSITION_SEARCHING,
63         POSITION_CONNECTED,
64         POSITION_MAX
65 } pos_state_t;
66
67 int setting_set_int(const char *path, int val);
68 int setting_get_int(const char *path, int *val);
69 int setting_set_double(const char *path, double val);
70 int setting_get_double(const char *path, double *val);
71 int setting_set_string(const char *path, const char *val);
72 char *setting_get_string(const char *path);
73
74 typedef void (*key_changed_cb) (keynode_t * key, void *data);
75
76 int setting_notify_key_changed(const char *path, void *key_changed_cb);
77 int setting_ignore_key_changed(const char *path, void *key_changed_cb);
78 #endif                          /* _GPS_MANAGER_SETTING_H_ */