summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarry Jr <larry.olj@gmail.com>2015-07-01 19:55:40 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-07-01 20:04:10 -0300
commit61aeb2a6a262c657a67a53a836d39896e94efb94 (patch)
treeb73336682113dd58131f7515b29c17ecd8414501
parent595c4b8e5ec503d9dfe6c22c570399bccf114e2e (diff)
EFL Model Form View for MVC designdevs/felipealmeida/emodel-view
Elementary view that show an EFL.model and keep them synchronized asynchronously. The elm_view_form connects properties of a data model to different widgets. There is an example defined in src/examples/filemvc.c that also uses a list view. You can add widgets connected to properties using: eo_do(formview, elm_view_form_widget_add("filename", _label_init(win, bxr, "File Name"))); @feature
-rw-r--r--src/examples/.gitignore1
-rw-r--r--src/examples/Makefile.am2
-rw-r--r--src/examples/filemvc.c211
-rw-r--r--src/lib/Elementary.h.in1
-rw-r--r--src/lib/Makefile.am3
-rw-r--r--src/lib/elm_view_form.c266
-rw-r--r--src/lib/elm_view_form.eo30
-rw-r--r--src/lib/elm_view_form.h10
8 files changed, 524 insertions, 0 deletions
diff --git a/src/examples/.gitignore b/src/examples/.gitignore
index 7c9b93b9d..98a343b64 100644
--- a/src/examples/.gitignore
+++ b/src/examples/.gitignore
@@ -33,6 +33,7 @@
33/fileselector_entry_example 33/fileselector_entry_example
34/fileselector_example 34/fileselector_example
35/fileviewlist 35/fileviewlist
36/filemvc
36/flip_example_01 37/flip_example_01
37/flipselector_example 38/flipselector_example
38/frame_example_01 39/frame_example_01
diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am
index 3835b5f3e..ef68bdd4c 100644
--- a/src/examples/Makefile.am
+++ b/src/examples/Makefile.am
@@ -69,6 +69,7 @@ fileselector_button_example.c \
69fileselector_entry_example.c \ 69fileselector_entry_example.c \
70fileselector_example.c \ 70fileselector_example.c \
71fileviewlist.c \ 71fileviewlist.c \
72filemvc.c \
72flip_example_01.c \ 73flip_example_01.c \
73flipselector_example.c \ 74flipselector_example.c \
74frame_example_01.c \ 75frame_example_01.c \
@@ -222,6 +223,7 @@ fileselector_button_example \
222fileselector_entry_example \ 223fileselector_entry_example \
223fileselector_example \ 224fileselector_example \
224fileviewlist \ 225fileviewlist \
226filemvc \
225flip_example_01 \ 227flip_example_01 \
226flipselector_example \ 228flipselector_example \
227frame_example_01 \ 229frame_example_01 \
diff --git a/src/examples/filemvc.c b/src/examples/filemvc.c
new file mode 100644
index 000000000..9334b499d
--- /dev/null
+++ b/src/examples/filemvc.c
@@ -0,0 +1,211 @@
1//#ifdef HAVE_CONFIG_H
2# include "../../elementary_config.h"
3//#endif
4
5#include <Elementary.h>
6#include <Efl.h>
7#include <Eio.h>
8#include <eio_model.eo.h>
9#include <stdio.h>
10#include <Eio.h>
11#include <elm_view_form.h>
12
13#define EFL_MODEL_TEST_FILENAME_PATH "/tmp"
14
15struct _Efl_Model_Test_Filemvc_Data
16{
17 Eo *fileview;
18 Eo *treeview;
19 Eo *formview;
20 Eo *treemodel;
21 Evas_Object *thumb;
22 char imagedefault_path[256];
23};
24typedef struct _Efl_Model_Test_Filemvc_Data Efl_Model_Test_Filemvc_Data;
25
26static void
27_cleanup_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
28{
29 Efl_Model_Test_Filemvc_Data *priv = (Efl_Model_Test_Filemvc_Data *)data;
30 eo_unref(priv->fileview);
31 eo_unref(priv->treeview);
32 eo_unref(priv->formview);
33 eo_unref(priv->treemodel);
34}
35
36static Eina_Bool
37_filter_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, const Eina_File_Direct_Info *info)
38{
39 if (info->type == EINA_FILE_DIR && info->path[info->name_start] != '.') return EINA_TRUE;
40
41 return EINA_FALSE;
42}
43
44static Eina_Bool
45_list_selected_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
46{
47 Efl_Model_Test_Filemvc_Data *priv = data;
48 Eo *child = event_info;
49 ethumb_client_file_free(elm_thumb_ethumb_client_get());
50
51 printf("LIST selected model\n");
52 eo_do(priv->formview, elm_view_form_model_set(child));
53 return EINA_TRUE;
54}
55
56static Eina_Bool
57_tree_selected_cb(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info)
58{
59 printf("TREE selected model\n");
60 Efl_Model_Test_Filemvc_Data *priv = data;
61 Eo *child = event_info;
62 const Eina_Value *vpath;
63 Eo *model;
64 char *path;
65
66 eo_do(child, efl_model_property_get("path", &vpath));
67 eina_value_get(vpath, &path);
68 model = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(path));
69 eo_do(model, efl_model_load());
70 eo_do(priv->fileview, elm_view_list_model_set(model));
71// eo_unref(model);
72 return EINA_TRUE;
73}
74
75static void
76_widget_init(Evas_Object *widget)
77{
78 evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
79 evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
80 evas_object_show(widget);
81}
82
83Evas_Object *
84_label_init(Evas_Object *win, Evas_Object *box, const char *text)
85{
86 Evas_Object *widget = elm_label_add(win);
87 elm_label_line_wrap_set(widget, ELM_WRAP_CHAR);
88 elm_object_text_set(widget, text);
89 elm_box_pack_end(box, widget);
90 evas_object_size_hint_weight_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
91 evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
92 evas_object_show(widget);
93
94 return widget;
95}
96
97
98static void
99_thumb_error_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
100{
101 Efl_Model_Test_Filemvc_Data *priv = data;
102 printf("thumbnail generation error.\n");
103 elm_thumb_file_set(priv->thumb, priv->imagedefault_path, NULL);
104 elm_thumb_reload(priv->thumb);
105}
106
107EAPI_MAIN int
108elm_main(int argc, char **argv)
109{
110 Efl_Model_Test_Filemvc_Data priv;
111 Evas_Object *win, *panes, *bxr, *genlist, *vpanes;
112 Evas_Object *entry;
113 char *dirname;
114
115 memset(&priv, 0, sizeof(Efl_Model_Test_Filemvc_Data));
116 elm_app_info_set(elm_main, "elementary", "images/logo.png");
117 sprintf(priv.imagedefault_path, "%s/images/logo.png", elm_app_data_dir_get());
118
119 //win
120 win = elm_win_util_standard_add("viewlist", "Viewlist");
121 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
122 elm_win_autodel_set(win, EINA_TRUE);
123
124 panes = elm_panes_add(win);
125// elm_box_horizontal_set(box, EINA_TRUE);
126 evas_object_size_hint_weight_set(panes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
127 elm_win_resize_object_add(win, panes);
128
129 ecore_init();
130 eio_init();
131
132 if(argv[1] != NULL) dirname = argv[1];
133 else dirname = EFL_MODEL_TEST_FILENAME_PATH;
134
135 //treemodel
136 priv.treemodel = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(dirname));
137 eo_do(priv.treemodel, eio_model_children_filter_set(_filter_cb, NULL));
138 eo_do(priv.treemodel, efl_model_load());
139
140 //treeview
141 genlist = elm_genlist_add(win);
142 priv.treeview = eo_add(ELM_VIEW_LIST_CLASS, NULL, elm_view_list_genlist_set(genlist, ELM_GENLIST_ITEM_TREE, NULL));
143 eo_do(priv.treeview, elm_view_list_property_connect("filename", "elm.text"),
144 elm_view_list_property_connect("icon", "elm.swallow.icon"),
145 elm_view_list_model_set(priv.treemodel));
146 _widget_init(genlist);
147 elm_object_part_content_set(panes, "left", genlist);
148 eo_do(panes, elm_obj_panes_content_left_size_set(0.3));
149
150 vpanes = elm_panes_add(win);
151 _widget_init(vpanes);
152 elm_object_part_content_set(panes, "right", vpanes);
153 eo_do(priv.treeview, eo_event_callback_add(ELM_VIEW_LIST_EVENT_MODEL_SELECTED, _tree_selected_cb, &priv));
154 //listview
155 genlist = elm_genlist_add(win);
156 priv.fileview = eo_add(ELM_VIEW_LIST_CLASS, NULL, elm_view_list_genlist_set(genlist, ELM_GENLIST_ITEM_NONE, "double_label"));
157 eo_do(priv.fileview, elm_view_list_property_connect("filename", "elm.text"),
158 elm_view_list_property_connect("size", "elm.text.sub"));
159
160 evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _cleanup_cb, &priv);
161 _widget_init(genlist);
162 elm_object_part_content_set(vpanes, "left", genlist);
163
164 eo_do(priv.fileview, eo_event_callback_add(ELM_VIEW_LIST_EVENT_MODEL_SELECTED, _list_selected_cb, &priv));
165
166 //formview
167 bxr = elm_box_add(win);
168 _widget_init(bxr);
169 elm_object_part_content_set(vpanes, "right", bxr);
170 priv.formview = eo_add(ELM_VIEW_FORM_CLASS, NULL);
171
172 /*Label widget */
173 eo_do(priv.formview, elm_view_form_widget_add("filename", _label_init(win, bxr, "File Name")));
174
175 _label_init(win, bxr, "Size:");
176 eo_do(priv.formview, elm_view_form_widget_add("size", _label_init(win, bxr, "")));
177
178 _label_init(win, bxr, "Modified:");
179 eo_do(priv.formview, elm_view_form_widget_add("mtime", _label_init(win, bxr, "")));
180
181 /* Entry widget */
182 entry = elm_entry_add(win);
183 elm_entry_single_line_set(entry, EINA_TRUE);
184 evas_object_size_hint_weight_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
185 elm_box_pack_end(bxr, entry);
186 evas_object_show(entry);
187 eo_do(priv.formview, elm_view_form_widget_add("path", entry));
188
189 /* Thumb widget */
190 elm_need_ethumb();
191 priv.thumb = elm_thumb_add(win);
192 _widget_init(priv.thumb);
193 elm_box_pack_end(bxr, priv.thumb);
194 elm_thumb_editable_set(priv.thumb, EINA_FALSE);
195 eo_do(priv.formview, elm_view_form_widget_add("path", priv.thumb));
196 evas_object_smart_callback_add(priv.thumb, "generate,error", _thumb_error_cb, &priv);
197 evas_object_smart_callback_add(priv.thumb, "load,error", _thumb_error_cb, &priv);
198
199 //showall
200 evas_object_resize(win, 800, 400);
201 evas_object_show(panes);
202 evas_object_show(win);
203
204 elm_run();
205 elm_shutdown();
206 ecore_shutdown();
207
208 return 0;
209}
210ELM_MAIN()
211
diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in
index 61cb53ea0..af3f1229f 100644
--- a/src/lib/Elementary.h.in
+++ b/src/lib/Elementary.h.in
@@ -261,6 +261,7 @@ EAPI extern Elm_Version *elm_version;
261#include <elm_transit.h> 261#include <elm_transit.h>
262#include <elm_video.h> 262#include <elm_video.h>
263#include <elm_view_list.h> 263#include <elm_view_list.h>
264#include <elm_view_form.h>
264#include <elm_web.h> 265#include <elm_web.h>
265#include <elm_win.h> 266#include <elm_win.h>
266#include <elm_win_standard.h> 267#include <elm_win_standard.h>
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 547576709..fbdfc3948 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -377,6 +377,7 @@ elm_video.h \
377elm_video_eo.h \ 377elm_video_eo.h \
378elm_video_legacy.h \ 378elm_video_legacy.h \
379elm_view_list.h \ 379elm_view_list.h \
380elm_view_form.h \
380elm_web.h \ 381elm_web.h \
381elm_web_common.h \ 382elm_web_common.h \
382elm_web_eo.h \ 383elm_web_eo.h \
@@ -502,6 +503,7 @@ elm_util.c \
502elm_url.c \ 503elm_url.c \
503elm_video.c \ 504elm_video.c \
504elm_view_list.c \ 505elm_view_list.c \
506elm_view_form.c \
505elm_web2.c \ 507elm_web2.c \
506elm_widget.c \ 508elm_widget.c \
507elm_win.c \ 509elm_win.c \
@@ -622,6 +624,7 @@ elm_thumb.eo \
622elm_toolbar.eo \ 624elm_toolbar.eo \
623elm_video.eo \ 625elm_video.eo \
624elm_view_list.eo \ 626elm_view_list.eo \
627elm_view_form.eo \
625elm_web.eo \ 628elm_web.eo \
626elm_widget.eo \ 629elm_widget.eo \
627elm_win.eo \ 630elm_win.eo \
diff --git a/src/lib/elm_view_form.c b/src/lib/elm_view_form.c
new file mode 100644
index 000000000..7437a95e7
--- /dev/null
+++ b/src/lib/elm_view_form.c
@@ -0,0 +1,266 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4#include <Eo.h>
5#include <Efl.h>
6#include <Elementary.h>
7
8#include "elm_view_form.h"
9#include "elm_view_list.h"
10
11#include "elm_priv.h"
12#include <assert.h>
13
14#define MY_CLASS ELM_VIEW_FORM_CLASS
15#define MY_CLASS_NAME "View_Form"
16
17typedef struct _Elm_View_Form_Data Elm_View_Form_Data;
18typedef struct _Elm_View_Form_Widget Elm_View_Form_Widget;
19
20/**
21 * @brief Local-use callbacks
22 */
23typedef void (*Elm_View_Form_Event_Cb)(Elm_View_Form_Widget *, Elm_View_Form_Data *, Evas_Object *);
24typedef void (*Elm_View_Form_Widget_Object_Set_Cb)(Eo *, Evas_Object *, const Eina_Value *, const char *);
25
26struct _Elm_View_Form_Widget
27{
28 Eina_Stringshare *widget_propname;
29 Evas_Object *widget_obj;
30 Elm_View_Form_Event_Cb widget_obj_value_update_cb;
31 Elm_View_Form_Widget_Object_Set_Cb widget_obj_set_cb;
32};
33
34struct _Elm_View_Form_Data
35{
36 Eo *model_obj;
37 Eina_Value *properties;
38 Eina_List *l;
39};
40
41static Eina_Bool
42_efl_model_properties_change_cb(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info)
43{
44 const Efl_Model_Property_Event *evt = event_info;
45 const Eina_Value *value;
46 const char *prop;
47 unsigned int i;
48 Elm_View_Form_Data *priv = data;
49 Eina_List *l = NULL;
50 Elm_View_Form_Widget *w = NULL;
51 Eina_Array_Iterator it;
52
53 EINA_SAFETY_ON_NULL_RETURN_VAL(priv, EINA_TRUE);
54 EINA_SAFETY_ON_NULL_RETURN_VAL(evt, EINA_TRUE);
55
56 if (!evt->changed_properties)
57 return EINA_TRUE;
58
59 //update all widgets with this property
60 EINA_LIST_FOREACH(priv->l, l, w)
61 {
62 EINA_ARRAY_ITER_NEXT(evt->changed_properties, i, prop, it)
63 {
64 if (!strcmp(w->widget_propname, prop))
65 {
66 eo_do(priv->model_obj, efl_model_property_get(prop, &value));
67 w->widget_obj_set_cb(priv->model_obj, w->widget_obj, value, w->widget_propname);
68 }
69 }
70 }
71
72 return EINA_TRUE;
73}
74
75static void
76_update_model_properties(Elm_View_Form_Data *priv)
77{
78 const Eina_Value *value;
79 Eina_List *l;
80 Elm_View_Form_Widget *w;
81 //update all widgets property
82 EINA_LIST_FOREACH(priv->l, l, w)
83 {
84 eo_do(priv->model_obj, efl_model_property_get(w->widget_propname, &value));
85 w->widget_obj_set_cb(priv->model_obj, w->widget_obj, value, w->widget_propname);
86 }
87}
88
89/**
90 * @brief Set widget.
91 * Works, so far, for widget(s): Entry, Label
92 */
93static void
94_elm_evas_object_text_set_cb(Eo *obj EINA_UNUSED, Evas_Object *widget, const Eina_Value *value, const char *propname EINA_UNUSED)
95{
96 const char *c_text = NULL;
97 char *text = NULL;
98
99 EINA_SAFETY_ON_NULL_RETURN(value);
100 EINA_SAFETY_ON_NULL_RETURN(widget);
101
102 text = eina_value_to_string(value);
103 EINA_SAFETY_ON_NULL_RETURN(text);
104
105 c_text = elm_object_text_get(widget);
106 EINA_SAFETY_ON_NULL_RETURN(c_text);
107
108 if (strcmp(text, c_text) != 0)
109 {
110 elm_object_text_set(widget, text);
111 }
112 free(text);
113}
114
115static void
116_elm_evas_object_thumb_set_cb(Eo *obj EINA_UNUSED, Evas_Object *thumb, const Eina_Value *value, const char *propname EINA_UNUSED)
117{
118 char *filename = NULL;
119
120 EINA_SAFETY_ON_NULL_RETURN(value);
121 filename = eina_value_to_string(value);
122 EINA_SAFETY_ON_NULL_RETURN(filename);
123 if (strlen(filename) < PATH_MAX)
124 {
125 elm_thumb_file_set(thumb, filename, NULL);
126 elm_thumb_reload(thumb);
127 }
128 free(filename);
129}
130
131/**
132 * @brief Evas object callback implementation.
133 * Updates Widget's value if not the same object
134 * and the widget itself.
135 */
136static void
137_elm_evas_object_text_changed_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
138{
139 Eina_Value value;
140 Eina_List *l;
141 Elm_View_Form_Data *priv = (Elm_View_Form_Data *)data;
142 Elm_View_Form_Widget *w = NULL;
143
144 EINA_LIST_FOREACH(priv->l, l, w)
145 {
146 if (w->widget_obj == obj)
147 break;
148 }
149
150 EINA_SAFETY_ON_NULL_RETURN(w);
151 eina_value_setup(&value, EINA_VALUE_TYPE_STRING);
152 eina_value_set(&value, elm_object_text_get(obj));
153 eo_do(priv->model_obj, efl_model_property_set(w->widget_propname, &value));
154 eina_value_flush(&value);
155}
156/**
157 * @brief Add new widget object.
158 * Adds new widget object on the list
159 * and perform initial setup.
160 */
161static Eina_Bool
162_elm_view_widget_add(Elm_View_Form_Data *priv, const char *propname, Evas_Object *widget_obj)
163{
164 const Eina_Value *value = NULL;
165 Elm_View_Form_Widget *w = calloc(1, sizeof(Elm_View_Form_Widget));
166 EINA_SAFETY_ON_NULL_RETURN_VAL(w, EINA_FALSE);
167
168 w->widget_propname = eina_stringshare_add(propname);
169 w->widget_obj = widget_obj;
170 priv->l = eina_list_append(priv->l, w);
171
172 if(eo_isa(widget_obj, ELM_ENTRY_CLASS))
173 {
174 w->widget_obj_set_cb = _elm_evas_object_text_set_cb;
175 evas_object_event_callback_add(w->widget_obj, EVAS_CALLBACK_KEY_DOWN, _elm_evas_object_text_changed_cb, priv);
176 }
177 else if(eo_isa(widget_obj, ELM_LABEL_CLASS))
178 {
179 w->widget_obj_set_cb = _elm_evas_object_text_set_cb;
180 }
181 else if(eo_isa(widget_obj, ELM_THUMB_CLASS))
182 {
183 w->widget_obj_set_cb = _elm_evas_object_thumb_set_cb;
184 }
185 else
186 {
187 // Widget yet not supported
188 EINA_SAFETY_ON_NULL_RETURN_VAL(NULL, EINA_FALSE);
189 }
190
191 eo_do(priv->model_obj, efl_model_property_get(propname, &value));
192 if (value)
193 {
194 w->widget_obj_set_cb(priv->model_obj, w->widget_obj, value, w->widget_propname);
195 }
196
197 return EINA_TRUE;
198}
199/**
200 * Helper functions - End
201 */
202
203
204/**
205 * @brief constructor
206 */
207static Eo_Base*
208_elm_view_form_eo_base_constructor(Eo *obj EINA_UNUSED, Elm_View_Form_Data *_pd)
209{
210 Elm_View_Form_Data *priv = (Elm_View_Form_Data *)_pd;
211 priv->model_obj = NULL;
212
213 eo_do_super(obj, MY_CLASS, eo_constructor());
214
215 return obj;
216}
217
218/**
219 * @brief destructor
220 */
221static void
222_elm_view_form_eo_base_destructor(Eo *obj, Elm_View_Form_Data *priv)
223{
224 Elm_View_Form_Widget *w = NULL;
225 EINA_LIST_FREE(priv->l, w)
226 {
227 eina_stringshare_del(w->widget_propname);
228 free(w);
229 }
230
231 eo_do_super(obj, MY_CLASS, eo_destructor());
232}
233
234
235static void
236_elm_view_form_model_set(Eo *obj EINA_UNUSED, Elm_View_Form_Data *priv, Eo *model)
237{
238 if (priv->model_obj != NULL)
239 {
240 eo_do(priv->model_obj, eo_event_callback_del(EFL_MODEL_BASE_EVENT_PROPERTIES_CHANGED, _efl_model_properties_change_cb, priv));
241 eo_unref(priv->model_obj);
242 }
243
244 priv->model_obj = model;
245
246 if (priv->model_obj != NULL)
247 {
248 eo_ref(priv->model_obj);
249 eo_do(priv->model_obj, eo_event_callback_add(EFL_MODEL_BASE_EVENT_PROPERTIES_CHANGED, _efl_model_properties_change_cb, priv));
250 _update_model_properties(priv);
251 }
252}
253
254static void
255_elm_view_form_widget_add(Eo *obj EINA_UNUSED, Elm_View_Form_Data *priv, const char *propname, Evas_Object *evas)
256{
257 Eina_Bool status;
258
259 EINA_SAFETY_ON_NULL_RETURN(evas);
260 EINA_SAFETY_ON_NULL_RETURN(propname);
261
262 status = _elm_view_widget_add(priv, propname, evas);
263 EINA_SAFETY_ON_FALSE_RETURN(status);
264}
265
266#include "elm_view_form.eo.c"
diff --git a/src/lib/elm_view_form.eo b/src/lib/elm_view_form.eo
new file mode 100644
index 000000000..e91919f0d
--- /dev/null
+++ b/src/lib/elm_view_form.eo
@@ -0,0 +1,30 @@
1class Elm_View_Form (Eo.Base)
2{
3 legacy_prefix: null;
4 methods {
5 model_set {
6 /*@ Set model
7 @def elm_view_form_model_set
8 @since 1.11 */
9 params {
10 @in model: Efl.Model.Base*; /*@ Emodel object */
11 }
12 }
13 widget_add {
14 /*@ Add new widget
15 @def elm_view_form_widget_add
16 @since 1.11 */
17 params {
18 @in propname: const(char)*; /*@ Property name */
19 @in evas: Evas_Object*; /*@ Evas widget */
20 }
21 }
22 }
23 implements {
24 Eo.Base.destructor;
25 Eo.Base.constructor;
26 }
27 constructors {
28 .model_set;
29 }
30}
diff --git a/src/lib/elm_view_form.h b/src/lib/elm_view_form.h
new file mode 100644
index 000000000..3572c7c72
--- /dev/null
+++ b/src/lib/elm_view_form.h
@@ -0,0 +1,10 @@
1
2#ifdef EFL_EO_API_SUPPORT
3#ifndef ELM_VIEW_FORM_H
4#define ELM_VIEW_FORM_H
5
6#include <Efl.h>
7#include <elm_view_form.eo.h>
8
9#endif
10#endif