summaryrefslogtreecommitdiff
path: root/src/lib/database.h
blob: 45fdcf748ceb87d1ebb9fe0c361bb013b079adca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257

#ifndef _DATABASE_H
#define _DATABASE_H
#include <Eo.h>
#include <Eina.h>

/* Temproraey declared here. */
Eina_List*
eo_class_mro_get(const char *);

/* Types to define whenether op works with Objects or Items*/
typedef enum
{
   NOT_CONTAINER,
   OBJ_CONTAINER,
   ITEM_CONTAINER
} Container_Type;

/* Types to define Op's behaviour. */
typedef enum
{
   CONTAINER_NONE,
   CONTAINER_PACK,
   CONTAINER_UNPACK,
   CONTAINER_UNPACK_ALL,
   CONTAINER_REPACK,
} Container_Behavoir_Type;

/* Add all int types before GUI_TYPE_OBJECT, because of typechecking*/
typedef enum _Gui_Type
{
   GUI_TYPE_ZERO,
   GUI_TYPE_SINT,
   GUI_TYPE_OBJECT,
   GUI_TYPE_OBJECT_ITEM,
   GUI_TYPE_CB,
   GUI_TYPE_STRING,
   GUI_TYPE_DOUBLE,
   GUI_TYPE_BOOL,
   GUI_TYPE_ENUM,
   GUI_TYPE_FILE,
   GUI_TYPE_VOID,
   GUI_TYPE_NONE
} Gui_Type;

typedef enum _Gui_Cb_Type
{
   GUI_CB_USER,
   GUI_CB_HIDE,
   GUI_CB_CREATE,
   GUI_CB_NONE
} Gui_Cb_Type;

/* Struct to keep parameter's description */
typedef struct
{
   Gui_Type gui_type;   /* T.e. GUI_TYPE_STRING */
   char *gui_type_name;  /* T.e. const char * */
   Eina_List *default_values; /* List of Param_Default_Values */
} Op_Param_Desc;

/* Struct to keep parameter's default values if they exist */
typedef struct
{
   char *value_name ; /* Alias name for default value, t.e. EVAS_HINT_FILL */
   char *value;      /* Value for default value, t.e. -1.0 in case of EVAS_HINT_FILL */
} Param_Default_Value;

typedef struct _Op_Desc Op_Desc;
typedef struct _Container_Desc Container_Desc;
#define DB_DEF_PUBLIC "public"
#define DB_DEF_PARENT "parent"
#define DB_DEF_CLASS "class"
#define DB_DEF_NAME "name"

#define CONSTRUCTOR "constructor"
#define CLASS_PROP_DELIMETER "."

#define DB_DEF_EVAS_OBJECT_CLASS "Evas.Object"
#define DB_DEF_WIDGET_CLASS "Elm_Widget"
#define DB_DEF_WIN_CLASS "Elm_Win"
#define DB_DEF_BOX_CLASS "Elm_Box"
#define DB_DEF_TABLE_CLASS "Elm_Table"
#define DB_DEF_CONTAINER_CLASS "Elm_Container"
#define DB_DEF_MENU_CLASS "Elm_Menu"
#define DB_DEF_DISKSELECTOR_CLASS "Elm_Diskselector"
#define DB_DEF_CTXPOPUP_CLASS "Elm_Ctxpopup"
#define DB_DEF_ACTIONSLIDER_CLASS "Elm_Actionslider"
#define DB_DEF_BG_CLASS "Elm_Bg"
#define DB_DEF_BUBBLE_CLASS "Elm_Bubble"
#define DB_DEF_BUTTON_CLASS "Elm_Button"
#define DB_DEF_CALENDAR_CLASS "Elm_Calendar"
#define DB_DEF_CHECK_CLASS "Elm_Check"
#define DB_DEF_RADIO_CLASS "Elm_Radio"
#define DB_DEF_CLOCK_CLASS "Elm_Clock"
#define DB_DEF_COLORSELECTOR_CLASS "Elm_Colorselector"
#define DB_DEF_IMAGE_CLASS "Elm_Image"
#define DB_DEF_ICON_CLASS "Elm_Icon"
#define DB_DEF_LABEL_CLASS "Elm_Label"
#define DB_DEF_ENTRY_CLASS "Elm_Entry"
#define DB_DEF_FLIP_CLASS "Elm_Flip"
#define DB_DEF_GENLIST_CLASS "Elm_Genlist"
#define DB_DEF_GENGRID_CLASS "Elm_Gengrid"
#define DB_DEF_TABLE_CLASS "Elm_Table"
#define DB_DEF_MENU_CLASS "Elm_Menu"
#define DB_DEF_DISKSELECTOR_CLASS "Elm_Diskselector"
#define DB_DEF_DAYSELECTOR_CLASS "Elm_Dayselector"
#define DB_DEF_TOOLBAR_CLASS "Elm_Toolbar"
#define DB_DEF_LAYOUT_CLASS "Elm_Layout"
#define DB_DEF_EFL_FILE_INTERFACE "Elm_File"

#define VISIBILITY_SET "visibility"
#define SIZE_SET "size"
#define TITLE_SET "title"
#define PART_TEXT_SET "part_text"
#define COLOR_SET "color"
#define SIZE_SET "size"
#define SIZE_HINT_WEIGHT_SET "size_hint_weight"
#define SIZE_HINT_ALIGN_SET "size_hint_align"
#define POSITION_SET "position"
#define RESIZE_OBJECT_ADD "resize_object_add"
#define ELM_OBJ_WIN_CONSTRUCTOR "constructor"
#define FILE_SET "file"
#define CONTENT_SET "content_set"

Eina_Bool
db_init(const char *db_path);

Eina_Bool
db_shutdown();

/* Get pointer to _class_get() func*/
void*
db_class_func_get(const char *class_name);

/* Get pointer to class macro string */
const char*
db_class_macro_get(const char *class_name);

/* Get list of classes properties. */
Eina_List *
db_class_op_desc_list_get(const char *_kl);

/* Get list of container's class names. */
Eina_List*
db_class_inherit_containers_list_get(const char *class_name);

/* Get value of enum*/
int
db_enum_value_get(const char *_enum);

#if 0
/* Get Op Desc by class name and op name. */
Op_Desc *
db_op_desc_get(const char *_kl, char *_op_name);
#endif

/* Get Op Desc by class name and op name. */
Op_Desc *
db_mro_op_desc_get(const char *class_name, const char *namespace_class, const char *_op_name);

/* FIXME: delete this for Eo2 */
#if 0
/* Get Op Desc by op_id. */
Op_Desc *
db_by_opid_op_desc_get(unsigned int op_id);
#endif

/* Get property name of op_desc. */
const char*
db_op_desc_op_name_get(const Op_Desc *op_desc);

const char*
db_op_desc_op_name_full_get(const Op_Desc *op_desc);

/* Get display property name of op_desc. */
const char*
db_op_desc_prop_display_name_get(const Op_Desc *op_desc);

/* Get type of nth parameter from Op Desc */
Gui_Type
db_op_desc_nth_par_type_get(const Op_Desc *op_desc, unsigned int idx);

/* Get type name of nth parameter from Op Desc */
const char*
db_op_desc_nth_par_type_name_get(const Op_Desc *op_desc, unsigned int idx);

/* Get pointer to array of enum strings for nth parameter in op */
const char**
db_op_desc_nth_par_enum_list_get(const Op_Desc *op_desc, unsigned int idx);

/* Get enum string by int for nth parameter in op */
const char*
db_op_desc_nth_par_enum_get(const Op_Desc *op_desc, unsigned int idx, int enum_value);

const Op_Param_Desc*
db_op_desc_nth_param_desc_get(const Op_Desc *op_desc, unsigned int idx);

/* Get number of parameters in current op*/
unsigned int
db_op_desc_param_number_get(const Op_Desc *p);

/* FIXME Remove */
#if 0
/* Get Eo op id for current op*/
Eo_Op
db_op_desc_op_id_get(const Op_Desc *op_desc);
#endif

/* Get pointer to func set for current op*/
void*
db_op_desc_func_set_pointer_get(const Op_Desc *op_desc);

/* Get pointer to func get for current op*/
void*
db_op_desc_func_get_pointer_get(const Op_Desc *op_desc);

/* Get func name for current op*/
const char*
db_op_desc_func_name_get(const Op_Desc *op_desc);

/* Get class name for current op*/
const char*
db_op_desc_class_name_get(const Op_Desc *op_desc);

const Eina_List*
op_params_desc_default_values_list_get(const Op_Param_Desc *op_param_desc);

const char*
param_default_value_name_get(const Param_Default_Value *def_val);

const char*
param_default_value_get(const Param_Default_Value *def_val);

const char*
db_gui_type_name_get(Gui_Type type);

const char*
db_gui_cb_type_name_get(Gui_Cb_Type type);

Gui_Cb_Type
db_gui_cb_type_get(const char *gui_cb_type_name);

Eina_Bool
db_op_desc_is_container(const Op_Desc *op_desc);

Container_Desc*
db_container_desc_get(const char *class_name);

const Op_Desc*
db_container_desc_op_desc_get(const Container_Desc *container_desc, Container_Behavoir_Type op_behaviour);

/* Get default properties for a class */
const Eina_List*
db_default_prop_values_get(const char* wdgname);

#endif