summaryrefslogtreecommitdiff
path: root/src/lib/database.h
blob: 7c79ee5097f8a0fa4885333792374108e98ae0c9 (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

#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 operation's group. */
typedef enum
{
   GROUP_NONE,
   GROUP_CONTAINER,
   GROUP_SIZE
} Op_Group_Type;

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

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

/* Add all int types before GUI_TYPE_OBJECT, because of typechecking*/
typedef enum _Gui_Type
{
   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_IMAGE,
   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 types */
typedef struct
{
   Gui_Type gui_type;
   const char *gui_type_name;
}Gui_Type_Desc;

typedef enum
{
     EGUI_NO_CALL = 0,
     EGUI_GENERATE = 1 << 0,
     EGUI_EO_DO_CALL = 1 << 1,
     EGUI_EO_ADD_CALL = 1 << 2,
     MULTI_PROPERTY = 1 << 3,
     CHANGE_ON_ACTIVATE = 1 << 4,
     UPDATE_PARENT = 1 << 5
} Op_Flag;

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 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 "Elc_Ctxpopup"

#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 ELM_OBJ_WIN_CONSTRUCTOR "elm_obj_win_constructor"

Eina_Bool
db_init();

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 *_kl, 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);

/* 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);

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

/* Get op type of current op*/
Op_Flag
db_op_desc_flag_get(const Op_Desc *op_desc);

/* 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 for current op*/
void*
db_op_desc_func_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 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);

/* Get op group type for for current op*/
Op_Group_Type
db_op_desc_group_type_get(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, Op_Behaviour_Type op_behaviour);

#endif