3 * Copyright 2012 Samsung Electronics Co., Ltd
5 * Licensed under the Flora License, Version 1.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.tizenopensource.org/license
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 #include <extended-elm.h>
24 * @brief This function is an encapsulated vesion of elm_scroller_add
26 * @param [in] parent The parent object
28 * @return Return pointer to elm object (Success) or NULL (Failed)
37 Evas_Object *elm_scroller_create(Evas_Object *parent)
40 sc = elm_scroller_add(parent);
41 elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE);
42 elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
43 evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
44 evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
52 * @brief This function is an encapsulated vesion of elm_layout_add
54 * @param [in] parent The parent object
56 * @param [in] file The path to file (edj) that will be used as layout
58 * @param [in] group The group that the layout belongs in edje file
60 * @return Return pointer to elm object (Success) or NULL (Failed)
69 Evas_Object *elm_layout_create(Evas_Object *parent, const char *file, const char *group)
72 ly = elm_layout_add(parent);
73 if (elm_layout_file_set(ly, file, group)) {
74 evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, 0);
75 evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, 0);
87 * @brief This function is an encapsulated vesion of elm_label_add
89 * @param [in] parent The parent object
91 * @param [in] text The label will be used on the object
93 * @return Return pointer to elm object (Success) or NULL (Failed)
102 Evas_Object *elm_label_create(Evas_Object *parent, const char *text)
105 label = elm_label_add(parent);
106 elm_label_line_wrap_set(label, ELM_WRAP_CHAR);
107 elm_object_text_set(label, text);
108 evas_object_size_hint_align_set(label, EVAS_HINT_FILL, 0);
109 evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0);
110 evas_object_show(label);
117 * @brief This function is an encapsulated vesion of elm_check_add
119 * @param [in] parent The parent object
121 * @return Return pointer to elm object (Success) or NULL (Failed)
130 Evas_Object *elm_check_create(Evas_Object *parent)
133 check = elm_check_add(parent);
134 evas_object_size_hint_align_set(check, EVAS_HINT_FILL, 0);
135 evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, 0);
136 evas_object_show(check);
143 * @brief This function is an encapsulated vesion of elm_button_add
145 * @param [in] parent The parent object
147 * @param [in] text The label will be used on the object
149 * @param [in] click_cb The callback function when clicked
151 * @param [in] data User data to be passed to the callback function
153 * @return Return pointer to elm object (Success) or NULL (Failed)
162 Evas_Object *elm_button_create(Evas_Object *parent, const char *text, Evas_Smart_Cb click_cb,
166 btn = elm_button_add(parent);
167 elm_object_text_set(btn, text);
168 evas_object_smart_callback_add(btn, "clicked", click_cb, data);
169 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0);
170 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0);
171 evas_object_show(btn);
178 * @brief This function is an encapsulated vesion of elm_entry_add
180 * @param [in] parent The parent object
182 * @param [in] text The label will be used on the object
184 * @return Return pointer to elm object (Success) or NULL (Failed)
193 Evas_Object *elm_entry_create(Evas_Object *parent, const char *text)
196 entry = elm_entry_add(parent);
197 elm_entry_entry_set(entry, text);
198 evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, 0);
199 evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0);
200 elm_entry_input_panel_enabled_set(entry, EINA_FALSE);
201 elm_entry_cnp_mode_set(entry, ELM_CNP_MODE_PLAINTEXT);
202 evas_object_show(entry);
209 * @brief This function is an encapsulated vesion of elm_icon_add
211 * @param [in] parent The parent object
213 * @param [in] file The path of icon file
215 * @return Return pointer to elm object (Success) or NULL (Failed)
224 Evas_Object *elm_icon_create(Evas_Object *parent, const char *file)
227 ic = elm_icon_add(parent);
228 elm_icon_file_set(ic, file, NULL);
229 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
230 elm_icon_resizable_set(ic, 1, 1);
231 evas_object_show(ic);
236 * elm_navigator_btn_create
238 * @brief This function is an encapsulated vesion of elm_icon_add
240 * @param [in] parent The parent object
242 * @param [in] text The label will be used on the object
244 * @param [in] icon_path The icon will be displayed on the object
246 * @param [in] style "navigationbar_control/left(center|right)"
248 * @param [in] click_cb The callback function when clicked
250 * @param [in] data User data to be passed to the callback function
252 * @return Return pointer to elm object (Success) or NULL (Failed)
261 Evas_Object *elm_navigator_btn_create(Evas_Object *parent, const char *text,
262 const char *icon_path, const char *style,
263 Evas_Smart_Cb click_cb, void *data)
265 Evas_Object *btn = NULL;
267 btn = elm_button_create(parent, text, click_cb, data);
268 elm_object_style_set(btn, "naviframe/title/default");
273 * elm_swallowed_scroller
275 * @brief This function is an encapsulated vesion of elm_scroller_add
277 * @param [in] parent The parent object
279 * @param [in] part The swallow part name in the parent layout obj
281 * @return Return pointer to elm object (Success) or NULL (Failed)
290 Evas_Object *elm_swallowed_scroller(Evas_Object *parent, const char *part)
292 Evas_Object *eo = elm_scroller_create(parent);
293 elm_object_part_content_set(parent, part, eo);
298 * elm_swallowed_layout
300 * @brief This function is an encapsulated vesion of elm_layout_add
302 * @param [in] parent The parent object
304 * @param [in] part The swallow part name in the parent layout obj
306 * @param [in] file The path to file (edj) that will be used as layout
308 * @param [in] group The group that the layout belongs in edje file
310 * @return Return pointer to elm object (Success) or NULL (Failed)
319 Evas_Object *elm_swallowed_layout(Evas_Object *parent, const char *part, const char *file,
322 Evas_Object *eo = elm_layout_create(parent, file, group);
323 elm_object_part_content_set(parent, part, eo);
328 * elm_swallowed_button
330 * @brief This function is an encapsulated vesion of elm_button_add
332 * @param [in] parent The parent object
334 * @param [in] part The swallow part name in the parent layout obj
336 * @param [in] text The label will be used on the object
338 * @param [in] click_cb The callback function when clicked
340 * @param [in] data User data to be passed to the callback function
342 * @return Return pointer to elm object (Success) or NULL (Failed)
351 Evas_Object *elm_swallowed_button(Evas_Object *parent, const char *part, const char *text,
352 Evas_Smart_Cb click_cb, void *data)
354 Evas_Object *eo = elm_button_create(parent, text, click_cb, data);
355 elm_object_part_content_set(parent, part, eo);
360 * elm_swallowed_entry
362 * @brief This function is an encapsulated vesion of elm_entry_add
364 * @param [in] parent The parent object
366 * @param [in] part The swallow part name in the parent layout obj
368 * @param [in] text The label will be used on the object
370 * @return Return pointer to elm object (Success) or NULL (Failed)
379 Evas_Object *elm_swallowed_entry(Evas_Object *parent, const char *part, const char *text)
381 Evas_Object *eo = elm_entry_create(parent, text);
382 elm_object_part_content_set(parent, part, eo);
389 * @brief This function is an encapsulated vesion of elm_icon_add
391 * @param [in] parent The parent object
393 * @param [in] part The swallow part name in the parent layout obj
395 * @param [in] file The path of icon file
397 * @return Return pointer to elm object (Success) or NULL (Failed)
406 Evas_Object *elm_swallowed_icon(Evas_Object *parent, const char *part, const char *file)
408 Evas_Object *eo = elm_icon_create(parent, file);
409 elm_object_part_content_set(parent, part, eo);
414 * elm_layout_content_del
416 * @brief Destroy object from layout
418 * @param [in] parent The parent object
420 * @param [in] part The name of swallowed part in the parent layout obj
431 void elm_layout_content_del(Evas_Object *parent, const char *part)
433 Evas_Object *eo = elm_object_part_content_unset(parent, part);