tizen 2.3 release
[framework/system/deviced.git] / src / core / buxton-helper.h
1 /*
2  * deviced
3  *
4  * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved.
5  *
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
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
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
16  * limitations under the License.
17  *
18  */
19
20 /*
21  * @file buxton-helper.h
22  *
23  * @desc Helper function for simplification of using and
24  * for looking like vconf interface
25  *
26  *
27  * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved.
28  *
29  */
30
31 #ifndef __DEVICED_BUXTON_HELPER_H
32 #define __DEVICED_BUXTON_HELPER_H
33
34 #include <buxton.h>
35
36 #define BUXTON_DEVICED_LAYER "base"
37 #define BUXTON_DEVICED_SYSTEM_GROUP "deviced_system"
38 #define BUXTON_DEVICED_APPS_GROUP "deviced_apps"
39
40 /* This enum duplicates BuxtonDataType */
41 typedef enum conf_data_type {
42         CONF_TYPE_MIN,
43         CONF_STRING, /**<Represents type of a string value */
44         CONF_INT32, /**<Represents type of an int32_t value */
45         CONF_UINT32, /**<Represents type of an uint32_t value */
46         CONF_INT64, /**<Represents type of a int64_t value */
47         CONF_UINT64, /**<Represents type of a uint64_t value */
48         CONF_FLOAT, /**<Represents type of a float value */
49         CONF_DOUBLE, /**<Represents type of a double value */
50         CONF_BOOLEAN, /**<Represents type of a boolean value */
51         CONF_TYPE_MAX
52 } conf_data_type;
53
54 struct buxton_variant {
55         union {
56                 char *string_value;
57                 int32_t int32_value;
58                 uint32_t uint32_value;
59                 int64_t int64_value;
60                 uint64_t uint64_value;
61                 float float_value;
62                 double double_value;
63                 bool bool_value;
64         };
65         conf_data_type type;
66 };
67
68 int buxton_get_var(char *layer_name, char *group_name, char *key_name,
69         struct buxton_variant *value);
70
71 int buxton_set_var(char *layer_name, char *group_name, char *key_name,
72         struct buxton_variant *value);
73
74 #endif /* __DEVICED_BUXTON_HELPER_H */
75