2 * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
4 * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
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.
18 * @brief: Create Essential Object window, conformant and layout
19 * @param[ad]: Structure has some important information for managing this application
21 void view_create(appdata_s *ad)
24 dlog_print(DLOG_ERROR, LOG_TAG, "appdata is NULL.");
29 ad->win = view_create_win(PACKAGE);
30 if (ad->win == NULL) {
31 dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a window.");
35 /* Create conformant */
36 ad->conform = view_create_conformant_without_indicator(ad->win);
37 if (ad->conform == NULL) {
38 dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a conformant");
42 /* Show window after main view is set up */
43 evas_object_show(ad->win);
47 * @brief: Make a basic window named package
48 * @param[package]: Name of the window
50 Evas_Object *view_create_win(const char *pkg_name)
52 Evas_Object *win = NULL;
55 /* Create and initialize elm_win.
56 elm_win is mandatory to manipulate window. */
58 win = elm_win_util_standard_add(pkg_name, pkg_name);
59 elm_win_conformant_set(win, EINA_TRUE);
60 elm_win_autodel_set(win, EINA_TRUE);
62 /* Rotation setting */
63 if (elm_win_wm_rotation_supported_get(win)) {
64 int rots[4] = { 0, 90, 180, 270 };
65 elm_win_wm_rotation_available_rotations_set(win, (const int *)(&rots), 4);
68 evas_object_smart_callback_add(win, "delete,request", _win_delete_request_cb, NULL);
74 * @brief: Make a conformant without indicator for wearable app
75 * @param[win]: The object to which you want to set this conformant
76 * Confromant is mandatory for base GUI to have proper size
78 Evas_Object *view_create_conformant_without_indicator(Evas_Object *win)
81 * Create and initialize elm_conformant.
82 * elm_conformant is mandatory for base GUI to have proper size
83 * when indicator or virtual keypad is visible.
85 Evas_Object *conform = NULL;
88 dlog_print(DLOG_ERROR, LOG_TAG, "window is NULL.");
92 conform = elm_conformant_add(win);
93 evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
94 elm_win_resize_object_add(win, conform);
96 evas_object_show(conform);
102 * @brief: Make a layout to target parent object with edje file
103 * @param[parent]: The object to which you want to add this layout
104 * @param[file_name]: File path of EDJ
105 * @param[group_name]: Name of group in EDJ you want to set to
106 * @param[Evas_Object_Event_Cb]: File path of EDJ
107 * @param[user_data]: The user data to be passed to the callback functions
109 Evas_Object *view_create_layout(Evas_Object *parent, const char *edj_path, const char *group_name, Eext_Event_Cb cb_function, void *user_data)
111 Evas_Object *layout = NULL;
113 if (parent == NULL) {
114 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
118 /* Create layout by EDC(edje file) */
119 layout = elm_layout_add(parent);
120 elm_layout_file_set(layout, edj_path, group_name);
122 /* Layout size setting */
123 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
126 eext_object_event_callback_add(layout, EEXT_CALLBACK_BACK, cb_function, user_data);
128 evas_object_show(layout);
134 * @brief: Make and set a layout to conformant
135 * @param[parent]: Target conformant object
136 * @param[file_name]: File path of EDJ used
137 * @param[group_name]: Group name in EDJ you want to set to layout
138 * @param[cb_function]: Callback for back event handling
139 * @param[user_data]: The user data to be passed to the callback functions
141 Evas_Object *view_create_layout_for_conformant(Evas_Object *parent, const char *file_name, const char *group_name, Eext_Event_Cb cb_function, void *user_data)
143 Evas_Object *layout = NULL;
145 if (parent == NULL) {
146 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
150 /* Create layout for conformant */
151 layout = view_create_layout(parent, file_name, group_name, cb_function, user_data);
152 if (layout == NULL) {
153 dlog_print(DLOG_ERROR, LOG_TAG, "layout is NULL.");
157 elm_object_content_set(parent, layout);
163 * @brief: Make a layout with theme.
164 * @param[parent]: Object to which you want to add this layout
165 * @param[class]: The class of the group
166 * @param[group_name]: Group name in EDJ you want to set to layout
167 * @param[style]: The style to use
169 Evas_Object *view_create_layout_by_theme(Evas_Object *parent, const char *classname, const char *group, const char *style)
173 * Create and initialize elm_layout.
174 * view_create_layout_by_theme() is used to create layout by using premade edje file.
176 Evas_Object *layout = NULL;
178 if (parent == NULL) {
179 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
183 layout = elm_layout_add(parent);
184 elm_layout_theme_set(layout, classname, group, style);
185 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
187 evas_object_show(layout);
193 * @brief: Make and set a layout to the part
194 * @param[parent]: Object to which you want to set this layout
195 * @param[file_name]: File path of EDJ used
196 * @param[group_name]: Group name in EDJ you want to set to layout
197 * @param[part]: Part name to which you want to set this layout
199 Evas_Object *view_create_layout_for_part(Evas_Object *parent, char *part, char *file_name, char *group_name)
201 Evas_Object *layout = NULL;
203 if (parent == NULL) {
204 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
208 layout = elm_layout_add(parent);
209 elm_layout_file_set(layout, file_name, group_name);
210 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
212 evas_object_show(layout);
214 elm_object_part_content_set(parent, part, layout);
220 * @brief: Destroy window and free important data to finish this application
221 * @param[user_data]: Structure has informations for managing this application
223 void view_destroy(void *user_data)
225 appdata_s *ad = NULL;
229 dlog_print(DLOG_ERROR, LOG_TAG, "failed to destroy data.");
233 evas_object_del(ad->win);
237 * @brief: Destroy given layout
238 * @param[layout]: The layout you want to destroy
240 void view_destroy_layout(Evas_Object *layout)
242 evas_object_del(layout);
246 * @brief: Set image to given part
247 * @param[parent]: object has part to which you want to set this image
248 * @param[part]: part name to which you want to set this image
249 * @param[image_path]: path of image file
251 void view_set_image(Evas_Object *parent, const char *part, const char *image_path)
253 Evas_Object *image = NULL;
255 if (parent == NULL) {
256 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
260 image = elm_object_part_content_get(parent, part);
262 image = elm_image_add(parent);
264 dlog_print(DLOG_ERROR, LOG_TAG, "failed to create an image object.");
269 if (EINA_FALSE == elm_image_file_set(image, image_path, NULL)) {
270 dlog_print(DLOG_ERROR, LOG_TAG, "failed to set image.");
275 elm_object_part_content_set(parent, part, image);
277 elm_object_content_set(parent, image);
280 evas_object_show(image);
286 * @brief: Set text to the part
287 * @param[parent]: Object has part to which you want to set text
288 * @param[part]: Part name to which you want to set text
289 * @param[text]: text you want to set to the part
291 void view_set_text(Evas_Object *parent, const char *part, const char *text)
293 if (parent == NULL) {
294 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
298 /* Set text of target part object */
299 elm_object_part_text_set(parent, part, text);
303 * @brief: Set color of the part
304 * @param[parent]: Object has part to which you want to set color
305 * @param[part]: Name of part to which you want to set color
306 * @param[r]: R of RGBA you want to set to the part
307 * @param[g]: G of RGBA you want to set to the part
308 * @param[b]: B of RGBA you want to set to the part
309 * @param[a]: A of RGBA you want to set to the part
311 void view_set_color(Evas_Object *parent, const char *part, int r, int g, int b, int a)
313 Evas_Object *obj = NULL;
315 if (parent == NULL) {
316 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
320 obj = elm_object_part_content_get(parent, part);
322 dlog_print(DLOG_ERROR, LOG_TAG, "failed to get parent.");
326 /* Set color of target part object */
327 evas_object_color_set(obj, r, g, b, a);
331 * @brief: Make a naviframe and set to parent
332 * @param[parent]: Object to which you want to set naviframe
333 * @Add callback function will be operated when back key is pressed
335 Evas_Object *view_create_naviframe(Evas_Object *parent)
338 * Create and initialize elm_naviframe.
339 * Naviframe stands for navigation frame.
340 * elm_naviframe is a views manager for applications.
342 Evas_Object *nf = NULL;
344 if (parent == NULL) {
345 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
349 nf = elm_naviframe_add(parent);
351 elm_object_part_content_set(parent, "elm.swallow.content", nf);
352 eext_object_event_callback_add(nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);
353 eext_object_event_callback_add(nf, EEXT_CALLBACK_MORE, eext_naviframe_more_cb, NULL);
355 evas_object_show(nf);
361 * @brief: Push item to naviframe
362 * @param[nf]: naviframe
363 * @param[item]: object will be added to naviframe
364 * @param[_pop_cb]: function will be operated when this item is poped from naviframe
365 * @param[cb_data]: data needed to operate '_pop_cb' function
366 * Naviframe make changing of view is easy and effectively
368 Elm_Object_Item* view_push_item_to_naviframe(Evas_Object *nf, Evas_Object *item, Elm_Naviframe_Item_Pop_Cb _pop_cb, void *cb_data)
370 Elm_Object_Item* nf_it = NULL;
373 dlog_print(DLOG_ERROR, LOG_TAG, "naviframe is NULL.");
378 dlog_print(DLOG_ERROR, LOG_TAG, "item is NULL.");
382 nf_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, item, "empty");
385 elm_naviframe_item_pop_cb_set(nf_it, _pop_cb, cb_data);
390 void view_set_more_button(Evas_Object *parent, const char *part)
392 Evas_Object *more_btn = NULL;
394 if (pirent == NULL) {
395 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
399 more_btn = eext_more_option_add(parent);
400 if (more_btn == NULL) {
401 dlog_print(DLOG_ERROR, LOG_TAG, "more option is NULL.");
405 /* Add smart callback */
406 evas_object_smart_callback_add(more_btn, "more,option,opened", _more_option_opened, NULL);
407 evas_object_smart_callback_add(more_btn, "more,option,closed", _more_option_closed, NULL);
408 evas_object_smart_callback_add(more_btn, "item,selected", _item_selected, NULL);
410 elm_object_part_content_set(parent, part, more_btn);
414 * @brief: Make and set button.
415 * @param[parent]: object to which you want to set the button
416 * @param[style]: style of the button
417 * @param[text]: text will be written on the button
418 * @param[image_path]: path of image file will be used as button icon
419 * @param[part]: part name in EDJ to which you want to set the button
420 * @param[down_cb]: function will be operated when the button is pressed
421 * @param[up_cb]: function will be operated when the button is released
422 * @param[clicked_cb]: function will be operated when the button is clicked
423 * @param[data]: data needed in this function
425 void view_set_button(Evas_Object *parent, const char *part, const char *style, const char *image_path, const char *text,
426 Evas_Object_Event_Cb down_cb, Evas_Object_Event_Cb up_cb, Evas_Smart_Cb clicked_cb, void *data)
428 Evas_Object *btn = NULL;
430 if (parent == NULL) {
431 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
435 btn = elm_button_add(parent);
437 dlog_print(DLOG_ERROR, LOG_TAG, "failed to create button.");
442 elm_object_style_set(btn, style);
444 evas_object_size_hint_weight_set(btn ,EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
445 elm_object_part_content_set(parent, part, btn);
448 elm_object_text_set(btn, text);
451 view_set_image(btn, NULL, image_path);
454 evas_object_event_callback_add(btn , EVAS_CALLBACK_MOUSE_DOWN, down_cb, data);
456 evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_UP, up_cb, data);
458 evas_object_smart_callback_add(btn, "clicked", clicked_cb, data);
460 evas_object_show(btn);
464 * @brief: Add a more button item
465 * @param[parent]: object that contains more button
466 * @param[main_txt]: text will be written in the middle of the selector
467 * @param[sub_txt] Text will be written under the main_txt
468 * @param[img_path]: path of image file will be used as more button item icon
469 * @param[clicked_cb]: function will be operated when the more button item is clicked
470 * @param[user_data]: data needed in this function
472 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)
474 Evas_Object *img = NULL;
475 Evas_Object *more_btn = NULL;
476 char full_path[PATH_MAX] = { 0, };
478 if (parent == NULL) {
479 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
483 more_btn = elm_object_part_content_get(parent, part);
484 if (more_btn == NULL) {
488 /* Create the new item */
489 Eext_Object_Item *item = eext_more_option_item_append(more_btn);
491 /* Set the text in item text part */
492 eext_more_option_item_part_text_set(item, "selector,main_text", main_txt);
493 eext_more_option_item_part_text_set(item, "selector,sub_text", sub_txt);
495 img = elm_image_add(more_btn);
496 _get_resource(img_path, full_path, sizeof(full_path));
497 elm_image_file_set(img, full_path, NULL);
499 /* Set the content in item content part */
500 eext_more_option_item_part_content_set(item, "item,icon", img);
502 evas_object_smart_callback_add(more_btn, "item,clicked", clicked_cb, user_data);
506 * @brief: Make a Entry Object to target window
507 * @param[parent]: Object to which you want to set Entry
508 * @param[part]: Part of the layout which you want to locate Entry
509 * @param[data]: The user data to be passed to the callback function
510 * @Add callback function will be operated when mouse clicked event is triggered
512 Evas_Object *view_set_entry(Evas_Object *parent, const char *part, void (*_clicked_cb)(void *data, Evas_Object *obj, void *event_info), void *data)
514 Evas_Object *entry = NULL;
516 if (parent == NULL) {
517 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
521 /* Add Entry object to parent */
522 entry = elm_entry_add(parent);
524 dlog_print(DLOG_ERROR, LOG_TAG, "failed to add a entry");
528 /* Set Entry size option */
529 evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
531 /* Set Entry option for display and functionalities */
532 elm_entry_single_line_set(entry, EINA_TRUE);
533 elm_entry_scrollable_set(entry, EINA_TRUE);
534 elm_entry_input_panel_enabled_set(entry, EINA_FALSE);
535 elm_entry_editable_set(entry, EINA_FALSE);
536 elm_entry_context_menu_disabled_set(entry, EINA_TRUE);
537 elm_entry_cursor_handler_disabled_set(entry, EINA_TRUE);
538 elm_entry_select_allow_set(entry, EINA_FALSE);
540 /* Set Entry text style using predefined style description */
541 elm_entry_text_style_user_push(entry, DIAL_TEXT_STYLE_NORMAL);
543 elm_object_part_content_set(parent, part, entry);
545 /* Set callback for event about Entry */
547 evas_object_smart_callback_add(entry, "clicked", _clicked_cb, data);
554 * @brief: make genlist for circular shape.
555 * @param[parent]: object to which you want to set genlist
556 * @param[circle_surface]: object render a connected circle object
558 Evas_Object *view_create_circle_genlist(Evas_Object *parent, Eext_Circle_Surface *circle_surface)
560 Evas_Object *genlist = NULL;
561 Evas_Object *circle_genlist = NULL;
563 if (parent == NULL) {
564 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
568 if (circle_surface == NULL) {
569 dlog_print(DLOG_ERROR, LOG_TAG, "circle surface is NULL.");
573 genlist = elm_genlist_add(parent);
574 /* this make selected list item is shown compressed */
575 elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
576 evas_object_smart_callback_add(genlist, "selected", _gl_selected_cb, NULL);
578 /* this make genlist style circular */
579 circle_genlist = eext_circle_object_genlist_add(genlist, circle_surface);
580 eext_circle_object_genlist_scroller_policy_set(circle_genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
581 eext_rotary_object_event_activated_set(circle_genlist, EINA_TRUE);
583 evas_object_show(genlist);
589 * @brief: Add item to genlist.
590 * @param[genlist]: genlist
591 * @param[style]: style of item determine how to show this item, such as "1text", "1text1icon" and so on
592 * @param[data]: item data that use item's callback function
593 * @param[_clicked_cb]: function will be operated when the item is clicked
594 * @param[cb_data]: data needed in '_clicked_cb' function
595 * This make item's class and add item to genlist.
597 Elm_Object_Item *view_append_item_to_genlist(Evas_Object *genlist, const char *style,
598 const void *data, Evas_Smart_Cb _clicked_cb, const void *cb_data)
600 Elm_Genlist_Item_Class *item_class;
601 Elm_Object_Item *item;
603 if (genlist == NULL) {
604 dlog_print(DLOG_ERROR, LOG_TAG, "genlist is NULL.");
609 dlog_print(DLOG_ERROR, LOG_TAG, "item style is NULL.");
613 item_class = _set_genlist_item_class(style);
615 item = elm_genlist_item_append(genlist, item_class, data, NULL, ELM_GENLIST_ITEM_NONE, _clicked_cb, cb_data);
617 elm_genlist_item_class_free(item_class);
623 * @brief: Find item from genlist.
624 * @param[genlist]: genlist
625 * @param[val]: value determine which of the itmes has to remove
627 Elm_Object_Item *view_find_item_from_genlist(Evas_Object *genlist, const char *val)
631 Elm_Object_Item *item = NULL;
632 struct genlist_data *gendata = NULL;
635 dlog_print(DLOG_ERROR, LOG_TAG, "genlist is NULL.");
639 item_count = elm_genlist_items_count(genlist);
642 * The fist item and the last item are "padding".
644 for(i = 1; i < item_count-1; i++) {
645 item = elm_genlist_nth_item_get(genlist, i);
646 gendata = elm_object_item_data_get(item);
648 if (gendata->alarm_id == atoi(val)) {
657 * @brief: Remove item.
658 * @param[item]: item from genlist
660 void view_delete_item(Elm_Object_Item *item)
662 elm_object_item_del(item);
666 * @brief: Make popup with theme.
667 * @param[popup_style]: style of the popup's layout
668 * @param[data]: data needed in this function
670 void view_create_text_popup(Evas_Object *parent, double timeout, const char *text)
672 Evas_Object *popup = NULL;
673 Evas_Object *popup_layout = NULL;
675 if (parent == NULL) {
676 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
680 popup = elm_popup_add(parent);
681 elm_object_style_set(popup, "circle");
682 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
684 eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, _popup_hide_cb, NULL);
686 * Delete popup object in _popup_hide_finished_cb(), when the "dismissed" signal will be called.
688 evas_object_smart_callback_add(popup, "dismissed", _popup_hide_finished_cb, NULL);
690 popup_layout = elm_layout_add(popup);
691 elm_layout_theme_set(popup_layout, "layout", "popup", "content/circle");
693 elm_object_content_set(popup, popup_layout);
695 elm_popup_timeout_set(popup, timeout);
698 view_set_text(popup_layout, "elm.text", text);
700 evas_object_show(popup);
703 void view_set_content_to_part(Evas_Object *layout, const char *part, Evas_Object *content)
705 elm_object_part_content_set(layout, part, content);
708 void view_send_signal_to_edje(Evas_Object *layout, const char *signal, const char *source)
710 elm_object_signal_emit(layout, signal, source);
713 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)
715 elm_object_signal_callback_add(item, signal, source, signal_cb, user_data);
719 * @brief: Register roatry event callback function.
720 * @param[obj]: object that will receive rotary event
721 * @param[rotary_cb]: function will be operated when rotary event happens
722 * @param[user_data]: data needed in this function
724 void view_set_rotary_event_callback(Evas_Object *obj, Eext_Rotary_Event_Cb rotary_cb, void *user_data)
727 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
731 eext_rotary_object_event_activated_set(obj, EINA_TRUE);
732 eext_rotary_object_event_callback_add(obj, rotary_cb, user_data);
736 * @brief: Make a label and set label options.
737 * @param[parent]: The object to which you want to add this label
739 Evas_Object *view_create_label(Evas_Object *parent)
741 Evas_Object *label = elm_label_add(parent);
743 if (parent == NULL) {
744 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
748 elm_object_style_set(label, "slide_short");
749 elm_label_wrap_width_set(label, 230);
750 elm_label_ellipsis_set(label, EINA_TRUE);
751 elm_label_slide_duration_set(label, 2);
752 elm_label_slide_mode_set(label, ELM_LABEL_SLIDE_MODE_NONE);
753 elm_label_slide_go(label);
754 evas_object_show(label);
760 * @brief: Set a text to label object
761 * @param[parent]: Object has part to which you want to set text
762 * @param[part]: Part name to which you want to set text
763 * @param[text]: text you want to set to the part
765 void view_set_label_text(Evas_Object *parent, const char *part, const char *text)
767 Evas_Object *label = NULL;
768 char *markup_text = NULL;
769 char buf[256] = { 0, };
771 if (parent == NULL) {
772 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
776 markup_text = elm_entry_utf8_to_markup(text);
777 snprintf(buf, sizeof(buf), "%s%s%s", LABEL_STYLE_START, markup_text, LABEL_STYLE_END);
780 label = elm_object_part_content_get(parent, part);
782 dlog_print(DLOG_ERROR, LOG_TAG, "label is NULL.");
786 elm_object_text_set(label, buf);
790 * @brief: Set a label to given part
791 * @param[parent]: object has part to which you want to set this label
792 * @param[part]: part name to which you want to set this label
794 void view_set_label(Evas_Object *parent, const char *part)
796 Evas_Object *label = NULL;
798 if (parent == NULL) {
799 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
803 label = view_create_label(parent);
805 dlog_print(DLOG_ERROR, LOG_TAG, "label is NULL.");
809 elm_object_part_content_set(parent, part, label);
813 * @brief: Create a progressbar
814 * @param[parent]: object has part to which you want to set this progressbar
816 Evas_Object *view_create_progressbar(Evas_Object *parent)
818 Evas_Object *progressbar = NULL;
820 if (parent == NULL) {
821 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
825 progressbar = eext_circle_object_progressbar_add(parent, NULL);
827 eext_circle_object_value_min_max_set(progressbar, 0.0, 100.0);
828 eext_circle_object_radius_set(progressbar, 53);
829 eext_circle_object_line_width_set(progressbar, 5);
830 evas_object_show(progressbar);
836 * @brief: Set a progressbar to given part
837 * @param[parent]: object has part to which you want to set this progressbar
838 * @param[part]: part name to which you want to set this progressbar
840 void view_set_progressbar(Evas_Object *parent, const char *part)
842 Evas_Object *progressbar = NULL;
844 if (parent == NULL) {
845 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
849 progressbar = view_create_progressbar(parent);
850 if (progressbar == NULL) {
851 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
855 elm_object_part_content_set(parent, part, progressbar);
859 * @brief: Set value to a progressbar
860 * @param[parent]: object has part to which you want to set
861 * @param[part]: part name to which you want to set
862 * @param[val]: value to which you want to set
864 void view_set_progressbar_val(Evas_Object *parent, const char *part, int val)
866 Evas_Object *progressbar = NULL;
868 if (parent == NULL) {
869 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
874 dlog_print(DLOG_ERROR, LOG_TAG, "part is NULL.");
878 progressbar = elm_object_part_content_get(parent, part);
879 if (progressbar == NULL) {
880 dlog_print(DLOG_ERROR, LOG_TAG, "prgressbar is NULL.");
884 eext_circle_object_value_set(progressbar, val);
888 * @brief: Make a checkbox
889 * @param[parent]: The object to which you want to add this checkbox
891 Evas_Object *view_create_checkbox(Evas_Object *parent)
895 if (parent == NULL) {
896 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
900 check = elm_check_add(parent);
901 elm_check_state_set(check, EINA_FALSE);
902 evas_object_smart_callback_add(check, "changed", _icon_clicked_cb, NULL);
903 evas_object_show(check);
909 * @brief: Make no voice memo view
910 * @param[parent]: naviframe
911 * @param[title]: titile of this view
912 * @param[detail]: detail text of this view
913 * @param[image_file]: image file name will be used in this view
914 * This function make a view consists of one title, one center image and one detail text at the bottom
916 Evas_Object *view_create_layout_no_content(Evas_Object *parent, char *title, char *detail, char *image_file)
918 Evas_Object *layout = NULL;
922 if (parent == NULL) {
923 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
927 layout = elm_layout_add(parent);
928 /* this make you can use layout consists of one title, one image and one detail text */
929 elm_layout_theme_set(layout, "layout", "nocontents", "default");
930 evas_object_size_hint_weight_set (layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
931 evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
934 img = elm_image_add(parent);
935 elm_image_file_set(img, image_file, NULL);
936 elm_object_part_content_set(layout, "elm.swallow.icon", img);
937 evas_object_show(img);
941 char detail_text[256] = {0, };
943 /* Customize font style bellow */
944 snprintf(detail_text, sizeof(detail_text), "<font=TIZEN:style=Medium align=center color=#FFFFFF><font_size=28>%s</font_size></font>", detail);
945 elm_object_part_text_set(layout, "elm.text", detail_text);
948 char title_text[256] = {0, };
950 snprintf(title_text, sizeof(title_text), "<font=TIZEN:style=Medium align=center color=#12B4FF><font_size=28>%s</font_size></font>", title);
951 elm_object_part_text_set(layout, "elm.text.title", title_text);
954 /* if this signal is not sent, title text will be disappear */
955 elm_object_signal_emit(layout, "elm,state,title,enable", "elm");
956 /* push this no voice memo view to naviframe to show */
957 it = elm_naviframe_item_push(parent, "Title Enabled", NULL, NULL, layout, NULL);
958 /* if this is EINA_TRUE, you can see Title of naviframe on the top of the screen */
959 elm_naviframe_item_title_enabled_set(it, EINA_FALSE, EINA_FALSE);
965 * @brief: Set datetime to the part.
966 * @param[parent]: object to which you want to set datetime
967 * @param[circle_surface]: object render a connected circle object
968 * @param[part]: part name to which you want to set this datetime
969 * @param[style]: style of the datetime
971 Evas_Object *view_create_datetime(Evas_Object *parent, Eext_Circle_Surface *circle_surface, const char *style)
973 Evas_Object *datetime = NULL;
974 Evas_Object *circle_datetime = NULL;
976 if (parent == NULL) {
977 dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
981 if (circle_surface == NULL) {
982 dlog_print(DLOG_ERROR, LOG_TAG, "failed to get circle_surface.");
986 datetime = elm_datetime_add(parent);
987 circle_datetime = eext_circle_object_datetime_add(datetime, circle_surface);
989 eext_rotary_object_event_activated_set(datetime, EINA_TRUE);
990 elm_datetime_format_set(datetime, FORMAT);
992 elm_object_style_set(datetime, style);