tizen 2.3 release
[external/buxton.git] / src / shared / configurator.h
1 /*
2  * This file is part of buxton.
3  *
4  * Copyright (C) 2013 Intel Corporation
5  *
6  * buxton is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as
8  * published by the Free Software Foundation; either version 2.1
9  * of the License, or (at your option) any later version.
10  */
11
12 /**
13  * \file configurator.h Internal header
14  * This file is used internally by buxton to provide functionality
15  * used to handle the configuration
16  */
17 #pragma once
18
19 #ifdef HAVE_CONFIG_H
20         #include "config.h"
21 #endif
22
23 typedef enum ConfigKey {
24         CONFIG_MIN = 0,
25         CONFIG_CONF_FILE,
26         CONFIG_MODULE_DIR,
27         CONFIG_DB_PATH,
28         CONFIG_SMACK_LOAD_FILE,
29         CONFIG_BUXTON_SOCKET,
30         CONFIG_MAX
31 } ConfigKey;
32
33 /**
34  * Slightly duplicative of BuxtonLayer, but defined here instead of
35  * there. This will probably be deprecated for BuxtonLayer once
36  * things are integrated.
37  */
38 typedef struct ConfigLayer {
39         char *name;
40         char *type;
41         char *backend;
42         char *description;
43         char *access;
44         int priority;
45 } ConfigLayer;
46
47 /**
48  * @internal
49  * @brief Add command line data
50  *
51  * @note This API is draft
52  */
53 void buxton_add_cmd_line(ConfigKey confkey, char* data);
54
55 /**
56  * @internal
57  * @brief Get the directory of plugin modules
58  *
59  * @return the path to the plugin module. Do not free this pointer.
60  * It belongs to configurator.
61  */
62 const char *buxton_module_dir(void)
63         __attribute__((warn_unused_result));
64
65 /**
66  * @internal
67  * @brief Get the path of the config file
68  *
69  * @return the path of the config file. Do not free this pointer.
70  * It belongs to configurator.
71  */
72 const char *buxton_conf_file(void)
73         __attribute__((warn_unused_result));
74
75 /**
76  * @internal
77  * @brief Get the path of the buxton database
78  *
79  *
80  * @return the path of the database file. Do not free this pointer.
81  * It belongs to configurator.
82  */
83 const char *buxton_db_path(void)
84         __attribute__((warn_unused_result));
85
86 /**
87  * @internal
88  * @brief Get the path of the smack load file.
89  *
90  *
91  * @return the path of the smack load file. Do not free this pointer.
92  * It belongs to configurator.
93  */
94 const char *buxton_smack_load_file(void)
95         __attribute__((warn_unused_result));
96
97 /**
98  * @internal
99  * @brief Get the path of the buxton socket.
100  *
101  *
102  * @return the path of the buxton socket. Do not free this pointer.
103  * It belongs to configurator.
104  */
105 const char *buxton_socket(void)
106         __attribute__((warn_unused_result));
107
108 /**
109  * @internal
110  * @brief Get an array of ConfigLayers from the conf file
111  *
112  * @param layers pointer to a pointer where the array of ConfigLayers
113  * will be stored. Callers should free this pointer with free when
114  * they are done with it.
115  *
116  * @return an integer that indicates the number of layers.
117  */
118 int buxton_key_get_layers(ConfigLayer **layers)
119         __attribute__((warn_unused_result));
120
121 void include_configurator(void);
122
123 /*
124  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
125  *
126  * Local variables:
127  * c-basic-offset: 8
128  * tab-width: 8
129  * indent-tabs-mode: t
130  * End:
131  *
132  * vi: set shiftwidth=8 tabstop=8 noexpandtab:
133  * :indentSize=8:tabSize=8:noTabs=false:
134  */