2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include <extended-elm.h>
22 * @brief This function is an encapsulated vesion of elm_scroller_add
24 * @param [in] parent The parent object
26 * @return Return pointer to elm object (Success) or NULL (Failed)
35 Evas_Object *elm_scroller_create(Evas_Object *parent)
38 sc = elm_scroller_add(parent);
39 elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE);
40 elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
41 evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
42 evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
50 * @brief This function is an encapsulated vesion of elm_layout_add
52 * @param [in] parent The parent object
54 * @param [in] file The path to file (edj) that will be used as layout
56 * @param [in] group The group that the layout belongs in edje file
58 * @return Return pointer to elm object (Success) or NULL (Failed)
67 Evas_Object *elm_layout_create(Evas_Object *parent, const char *file, const char *group)
70 ly = elm_layout_add(parent);
71 if (elm_layout_file_set(ly, file, group)) {
72 evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, 0);
73 evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, 0);
85 * @brief This function is an encapsulated vesion of elm_label_add
87 * @param [in] parent The parent object
89 * @param [in] text The label will be used on the object
91 * @return Return pointer to elm object (Success) or NULL (Failed)
100 Evas_Object *elm_label_create(Evas_Object *parent, const char *text)
103 label = elm_label_add(parent);
104 elm_label_line_wrap_set(label, ELM_WRAP_CHAR);
105 elm_object_text_set(label, text);
106 evas_object_size_hint_align_set(label, EVAS_HINT_FILL, 0);
107 evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0);
108 evas_object_show(label);
115 * @brief This function is an encapsulated vesion of elm_check_add
117 * @param [in] parent The parent object
119 * @return Return pointer to elm object (Success) or NULL (Failed)
128 Evas_Object *elm_check_create(Evas_Object *parent)
131 check = elm_check_add(parent);
132 evas_object_size_hint_align_set(check, EVAS_HINT_FILL, 0);
133 evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, 0);
134 evas_object_show(check);
141 * @brief This function is an encapsulated vesion of elm_button_add
143 * @param [in] parent The parent object
145 * @param [in] text The label will be used on the object
147 * @param [in] click_cb The callback function when clicked
149 * @param [in] data User data to be passed to the callback function
151 * @return Return pointer to elm object (Success) or NULL (Failed)
160 Evas_Object *elm_button_create(Evas_Object *parent, const char *text, Evas_Smart_Cb click_cb,
164 btn = elm_button_add(parent);
165 elm_object_text_set(btn, text);
166 evas_object_smart_callback_add(btn, "clicked", click_cb, data);
167 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0);
168 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0);
169 evas_object_show(btn);
176 * @brief This function is an encapsulated vesion of elm_entry_add
178 * @param [in] parent The parent object
180 * @param [in] text The label will be used on the object
182 * @return Return pointer to elm object (Success) or NULL (Failed)
191 Evas_Object *elm_entry_create(Evas_Object *parent, const char *text)
194 entry = elm_entry_add(parent);
195 elm_entry_entry_set(entry, text);
196 evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, 0);
197 evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0);
198 elm_entry_input_panel_enabled_set(entry, EINA_FALSE);
199 elm_entry_cnp_mode_set(entry, ELM_CNP_MODE_PLAINTEXT);
200 evas_object_show(entry);
207 * @brief This function is an encapsulated vesion of elm_icon_add
209 * @param [in] parent The parent object
211 * @param [in] file The path of icon file
213 * @return Return pointer to elm object (Success) or NULL (Failed)
222 Evas_Object *elm_icon_create(Evas_Object *parent, const char *file)
225 ic = elm_icon_add(parent);
226 elm_icon_file_set(ic, file, NULL);
227 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
228 elm_icon_resizable_set(ic, 1, 1);
229 evas_object_show(ic);
234 * elm_navigator_btn_create
236 * @brief This function is an encapsulated vesion of elm_icon_add
238 * @param [in] parent The parent object
240 * @param [in] text The label will be used on the object
242 * @param [in] icon_path The icon will be displayed on the object
244 * @param [in] style "navigationbar_control/left(center|right)"
246 * @param [in] click_cb The callback function when clicked
248 * @param [in] data User data to be passed to the callback function
250 * @return Return pointer to elm object (Success) or NULL (Failed)
259 Evas_Object *elm_navigator_btn_create(Evas_Object *parent, const char *text,
260 const char *icon_path, const char *style,
261 Evas_Smart_Cb click_cb, void *data)
263 Evas_Object *btn = NULL;
265 btn = elm_button_create(parent, text, click_cb, data);
266 elm_object_style_set(btn, "naviframe/title/default");
271 * elm_swallowed_scroller
273 * @brief This function is an encapsulated vesion of elm_scroller_add
275 * @param [in] parent The parent object
277 * @param [in] part The swallow part name in the parent layout obj
279 * @return Return pointer to elm object (Success) or NULL (Failed)
288 Evas_Object *elm_swallowed_scroller(Evas_Object *parent, const char *part)
290 Evas_Object *eo = elm_scroller_create(parent);
291 elm_object_part_content_set(parent, part, eo);
296 * elm_swallowed_layout
298 * @brief This function is an encapsulated vesion of elm_layout_add
300 * @param [in] parent The parent object
302 * @param [in] part The swallow part name in the parent layout obj
304 * @param [in] file The path to file (edj) that will be used as layout
306 * @param [in] group The group that the layout belongs in edje file
308 * @return Return pointer to elm object (Success) or NULL (Failed)
317 Evas_Object *elm_swallowed_layout(Evas_Object *parent, const char *part, const char *file,
320 Evas_Object *eo = elm_layout_create(parent, file, group);
321 elm_object_part_content_set(parent, part, eo);
326 * elm_swallowed_button
328 * @brief This function is an encapsulated vesion of elm_button_add
330 * @param [in] parent The parent object
332 * @param [in] part The swallow part name in the parent layout obj
334 * @param [in] text The label will be used on the object
336 * @param [in] click_cb The callback function when clicked
338 * @param [in] data User data to be passed to the callback function
340 * @return Return pointer to elm object (Success) or NULL (Failed)
349 Evas_Object *elm_swallowed_button(Evas_Object *parent, const char *part, const char *text,
350 Evas_Smart_Cb click_cb, void *data)
352 Evas_Object *eo = elm_button_create(parent, text, click_cb, data);
353 elm_object_part_content_set(parent, part, eo);
358 * elm_swallowed_entry
360 * @brief This function is an encapsulated vesion of elm_entry_add
362 * @param [in] parent The parent object
364 * @param [in] part The swallow part name in the parent layout obj
366 * @param [in] text The label will be used on the object
368 * @return Return pointer to elm object (Success) or NULL (Failed)
377 Evas_Object *elm_swallowed_entry(Evas_Object *parent, const char *part, const char *text)
379 Evas_Object *eo = elm_entry_create(parent, text);
380 elm_object_part_content_set(parent, part, eo);
387 * @brief This function is an encapsulated vesion of elm_icon_add
389 * @param [in] parent The parent object
391 * @param [in] part The swallow part name in the parent layout obj
393 * @param [in] file The path of icon file
395 * @return Return pointer to elm object (Success) or NULL (Failed)
404 Evas_Object *elm_swallowed_icon(Evas_Object *parent, const char *part, const char *file)
406 Evas_Object *eo = elm_icon_create(parent, file);
407 elm_object_part_content_set(parent, part, eo);
412 * elm_layout_content_del
414 * @brief Destroy object from layout
416 * @param [in] parent The parent object
418 * @param [in] part The name of swallowed part in the parent layout obj
429 void elm_layout_content_del(Evas_Object *parent, const char *part)
431 Evas_Object *eo = elm_object_part_content_unset(parent, part);