Updating INI configuration file to work with most cameras.
[profile/ivi/camera.git] / include / cam_config.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.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
7  *
8  *        http://www.tizenopensource.org/license
9  *
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.
15  */
16
17 #ifndef _CAM_CONFIG_H_
18 #define _CAM_CONFIG_H_
19
20 #include <glib.h>
21 /*
22 #include "cam_property.h"
23 */
24 #define CONFIG_PATH                                                     "/opt/apps/org.tizen.camera-app/data/.camera.ini"
25
26 #define EXTERNAL_MODE_SAVE_PATH                 "/tmp"
27
28 typedef enum {
29         CAM_CONFIG_TYPE_COMMON = 0,
30         CAM_CONFIG_TYPE_PREVIEW,
31         CAM_CONFIG_MAX,
32 } CamConfigType;
33
34 gboolean
35 cam_config_set_group_name(CamConfigType config_type,
36                           const gchar *set_group_name);
37
38 gboolean cam_config_init(GError **error);
39
40 void cam_config_finalize(void);
41
42 void cam_config_set_group(const gchar *group_name);
43
44 const gchar *cam_config_get_group(void);
45
46 void cam_config_save(void);
47
48 void cam_config_set_control(gboolean enable);
49
50 void cam_config_set_control(gboolean enable);
51
52 void cam_config_set_int(const gchar *key, int nval);
53
54 void cam_config_set_string(const gchar *key, const gchar *strval);
55
56 void cam_config_set_boolean(const gchar *key, gboolean bval);
57
58 int cam_config_get_int(const gchar *key, int default_value);
59
60 gchar *cam_config_get_string(const gchar *key, const gchar *default_value);
61
62 gboolean cam_config_get_boolean(const gchar *key, gboolean default_value);
63
64 void cam_config_set_int_by_type(CamConfigType config_type, const gchar *key,
65                                 int nval);
66
67 void cam_config_set_string_by_type(CamConfigType config_type, const gchar *key,
68                                    const gchar *strval);
69
70 void cam_config_set_boolean_by_type(CamConfigType config_type,
71                                     const gchar *key, gboolean bval);
72
73 int cam_config_get_int_by_type(CamConfigType config_type, const gchar *key,
74                                int default_value);
75
76 gchar *cam_config_get_string_by_type(CamConfigType config_type,
77                                      const gchar *key,
78                                      const gchar *default_value);
79
80 gboolean cam_config_get_boolean_by_type(CamConfigType config_type,
81                                         const gchar *key,
82                                         gboolean default_value);
83
84 #endif                          /* _CAM_CONFIG_H_ */