2 * @brief: Make a essential object for the this app, like window, conformant and layout
3 * @param[ad]: The object has informations for managing this app
5 void view_create(appdata_s *ad)
8 dlog_print(DLOG_ERROR, LOG_TAG, "appdata is NULL.");
13 ad->win = view_create_win();
14 if (ad->win == NULL) {
15 dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a window.");
19 /* Create conformant */
20 ad->conform = view_create_conformant_without_indicator(ad->win);
21 if (ad->conform == NULL) {
22 dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a conformant");
26 /* Show window after main view is set up */
27 evas_object_show(ad->win);
31 * @brief: Make a basic window named package
32 * @param[package]: Name of the window
34 Evas_Object *view_create_win(const char *pkg_name)
36 Evas_Object *win = NULL;
39 /* Create and initialize elm_win.
40 elm_win is mandatory to manipulate window. */
42 win = elm_win_util_standard_add(pkg_name, pkg_name);
43 elm_win_conformant_set(win, EINA_TRUE);
44 elm_win_autodel_set(win, EINA_TRUE);
46 if (elm_win_wm_rotation_supported_get(win)) {
47 int rots[4] = { 0, 90, 180, 270 };
48 elm_win_wm_rotation_available_rotations_set(win, (const int *)(&rots), 4);
51 evas_object_smart_callback_add(win, "delete,request", _win_delete_request_cb, NULL);
57 * @brief: Make a conformant without indicator for wearable app
58 * @param[win]: The object to which you want to set this conformant
59 * Confromant is mandatory for base GUI to have proper size
61 Evas_Object *view_create_conformant_without_indicator(Evas_Object *win)
64 * Create and initialize elm_conformant.
65 * elm_conformant is mandatory for base GUI to have proper size
66 * when indicator or virtual keypad is visible.
68 Evas_Object *conform = NULL;
71 dlog_print(DLOG_ERROR, LOG_TAG, "window is NULL.");
75 conform = elm_conformant_add(win);
76 evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
77 elm_win_resize_object_add(win, conform);
79 evas_object_show(conform);
85 * @brief: Make a layout to target parent object with edje file
86 * @param[parent]: The object to which you want to add this layout
87 * @param[file_name]: File path of EDJ
88 * @param[group_name]: Name of group in EDJ you want to set to
89 * @param[Evas_Object_Event_Cb]: File path of EDJ
90 * @param[user_data]: The user data to be passed to the callback functions
92 Evas_Object *view_create_layout(Evas_Object *parent, const char *file_name, const char *group_name, Evas_Object_Event_Cb cb_function, void *user_data)
94 Evas_Object *layout = NULL;
95 char edj_path[PATH_MAX] = { 0, };
98 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
102 /* Create layout by EDC(edje file) */
103 _get_resource(file_name, edj_path, (int)PATH_MAX);
104 layout = elm_layout_add(parent);
105 elm_layout_file_set(layout, edj_path, group_name);
107 /* Layout size setting */
108 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
111 eext_object_event_callback_add(layout, EEXT_CALLBACK_BACK, cb_function, user_data);
113 evas_object_show(layout);
119 * @brief: Make and set a layout to conformant
120 * @param[parent]: Target conformant object
121 * @param[file_name]: File path of EDJ used
122 * @param[group_name]: Group name in EDJ you want to set to layout
123 * @param[user_data]: The user data to be passed to the callback functions
125 Evas_Object *view_create_layout_for_conformant(Evas_Object *parent, Evas_Object *conformant, const char *file_name, const char *group_name, void *user_data)
127 Evas_Object *layout = NULL;
129 if (parent == NULL) {
130 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
134 /* Create layout for conformant */
135 layout = view_create_layout(parent, file_name, group_name, user_data);
136 if (layout == NULL) {
137 dlog_print(DLOG_ERROR, LOG_TAG, "layout is NULL.");
141 elm_object_content_set(conformant, layout);
147 * @brief: Make a layout with theme.
148 * @param[parent]: Object to which you want to add this layout
149 * @param[class]: The class of the group
150 * @param[group_name]: Group name in EDJ you want to set to layout
151 * @param[style]: The style to use
153 Evas_Object *view_create_layout_by_theme(Evas_Object *parent, const char *classname, const char *group, const char *style)
157 * Create and initialize elm_layout.
158 * view_create_layout_by_theme() is used to create layout by using premade edje file.
160 Evas_Object *layout = NULL;
162 if (parent == NULL) {
163 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
167 layout = elm_layout_add(parent);
168 elm_layout_theme_set(layout, classname, group, style);
169 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
171 evas_object_show(layout);
177 * @brief: Make and set a layout to the part
178 * @param[parent]: Object to which you want to set this layout
179 * @param[file_name]: File path of EDJ used
180 * @param[group_name]: Group name in EDJ you want to set to layout
181 * @param[part]: Part name to which you want to set this layout
183 Evas_Object *view_create_layout_for_part(Evas_Object *parent, char *part, char *file_name, char *group_name)
185 Evas_Object *layout = NULL;
187 if (parent == NULL) {
188 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
192 layout = elm_layout_add(parent);
193 elm_layout_file_set(layout, file_name, group_name);
194 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
196 evas_object_show(layout);
198 elm_object_part_content_set(parent, part, layout);
204 * @brief: Destroy window and free important data to finish this app
205 * @param[ad]: The object has informations for managing this app
207 void view_destroy(void *user_data)
209 appdata_s *ad = NULL;
213 dlog_print(DLOG_ERROR, LOG_TAG, "failed to destroy data.");
217 evas_object_del(ad->win);
221 * @brief: Destroy given layout
222 * @param[layout]: The layout you want to destroy
224 void view_destroy_layout(Evas_Object *layout)
226 evas_object_del(layout);
230 * @brief: Set image to given part
231 * @param[parent]: object has part to which you want to set this image
232 * @param[part]: part name to which you want to set this image
233 * @param[image_path]: path of image file
235 void view_set_image(Evas_Object *parent, const char *part, const char *image_path)
237 Evas_Object *image = NULL;
239 if (parent == NULL) {
240 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
244 image = elm_object_part_content_get(parent, part);
246 image = elm_image_add(parent);
248 dlog_print(DLOG_ERROR, LOG_TAG, "failed to create an image object.");
253 if (EINA_FALSE == elm_image_file_set(image, image_path, NULL)) {
254 dlog_print(DLOG_ERROR, LOG_TAG, "failed to set image.");
259 elm_object_part_content_set(parent, part, image);
261 elm_object_content_set(parent, image);
264 evas_object_show(image);
270 * @brief: Set text to the part
271 * @param[parent]: Object has part to which you want to set text
272 * @param[part]: Part name to which you want to set text
273 * @param[text]: text you want to set to the part
275 void view_set_text(Evas_Object *parent, const char *part, const char *text)
277 if (parent == NULL) {
278 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
282 /* Set text of target part object */
283 elm_object_part_text_set(parent, part, text);
287 * @brief: Set color of the part
288 * @param[parent]: Object has part to which you want to set color
289 * @param[part]: Name of part to which you want to set color
290 * @param[r]: R of RGBA you want to set to the part
291 * @param[g]: G of RGBA you want to set to the part
292 * @param[b]: B of RGBA you want to set to the part
293 * @param[a]: A of RGBA you want to set to the part
295 void view_set_color(Evas_Object *parent, const char *part, int r, int g, int b, int a)
297 Evas_Object *obj = NULL;
299 if (parent == NULL) {
300 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
304 obj = elm_object_part_content_get(parent, part);
306 dlog_print(DLOG_ERROR, LOG_TAG, "failed to get parent.");
310 /* Set color of target part object */
311 evas_object_color_set(obj, r, g, b, a);
315 * @brief: Make a naviframe and set to parent
316 * @param[parent]: Object to which you want to set naviframe
317 * @Add callback function will be operated when back key is pressed
319 Evas_Object *view_create_naviframe(Evas_Object *parent)
322 * Create and initialize elm_naviframe.
323 * Naviframe stands for navigation frame.
324 * elm_naviframe is a views manager for applications.
326 Evas_Object *nf = NULL;
328 if (parent == NULL) {
329 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
333 nf = elm_naviframe_add(parent);
335 elm_object_part_content_set(parent, "elm.swallow.content", nf);
336 eext_object_event_callback_add(nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);
337 eext_object_event_callback_add(nf, EEXT_CALLBACK_MORE, eext_naviframe_more_cb, NULL);
339 evas_object_show(nf);
346 * @brief: Push item to naviframe
347 * @param[nf]: naviframe
348 * @param[item]: object will be added to naviframe
349 * @param[_pop_cb]: function will be operated when this item is poped from naviframe
350 * @param[cb_data]: data needed to operate '_pop_cb' function
351 * Naviframe make changing of view is easy and effectively
353 Elm_Object_Item* view_push_item_to_naviframe(Evas_Object *nf, Evas_Object *item, Elm_Naviframe_Item_Pop_Cb _pop_cb, void *cb_data)
355 Elm_Object_Item* nf_it = NULL;
358 dlog_print(DLOG_ERROR, LOG_TAG, "naviframe is NULL.");
363 dlog_print(DLOG_ERROR, LOG_TAG, "item is NULL.");
367 nf_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, item, "empty");
370 elm_naviframe_item_pop_cb_set(nf_it, _pop_cb, cb_data);
376 void view_set_more_button(Evas_Object *parent, const char *part)
378 Evas_Object *more_btn = NULL;
380 if (pirent == NULL) {
381 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
385 more_btn = eext_more_option_add(parent);
386 if (more_btn == NULL) {
387 dlog_print(DLOG_ERROR, LOG_TAG, "more option is NULL.");
391 /* Add smart callback */
392 evas_object_smart_callback_add(more_btn, "more,option,opened", _more_option_opened, NULL);
393 evas_object_smart_callback_add(more_btn, "more,option,closed", _more_option_closed, NULL);
394 evas_object_smart_callback_add(more_btn, "item,selected", _item_selected, NULL);
396 elm_object_part_content_set(parent, part, more_btn);
400 * @brief: Make and set button.
401 * @param[parent]: object to which you want to set the button
402 * @param[style]: style of the button
403 * @param[text]: text will be written on the button
404 * @param[image_path]: path of image file will be used as button icon
405 * @param[part]: part name in EDJ to which you want to set the button
406 * @param[down_cb]: function will be operated when the button is pressed
407 * @param[up_cb]: function will be operated when the button is released
408 * @param[clicked_cb]: function will be operated when the button is clicked
409 * @param[data]: data needed in this function
411 void view_set_button(Evas_Object *parent, const char *part, const char *style, const char *image_path, const char *text,
412 Evas_Object_Event_Cb down_cb, Evas_Object_Event_Cb up_cb, Evas_Smart_Cb clicked_cb, void *data)
414 Evas_Object *btn = NULL;
416 if (parent == NULL) {
417 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
421 btn = elm_button_add(parent);
423 dlog_print(DLOG_ERROR, LOG_TAG, "failed to create button.");
428 elm_object_style_set(btn, style);
430 evas_object_size_hint_weight_set(btn ,EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
431 elm_object_part_content_set(parent, part, btn);
434 elm_object_text_set(btn, text);
437 view_set_image(btn, NULL, image_path);
440 evas_object_event_callback_add(btn , EVAS_CALLBACK_MOUSE_DOWN, down_cb, parent);
442 evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_UP, up_cb, parent);
444 evas_object_smart_callback_add(btn, "clicked", clicked_cb, data);
446 evas_object_show(btn);
450 * @brief: Add a more button item
451 * @param[parent]: object that contains more button
452 * @param[main_txt]: text will be written in the middle of the selector
453 * @param[sub_txt] Text will be written under the main_txt
454 * @param[img_path]: path of image file will be used as more button item icon
455 * @param[clicked_cb]: function will be operated when the more button item is clicked
456 * @param[user_data]: data needed in this function
458 void view_add_more_button_item(Evas_Object *parent, const char *part, const char *main_txt, const char *sub_txt, const char *img_path, Evas_Smart_Cb clicked_cb, void *user_data)
460 Evas_Object *img = NULL;
461 Evas_Object *more_btn = NULL;
462 char full_path[PATH_MAX] = { 0, };
464 if (parent == NULL) {
465 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
469 more_btn = elm_object_part_content_get(parent, part);
470 if (more_btn == NULL) {
474 /* Create the new item */
475 Eext_Object_Item *item = eext_more_option_item_append(more_btn);
477 /* Set the text in item text part */
478 eext_more_option_item_part_text_set(item, "selector,main_text", main_txt);
479 eext_more_option_item_part_text_set(item, "selector,sub_text", sub_txt);
481 img = elm_image_add(more_btn);
482 _get_resource(img_path, full_path, sizeof(full_path));
483 elm_image_file_set(img, full_path, NULL);
485 /* Set the content in item content part */
486 eext_more_option_item_part_content_set(item, "item,icon", img);
488 evas_object_smart_callback_add(more_btn, "item,clicked", clicked_cb, user_data);
492 * @brief: Make a Entry Object to target window
493 * @param[parent]: Object to which you want to set Entry
494 * @param[part]: Part of the layout which you want to locate Entry
495 * @param[data]: The user data to be passed to the callback function
496 * @Add callback function will be operated when mouse clicked event is triggered
498 Evas_Object *view_set_entry(Evas_Object *parent, const char *part, void (_clicked_cb)(void *data, Evas_Object *obj, void *event_info), void *data)
500 Evas_Object *entry = NULL;
502 if (parent == NULL) {
503 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
507 /* Add Entry object to parent */
508 entry = elm_entry_add(parent);
510 dlog_print(DLOG_ERROR, LOG_TAG, "failed to add a entry");
514 /* Set Entry size option */
515 evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
517 /* Set Entry option for display and functionalities */
518 elm_entry_single_line_set(entry, EINA_TRUE);
519 elm_entry_scrollable_set(entry, EINA_TRUE);
520 elm_entry_input_panel_enabled_set(entry, EINA_FALSE);
521 elm_entry_editable_set(entry, EINA_FALSE);
522 elm_entry_context_menu_disabled_set(entry, EINA_TRUE);
523 elm_entry_cursor_handler_disabled_set(entry, EINA_TRUE);
524 elm_entry_select_allow_set(entry, EINA_FALSE);
526 /* Set Entry text style using predefined style description */
527 elm_entry_text_style_user_push(entry, DIAL_TEXT_STYLE_NORMAL);
529 elm_object_part_content_set(parent, part, entry);
531 /* Set callback for event about Entry */
533 evas_object_smart_callback_add(entry, "clicked", _clicked_cb, data);
540 * @brief: make genlist for circular shape.
541 * @param[parent]: object to which you want to set genlist
542 * @param[circle_surface]: object render a connected circle object
544 Evas_Object *view_create_circle_genlist(Evas_Object *parent, Eext_Circle_Surface *circle_surface)
546 Evas_Object *genlist = NULL;
547 Evas_Object *circle_genlist = NULL;
549 if (parent == NULL) {
550 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
554 if (circle_surface == NULL) {
555 dlog_print(DLOG_ERROR, LOG_TAG, "circle surface is NULL.");
559 genlist = elm_genlist_add(parent);
560 /* this make selected list item is shown compressed */
561 elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
562 evas_object_smart_callback_add(genlist, "selected", _gl_selected_cb, NULL);
564 /* this make genlist style circular */
565 circle_genlist = eext_circle_object_genlist_add(genlist, circle_surface);
566 eext_circle_object_genlist_scroller_policy_set(circle_genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
567 eext_rotary_object_event_activated_set(circle_genlist, EINA_TRUE);
569 evas_object_show(genlist);
575 * @brief: Add item to genlist.
576 * @param[genlist]: genlist
577 * @param[style]: style of item determine how to show this item, such as "1text", "1text1icon" and so on
578 * @param[data]: item data that use item's callback function
579 * @param[_clicked_cb]: function will be operated when the item is clicked
580 * @param[cb_data]: data needed in '_clicked_cb' function
581 * This make item's class and add item to genlist.
583 Elm_Object_Item *view_append_item_to_genlist(Evas_Object *genlist, const char *style,
584 const void *data, Evas_Smart_Cb _clicked_cb, const void *cb_data)
586 Elm_Genlist_Item_Class *item_class;
587 Elm_Object_Item *item;
589 if (genlist == NULL) {
590 dlog_print(DLOG_ERROR, LOG_TAG, "genlist is NULL.");
595 dlog_print(DLOG_ERROR, LOG_TAG, "item style is NULL.");
599 item_class = _set_genlist_item_class(style);
601 item = elm_genlist_item_append(genlist, item_class, data, NULL, ELM_GENLIST_ITEM_NONE, _clicked_cb, cb_data);
603 elm_genlist_item_class_free(item_class);
609 * @brief: Find item from genlist.
610 * @param[genlist]: genlist
611 * @param[val]: value determine which of the itmes has to remove
613 Elm_Object_Item *view_find_item_from_genlist(Evas_Object *genlist, const char *val)
617 Elm_Object_Item *item = NULL;
618 struct genlist_data *gendata = NULL;
621 dlog_print(DLOG_ERROR, LOG_TAG, "genlist is NULL.");
625 item_count = elm_genlist_items_count(genlist);
628 * The fist item and the last item are "padding".
630 for(i = 1; i < item_count-1; i++) {
631 item = elm_genlist_nth_item_get(genlist, i);
632 gendata = elm_object_item_data_get(item);
634 if (gendata->alarm_id == atoi(val)) {
644 * @brief: Remove item.
645 * @param[item]: item from genlist
647 void view_delete_item(Elm_Object_Item *item)
649 elm_object_item_del(item);
653 * @brief: Make popup with theme.
654 * @param[popup_style]: style of the popup's layout
655 * @param[data]: data needed in this function
657 void view_create_text_popup(Evas_Object *parent, double timeout, const char *text)
659 Evas_Object *popup = NULL;
660 Evas_Object *popup_layout = NULL;
662 if (parent == NULL) {
663 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
667 popup = elm_popup_add(parent);
668 elm_object_style_set(popup, "circle");
669 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
671 eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, _popup_hide_cb, NULL);
673 * Delete popup object in _popup_hide_finished_cb(), when the "dismissed" signal will be called.
675 evas_object_smart_callback_add(popup, "dismissed", _popup_hide_finished_cb, NULL);
677 popup_layout = elm_layout_add(popup);
678 elm_layout_theme_set(popup_layout, "layout", "popup", "content/circle");
680 elm_object_content_set(popup, popup_layout);
682 elm_popup_timeout_set(popup, timeout);
685 view_set_text(popup_layout, "elm.text", text);
687 evas_object_show(popup);
690 void view_set_content_to_part(Evas_Object *layout, const char *part, Evas_Object *content)
692 elm_object_part_content_set(layout, part, content);
695 void view_send_signal_to_edje(Evas_Object *layout, const char *signal, const char *source)
697 elm_object_signal_emit(layout, signal, source);
700 void view_set_customized_event_callback(Evas_Object *item, char *signal, char *source, void (*signal_cb)(void *data, Evas_Object *obj, const char *emission, const char *source), void *user_data)
702 elm_object_signal_callback_add(item, signal, source, signal_cb, user_data);
706 * @brief: Register roatry event callback function.
707 * @param[obj]: object that will receive rotary event
708 * @param[rotary_cb]: function will be operated when rotary event happens
709 * @param[user_data]: data needed in this function
711 void view_set_rotary_event_callback(Evas_Object *obj, Eext_Rotary_Event_Cb rotary_cb, void *user_data)
713 if (parent == NULL) {
714 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
718 eext_rotary_object_event_activated_set(parent, EINA_TRUE);
719 eext_rotary_object_event_callback_add(parent, rotary_cb, user_data);
723 * @brief: Make a label and set label options.
724 * @param[parent]: The object to which you want to add this label
726 Evas_Object *view_create_label(Evas_Object *parent)
728 Evas_Object *label = elm_label_add(parent);
730 if (parent == NULL) {
731 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
735 elm_object_style_set(label, "slide_short");
736 elm_label_wrap_width_set(label, 230);
737 elm_label_ellipsis_set(label, EINA_TRUE);
738 elm_label_slide_duration_set(label, 2);
739 elm_label_slide_mode_set(label, ELM_LABEL_SLIDE_MODE_NONE);
740 elm_label_slide_go(label);
741 evas_object_show(label);
747 * @brief: Set a text to label object
748 * @param[parent]: Object has part to which you want to set text
749 * @param[part]: Part name to which you want to set text
750 * @param[text]: text you want to set to the part
752 void view_set_label_text(Evas_Object *parent, const char *part, const char *text)
754 Evas_Object *label = NULL;
755 char *markup_text = NULL;
756 char buf[256] = { 0, };
758 if (parent == NULL) {
759 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
763 markup_text = elm_entry_utf8_to_markup(text);
764 snprintf(buf, sizeof(buf), "%s%s%s", LABEL_STYLE_START, markup_text, LABEL_STYLE_END);
767 label = elm_object_part_content_get(parent, part);
769 dlog_print(DLOG_ERROR, LOG_TAG, "label is NULL.");
773 elm_object_text_set(label, buf);
777 * @brief: Set a label to given part
778 * @param[parent]: object has part to which you want to set this label
779 * @param[part]: part name to which you want to set this label
781 void view_set_label(Evas_Object *parent, const char *part)
783 Evas_Object *label = NULL;
785 if (parent == NULL) {
786 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
790 label = view_create_label(parent);
792 dlog_print(DLOG_ERROR, LOG_TAG, "label is NULL.");
796 elm_object_part_content_set(parent, "sw.focus.txt", label);
800 * @brief: Set a progressbar to given part
801 * @param[parent]: object has part to which you want to set this progressbar
802 * @param[part]: part name to which you want to set this progressbar
804 void view_set_prgressbar(Evas_Object *parent, const char *part)
806 Evas_Object *progressbar = NULL;
808 if (parent == NULL) {
809 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
813 progressbar = eext_circle_object_progressbar_add(parent, NULL);
815 eext_circle_object_value_min_max_set(progressbar, 0.0, 100.0);
816 eext_circle_object_radius_set(progressbar, 53);
817 eext_circle_object_line_width_set(progressbar, 5);
818 evas_object_show(progressbar);
820 elm_object_part_content_set(parent, part, progressbar);
824 * @brief: Set value to a progressbar
825 * @param[parent]: object has part to which you want to set
826 * @param[part]: part name to which you want to set
827 * @param[val]: value to which you want to set
829 void view_set_progressbar_val(Evas_Object *parent, const char *part, int val)
831 Evas_Object *progressbar = NULL;
833 if (parent == NULL) {
834 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
839 dlog_print(DLOG_ERROR, LOG_TAG, "part is NULL.");
843 progressbar = elm_object_part_content_get(parent, part);
844 if (progressbar == NULL) {
845 dlog_print(DLOG_ERROR, LOG_TAG, "prgressbar is NULL.");
849 eext_circle_object_value_set(progressbar, val);
853 * @brief: Make a checkbox
854 * @param[parent]: The object to which you want to add this checkbox
856 Evas_Object *view_create_checkbox(Evas_Object *parent)
860 if (parent == NULL) {
861 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
865 check = elm_check_add(parent);
866 elm_check_state_set(check, EINA_FALSE);
867 evas_object_smart_callback_add(check, "changed", _icon_clicked_cb, NULL);
868 evas_object_show(check);
874 * @brief: Make no voice memo view
875 * @param[parent]: naviframe
876 * @param[title]: titile of this view
877 * @param[detail]: detail text of this view
878 * @param[image_file]: image file name will be used in this view
879 * This function make a view consists of one title, one center image and one detail text at the bottom
881 Evas_Object *view_create_layout_no_content(Evas_Object *parent, char *title, char *detail, char *image_file)
883 Evas_Object *layout = NULL;
887 if (parent == NULL) {
888 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
892 layout = elm_layout_add(parent);
893 /* this make you can use layout consists of one title, one image and one detail text */
894 elm_layout_theme_set(layout, "layout", "nocontents", "default");
895 evas_object_size_hint_weight_set (layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
896 evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
899 img = elm_image_add(parent);
900 elm_image_file_set(img, image_file, NULL);
901 elm_object_part_content_set(layout, "elm.swallow.icon", img);
902 evas_object_show(img);
906 char detail_text[256] = {0, };
908 /* Customize font style bellow */
909 snprintf(detail_text, sizeof(detail_text), "<font=TIZEN:style=Medium align=center color=#FFFFFF><font_size=28>%s</font_size></font>", detail);
910 elm_object_part_text_set(layout, "elm.text", detail_text);
913 char title_text[256] = {0, };
915 snprintf(title_text, sizeof(title_text), "<font=TIZEN:style=Medium align=center color=#12B4FF><font_size=28>%s</font_size></font>", title);
916 elm_object_part_text_set(layout, "elm.text.title", title_text);
919 /* if this signal is not sent, title text will be disappear */
920 elm_object_signal_emit(layout, "elm,state,title,enable", "elm");
921 /* push this no voice memo view to naviframe to show */
922 it = elm_naviframe_item_push(parent, "Title Enabled", NULL, NULL, layout, NULL);
923 /* if this is EINA_TRUE, you can see Title of naviframe on the top of the screen */
924 elm_naviframe_item_title_enabled_set(it, EINA_FALSE, EINA_FALSE);
930 * @brief: Set datetime to the part.
931 * @param[parent]: object to which you want to set datetime
932 * @param[circle_surface]: object render a connected circle object
933 * @param[part]: part name to which you want to set this datetime
934 * @param[style]: style of the datetime
936 Evas_Object *view_create_datetime(Evas_Object *parent, Eext_Circle_Surface *circle_surface, const char *style)
938 Evas_Object *datetime = NULL;
939 Evas_Object *circle_datetime = NULL;
941 if (parent == NULL) {
942 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
946 if (circle_surface == NULL) {
947 dlog_print(DLOG_ERROR, LOG_TAG, "failed to get circle_surface.");
951 datetime = elm_datetime_add(parent);
952 circle_datetime = eext_circle_object_datetime_add(datetime, circle_surface);
954 eext_rotary_object_event_activated_set(datetime, EINA_TRUE);
955 elm_datetime_format_set(datetime, FORMAT);
957 elm_object_style_set(datetime, style);