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 *edj_path, const char *group_name, Eext_Event_Cb cb_function, void *user_data)
94 Evas_Object *layout = NULL;
97 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
101 /* Create layout by EDC(edje file) */
102 layout = elm_layout_add(parent);
103 elm_layout_file_set(layout, edj_path, group_name);
105 /* Layout size setting */
106 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
109 eext_object_event_callback_add(layout, EEXT_CALLBACK_BACK, cb_function, user_data);
111 evas_object_show(layout);
117 * @brief: Make and set a layout to conformant
118 * @param[parent]: Target conformant object
119 * @param[file_name]: File path of EDJ used
120 * @param[group_name]: Group name in EDJ you want to set to layout
121 * @param[user_data]: The user data to be passed to the callback functions
123 Evas_Object *view_create_layout_for_conformant(Evas_Object *parent, Evas_Object *conformant, const char *file_name, const char *group_name, void *user_data)
125 Evas_Object *layout = NULL;
127 if (parent == NULL) {
128 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
132 /* Create layout for conformant */
133 layout = view_create_layout(parent, file_name, group_name, NULL, user_data);
134 if (layout == NULL) {
135 dlog_print(DLOG_ERROR, LOG_TAG, "layout is NULL.");
139 elm_object_content_set(conformant, layout);
145 * @brief: Make a layout with theme.
146 * @param[parent]: Object to which you want to add this layout
147 * @param[class]: The class of the group
148 * @param[group_name]: Group name in EDJ you want to set to layout
149 * @param[style]: The style to use
151 Evas_Object *view_create_layout_by_theme(Evas_Object *parent, const char *classname, const char *group, const char *style)
155 * Create and initialize elm_layout.
156 * view_create_layout_by_theme() is used to create layout by using premade edje file.
158 Evas_Object *layout = NULL;
160 if (parent == NULL) {
161 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
165 layout = elm_layout_add(parent);
166 elm_layout_theme_set(layout, classname, group, style);
167 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
169 evas_object_show(layout);
175 * @brief: Make and set a layout to the part
176 * @param[parent]: Object to which you want to set this layout
177 * @param[file_name]: File path of EDJ used
178 * @param[group_name]: Group name in EDJ you want to set to layout
179 * @param[part]: Part name to which you want to set this layout
181 Evas_Object *view_create_layout_for_part(Evas_Object *parent, char *part, char *file_name, char *group_name)
183 Evas_Object *layout = NULL;
185 if (parent == NULL) {
186 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
190 layout = elm_layout_add(parent);
191 elm_layout_file_set(layout, file_name, group_name);
192 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
194 evas_object_show(layout);
196 elm_object_part_content_set(parent, part, layout);
202 * @brief: Destroy window and free important data to finish this app
203 * @param[ad]: The object has informations for managing this app
205 void view_destroy(void *user_data)
207 appdata_s *ad = NULL;
211 dlog_print(DLOG_ERROR, LOG_TAG, "failed to destroy data.");
215 evas_object_del(ad->win);
219 * @brief: Destroy given layout
220 * @param[layout]: The layout you want to destroy
222 void view_destroy_layout(Evas_Object *layout)
224 evas_object_del(layout);
228 * @brief: Set image to given part
229 * @param[parent]: object has part to which you want to set this image
230 * @param[part]: part name to which you want to set this image
231 * @param[image_path]: path of image file
233 void view_set_image(Evas_Object *parent, const char *part, const char *image_path)
235 Evas_Object *image = NULL;
237 if (parent == NULL) {
238 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
242 image = elm_object_part_content_get(parent, part);
244 image = elm_image_add(parent);
246 dlog_print(DLOG_ERROR, LOG_TAG, "failed to create an image object.");
251 if (EINA_FALSE == elm_image_file_set(image, image_path, NULL)) {
252 dlog_print(DLOG_ERROR, LOG_TAG, "failed to set image.");
257 elm_object_part_content_set(parent, part, image);
259 elm_object_content_set(parent, image);
262 evas_object_show(image);
268 * @brief: Set text to the part
269 * @param[parent]: Object has part to which you want to set text
270 * @param[part]: Part name to which you want to set text
271 * @param[text]: text you want to set to the part
273 void view_set_text(Evas_Object *parent, const char *part, const char *text)
275 if (parent == NULL) {
276 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
280 /* Set text of target part object */
281 elm_object_part_text_set(parent, part, text);
285 * @brief: Set color of the part
286 * @param[parent]: Object has part to which you want to set color
287 * @param[part]: Name of part to which you want to set color
288 * @param[r]: R of RGBA you want to set to the part
289 * @param[g]: G of RGBA you want to set to the part
290 * @param[b]: B of RGBA you want to set to the part
291 * @param[a]: A of RGBA you want to set to the part
293 void view_set_color(Evas_Object *parent, const char *part, int r, int g, int b, int a)
295 Evas_Object *obj = NULL;
297 if (parent == NULL) {
298 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
302 obj = elm_object_part_content_get(parent, part);
304 dlog_print(DLOG_ERROR, LOG_TAG, "failed to get parent.");
308 /* Set color of target part object */
309 evas_object_color_set(obj, r, g, b, a);
313 * @brief: Make a naviframe and set to parent
314 * @param[parent]: Object to which you want to set naviframe
315 * @Add callback function will be operated when back key is pressed
317 Evas_Object *view_create_naviframe(Evas_Object *parent)
320 * Create and initialize elm_naviframe.
321 * Naviframe stands for navigation frame.
322 * elm_naviframe is a views manager for applications.
324 Evas_Object *nf = NULL;
326 if (parent == NULL) {
327 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
331 nf = elm_naviframe_add(parent);
333 elm_object_part_content_set(parent, "elm.swallow.content", nf);
334 eext_object_event_callback_add(nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);
335 eext_object_event_callback_add(nf, EEXT_CALLBACK_MORE, eext_naviframe_more_cb, NULL);
337 evas_object_show(nf);
344 * @brief: Push item to naviframe
345 * @param[nf]: naviframe
346 * @param[item]: object will be added to naviframe
347 * @param[_pop_cb]: function will be operated when this item is poped from naviframe
348 * @param[cb_data]: data needed to operate '_pop_cb' function
349 * Naviframe make changing of view is easy and effectively
351 Elm_Object_Item* view_push_item_to_naviframe(Evas_Object *nf, Evas_Object *item, Elm_Naviframe_Item_Pop_Cb _pop_cb, void *cb_data)
353 Elm_Object_Item* nf_it = NULL;
356 dlog_print(DLOG_ERROR, LOG_TAG, "naviframe is NULL.");
361 dlog_print(DLOG_ERROR, LOG_TAG, "item is NULL.");
365 nf_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, item, "empty");
368 elm_naviframe_item_pop_cb_set(nf_it, _pop_cb, cb_data);
374 void view_set_more_button(Evas_Object *parent, const char *part)
376 Evas_Object *more_btn = NULL;
378 if (pirent == NULL) {
379 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
383 more_btn = eext_more_option_add(parent);
384 if (more_btn == NULL) {
385 dlog_print(DLOG_ERROR, LOG_TAG, "more option is NULL.");
389 /* Add smart callback */
390 evas_object_smart_callback_add(more_btn, "more,option,opened", _more_option_opened, NULL);
391 evas_object_smart_callback_add(more_btn, "more,option,closed", _more_option_closed, NULL);
392 evas_object_smart_callback_add(more_btn, "item,selected", _item_selected, NULL);
394 elm_object_part_content_set(parent, part, more_btn);
398 * @brief: Make and set button.
399 * @param[parent]: object to which you want to set the button
400 * @param[style]: style of the button
401 * @param[text]: text will be written on the button
402 * @param[image_path]: path of image file will be used as button icon
403 * @param[part]: part name in EDJ to which you want to set the button
404 * @param[down_cb]: function will be operated when the button is pressed
405 * @param[up_cb]: function will be operated when the button is released
406 * @param[clicked_cb]: function will be operated when the button is clicked
407 * @param[data]: data needed in this function
409 void view_set_button(Evas_Object *parent, const char *part, const char *style, const char *image_path, const char *text,
410 Evas_Object_Event_Cb down_cb, Evas_Object_Event_Cb up_cb, Evas_Smart_Cb clicked_cb, void *data)
412 Evas_Object *btn = NULL;
414 if (parent == NULL) {
415 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
419 btn = elm_button_add(parent);
421 dlog_print(DLOG_ERROR, LOG_TAG, "failed to create button.");
426 elm_object_style_set(btn, style);
428 evas_object_size_hint_weight_set(btn ,EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
429 elm_object_part_content_set(parent, part, btn);
432 elm_object_text_set(btn, text);
435 view_set_image(btn, NULL, image_path);
438 evas_object_event_callback_add(btn , EVAS_CALLBACK_MOUSE_DOWN, down_cb, parent);
440 evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_UP, up_cb, parent);
442 evas_object_smart_callback_add(btn, "clicked", clicked_cb, data);
444 evas_object_show(btn);
448 * @brief: Add a more button item
449 * @param[parent]: object that contains more button
450 * @param[main_txt]: text will be written in the middle of the selector
451 * @param[sub_txt] Text will be written under the main_txt
452 * @param[img_path]: path of image file will be used as more button item icon
453 * @param[clicked_cb]: function will be operated when the more button item is clicked
454 * @param[user_data]: data needed in this function
456 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)
458 Evas_Object *img = NULL;
459 Evas_Object *more_btn = NULL;
460 char full_path[PATH_MAX] = { 0, };
462 if (parent == NULL) {
463 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
467 more_btn = elm_object_part_content_get(parent, part);
468 if (more_btn == NULL) {
472 /* Create the new item */
473 Eext_Object_Item *item = eext_more_option_item_append(more_btn);
475 /* Set the text in item text part */
476 eext_more_option_item_part_text_set(item, "selector,main_text", main_txt);
477 eext_more_option_item_part_text_set(item, "selector,sub_text", sub_txt);
479 img = elm_image_add(more_btn);
480 _get_resource(img_path, full_path, sizeof(full_path));
481 elm_image_file_set(img, full_path, NULL);
483 /* Set the content in item content part */
484 eext_more_option_item_part_content_set(item, "item,icon", img);
486 evas_object_smart_callback_add(more_btn, "item,clicked", clicked_cb, user_data);
490 * @brief: Make a Entry Object to target window
491 * @param[parent]: Object to which you want to set Entry
492 * @param[part]: Part of the layout which you want to locate Entry
493 * @param[data]: The user data to be passed to the callback function
494 * @Add callback function will be operated when mouse clicked event is triggered
496 Evas_Object *view_set_entry(Evas_Object *parent, const char *part, void (_clicked_cb)(void *data, Evas_Object *obj, void *event_info), void *data)
498 Evas_Object *entry = NULL;
500 if (parent == NULL) {
501 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
505 /* Add Entry object to parent */
506 entry = elm_entry_add(parent);
508 dlog_print(DLOG_ERROR, LOG_TAG, "failed to add a entry");
512 /* Set Entry size option */
513 evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
515 /* Set Entry option for display and functionalities */
516 elm_entry_single_line_set(entry, EINA_TRUE);
517 elm_entry_scrollable_set(entry, EINA_TRUE);
518 elm_entry_input_panel_enabled_set(entry, EINA_FALSE);
519 elm_entry_editable_set(entry, EINA_FALSE);
520 elm_entry_context_menu_disabled_set(entry, EINA_TRUE);
521 elm_entry_cursor_handler_disabled_set(entry, EINA_TRUE);
522 elm_entry_select_allow_set(entry, EINA_FALSE);
524 /* Set Entry text style using predefined style description */
525 elm_entry_text_style_user_push(entry, DIAL_TEXT_STYLE_NORMAL);
527 elm_object_part_content_set(parent, part, entry);
529 /* Set callback for event about Entry */
531 evas_object_smart_callback_add(entry, "clicked", _clicked_cb, data);
538 * @brief: make genlist for circular shape.
539 * @param[parent]: object to which you want to set genlist
540 * @param[circle_surface]: object render a connected circle object
542 Evas_Object *view_create_circle_genlist(Evas_Object *parent, Eext_Circle_Surface *circle_surface)
544 Evas_Object *genlist = NULL;
545 Evas_Object *circle_genlist = NULL;
547 if (parent == NULL) {
548 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
552 if (circle_surface == NULL) {
553 dlog_print(DLOG_ERROR, LOG_TAG, "circle surface is NULL.");
557 genlist = elm_genlist_add(parent);
558 /* this make selected list item is shown compressed */
559 elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
560 evas_object_smart_callback_add(genlist, "selected", _gl_selected_cb, NULL);
562 /* this make genlist style circular */
563 circle_genlist = eext_circle_object_genlist_add(genlist, circle_surface);
564 eext_circle_object_genlist_scroller_policy_set(circle_genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
565 eext_rotary_object_event_activated_set(circle_genlist, EINA_TRUE);
567 evas_object_show(genlist);
573 * @brief: Add item to genlist.
574 * @param[genlist]: genlist
575 * @param[style]: style of item determine how to show this item, such as "1text", "1text1icon" and so on
576 * @param[data]: item data that use item's callback function
577 * @param[_clicked_cb]: function will be operated when the item is clicked
578 * @param[cb_data]: data needed in '_clicked_cb' function
579 * This make item's class and add item to genlist.
581 Elm_Object_Item *view_append_item_to_genlist(Evas_Object *genlist, const char *style,
582 const void *data, Evas_Smart_Cb _clicked_cb, const void *cb_data)
584 Elm_Genlist_Item_Class *item_class;
585 Elm_Object_Item *item;
587 if (genlist == NULL) {
588 dlog_print(DLOG_ERROR, LOG_TAG, "genlist is NULL.");
593 dlog_print(DLOG_ERROR, LOG_TAG, "item style is NULL.");
597 item_class = _set_genlist_item_class(style);
599 item = elm_genlist_item_append(genlist, item_class, data, NULL, ELM_GENLIST_ITEM_NONE, _clicked_cb, cb_data);
601 elm_genlist_item_class_free(item_class);
607 * @brief: Find item from genlist.
608 * @param[genlist]: genlist
609 * @param[val]: value determine which of the itmes has to remove
611 Elm_Object_Item *view_find_item_from_genlist(Evas_Object *genlist, const char *val)
615 Elm_Object_Item *item = NULL;
616 struct genlist_data *gendata = NULL;
619 dlog_print(DLOG_ERROR, LOG_TAG, "genlist is NULL.");
623 item_count = elm_genlist_items_count(genlist);
626 * The fist item and the last item are "padding".
628 for(i = 1; i < item_count-1; i++) {
629 item = elm_genlist_nth_item_get(genlist, i);
630 gendata = elm_object_item_data_get(item);
632 if (gendata->alarm_id == atoi(val)) {
642 * @brief: Remove item.
643 * @param[item]: item from genlist
645 void view_delete_item(Elm_Object_Item *item)
647 elm_object_item_del(item);
651 * @brief: Make popup with theme.
652 * @param[popup_style]: style of the popup's layout
653 * @param[data]: data needed in this function
655 void view_create_text_popup(Evas_Object *parent, double timeout, const char *text)
657 Evas_Object *popup = NULL;
658 Evas_Object *popup_layout = NULL;
660 if (parent == NULL) {
661 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
665 popup = elm_popup_add(parent);
666 elm_object_style_set(popup, "circle");
667 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
669 eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, _popup_hide_cb, NULL);
671 * Delete popup object in _popup_hide_finished_cb(), when the "dismissed" signal will be called.
673 evas_object_smart_callback_add(popup, "dismissed", _popup_hide_finished_cb, NULL);
675 popup_layout = elm_layout_add(popup);
676 elm_layout_theme_set(popup_layout, "layout", "popup", "content/circle");
678 elm_object_content_set(popup, popup_layout);
680 elm_popup_timeout_set(popup, timeout);
683 view_set_text(popup_layout, "elm.text", text);
685 evas_object_show(popup);
688 void view_set_content_to_part(Evas_Object *layout, const char *part, Evas_Object *content)
690 elm_object_part_content_set(layout, part, content);
693 void view_send_signal_to_edje(Evas_Object *layout, const char *signal, const char *source)
695 elm_object_signal_emit(layout, signal, source);
698 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)
700 elm_object_signal_callback_add(item, signal, source, signal_cb, user_data);
704 * @brief: Register roatry event callback function.
705 * @param[obj]: object that will receive rotary event
706 * @param[rotary_cb]: function will be operated when rotary event happens
707 * @param[user_data]: data needed in this function
709 void view_set_rotary_event_callback(Evas_Object *obj, Eext_Rotary_Event_Cb rotary_cb, void *user_data)
712 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
716 eext_rotary_object_event_activated_set(obj, EINA_TRUE);
717 eext_rotary_object_event_callback_add(obj, rotary_cb, user_data);
721 * @brief: Make a label and set label options.
722 * @param[parent]: The object to which you want to add this label
724 Evas_Object *view_create_label(Evas_Object *parent)
726 Evas_Object *label = elm_label_add(parent);
728 if (parent == NULL) {
729 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
733 elm_object_style_set(label, "slide_short");
734 elm_label_wrap_width_set(label, 230);
735 elm_label_ellipsis_set(label, EINA_TRUE);
736 elm_label_slide_duration_set(label, 2);
737 elm_label_slide_mode_set(label, ELM_LABEL_SLIDE_MODE_NONE);
738 elm_label_slide_go(label);
739 evas_object_show(label);
745 * @brief: Set a text to label object
746 * @param[parent]: Object has part to which you want to set text
747 * @param[part]: Part name to which you want to set text
748 * @param[text]: text you want to set to the part
750 void view_set_label_text(Evas_Object *parent, const char *part, const char *text)
752 Evas_Object *label = NULL;
753 char *markup_text = NULL;
754 char buf[256] = { 0, };
756 if (parent == NULL) {
757 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
761 markup_text = elm_entry_utf8_to_markup(text);
762 snprintf(buf, sizeof(buf), "%s%s%s", LABEL_STYLE_START, markup_text, LABEL_STYLE_END);
765 label = elm_object_part_content_get(parent, part);
767 dlog_print(DLOG_ERROR, LOG_TAG, "label is NULL.");
771 elm_object_text_set(label, buf);
775 * @brief: Set a label to given part
776 * @param[parent]: object has part to which you want to set this label
777 * @param[part]: part name to which you want to set this label
779 void view_set_label(Evas_Object *parent, const char *part)
781 Evas_Object *label = NULL;
783 if (parent == NULL) {
784 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
788 label = view_create_label(parent);
790 dlog_print(DLOG_ERROR, LOG_TAG, "label is NULL.");
794 elm_object_part_content_set(parent, "sw.focus.txt", label);
798 * @brief: Set a progressbar to given part
799 * @param[parent]: object has part to which you want to set this progressbar
800 * @param[part]: part name to which you want to set this progressbar
802 void view_set_prgressbar(Evas_Object *parent, const char *part)
804 Evas_Object *progressbar = NULL;
806 if (parent == NULL) {
807 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
811 progressbar = eext_circle_object_progressbar_add(parent, NULL);
813 eext_circle_object_value_min_max_set(progressbar, 0.0, 100.0);
814 eext_circle_object_radius_set(progressbar, 53);
815 eext_circle_object_line_width_set(progressbar, 5);
816 evas_object_show(progressbar);
818 elm_object_part_content_set(parent, part, progressbar);
822 * @brief: Set value to a progressbar
823 * @param[parent]: object has part to which you want to set
824 * @param[part]: part name to which you want to set
825 * @param[val]: value to which you want to set
827 void view_set_progressbar_val(Evas_Object *parent, const char *part, int val)
829 Evas_Object *progressbar = NULL;
831 if (parent == NULL) {
832 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
837 dlog_print(DLOG_ERROR, LOG_TAG, "part is NULL.");
841 progressbar = elm_object_part_content_get(parent, part);
842 if (progressbar == NULL) {
843 dlog_print(DLOG_ERROR, LOG_TAG, "prgressbar is NULL.");
847 eext_circle_object_value_set(progressbar, val);
851 * @brief: Make a checkbox
852 * @param[parent]: The object to which you want to add this checkbox
854 Evas_Object *view_create_checkbox(Evas_Object *parent)
858 if (parent == NULL) {
859 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
863 check = elm_check_add(parent);
864 elm_check_state_set(check, EINA_FALSE);
865 evas_object_smart_callback_add(check, "changed", _icon_clicked_cb, NULL);
866 evas_object_show(check);
872 * @brief: Make no voice memo view
873 * @param[parent]: naviframe
874 * @param[title]: titile of this view
875 * @param[detail]: detail text of this view
876 * @param[image_file]: image file name will be used in this view
877 * This function make a view consists of one title, one center image and one detail text at the bottom
879 Evas_Object *view_create_layout_no_content(Evas_Object *parent, char *title, char *detail, char *image_file)
881 Evas_Object *layout = NULL;
885 if (parent == NULL) {
886 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
890 layout = elm_layout_add(parent);
891 /* this make you can use layout consists of one title, one image and one detail text */
892 elm_layout_theme_set(layout, "layout", "nocontents", "default");
893 evas_object_size_hint_weight_set (layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
894 evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
897 img = elm_image_add(parent);
898 elm_image_file_set(img, image_file, NULL);
899 elm_object_part_content_set(layout, "elm.swallow.icon", img);
900 evas_object_show(img);
904 char detail_text[256] = {0, };
906 /* Customize font style bellow */
907 snprintf(detail_text, sizeof(detail_text), "<font=TIZEN:style=Medium align=center color=#FFFFFF><font_size=28>%s</font_size></font>", detail);
908 elm_object_part_text_set(layout, "elm.text", detail_text);
911 char title_text[256] = {0, };
913 snprintf(title_text, sizeof(title_text), "<font=TIZEN:style=Medium align=center color=#12B4FF><font_size=28>%s</font_size></font>", title);
914 elm_object_part_text_set(layout, "elm.text.title", title_text);
917 /* if this signal is not sent, title text will be disappear */
918 elm_object_signal_emit(layout, "elm,state,title,enable", "elm");
919 /* push this no voice memo view to naviframe to show */
920 it = elm_naviframe_item_push(parent, "Title Enabled", NULL, NULL, layout, NULL);
921 /* if this is EINA_TRUE, you can see Title of naviframe on the top of the screen */
922 elm_naviframe_item_title_enabled_set(it, EINA_FALSE, EINA_FALSE);
928 * @brief: Set datetime to the part.
929 * @param[parent]: object to which you want to set datetime
930 * @param[circle_surface]: object render a connected circle object
931 * @param[part]: part name to which you want to set this datetime
932 * @param[style]: style of the datetime
934 Evas_Object *view_create_datetime(Evas_Object *parent, Eext_Circle_Surface *circle_surface, const char *style)
936 Evas_Object *datetime = NULL;
937 Evas_Object *circle_datetime = NULL;
939 if (parent == NULL) {
940 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
944 if (circle_surface == NULL) {
945 dlog_print(DLOG_ERROR, LOG_TAG, "failed to get circle_surface.");
949 datetime = elm_datetime_add(parent);
950 circle_datetime = eext_circle_object_datetime_add(datetime, circle_surface);
952 eext_rotary_object_event_activated_set(datetime, EINA_TRUE);
953 elm_datetime_format_set(datetime, FORMAT);
955 elm_object_style_set(datetime, style);