4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
6 * Contact: MyoungJune Park <mj2004.park@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 *default group setting-common-draw-widget
23 *common UI code for reuse
25 #ifndef __SETTING_COMMON_DRAW_WIDGET_H__
26 #define __SETTING_COMMON_DRAW_WIDGET_H__
27 #include <setting-common-data-type.h> /* including all the data structure */
28 #include <setting-common-general-func.h> /* including one class of common functions */
29 #include <setting-common-data-slp-setting.h> /* including another class of common functions */
31 #define SETTING_COMMON_DRAW_WIDGET_CONTROLBAR_ITEM_LEN 3
32 #define POPUP_INTERVAL 2.0
34 extern const Elm_Genlist_Item_Class itc_seperator;
35 extern const Elm_Genlist_Item_Class itc_bottom_seperator;
36 extern const Elm_Genlist_Item_Class itc_sep_line;
38 extern const Elm_Genlist_Item_Class itc_1text;
39 extern const Elm_Genlist_Item_Class itc_1text_1icon_2;
41 extern const Elm_Genlist_Item_Class itc_1icon;
42 extern const Elm_Genlist_Item_Class itc_1icon_1text_sub;
43 extern const Elm_Genlist_Item_Class itc_1text_1icon;
44 extern const Elm_Genlist_Item_Class itc_1text_2icon;
45 extern const Elm_Genlist_Item_Class itc_1text_2icon_2;
47 extern const Elm_Genlist_Item_Class itc_2text_2;
48 extern const Elm_Genlist_Item_Class itc_2text;
49 extern const Elm_Genlist_Item_Class itc_multiline_2text_1icon;
50 extern const Elm_Genlist_Item_Class itc_2text_1icon_3;
51 extern const Elm_Genlist_Item_Class itc_2text_1icon_6;
52 extern const Elm_Genlist_Item_Class itc_2text_1icon_7;
54 extern const Elm_Genlist_Item_Class itc_2text_3_parent;
55 extern const Elm_Genlist_Item_Class itc_2text_3;
56 extern const Elm_Genlist_Item_Class itc_2text_2icon_3;
58 extern const Elm_Genlist_Item_Class itc_multiline_text;
59 extern const Elm_Genlist_Item_Class itc_cm_1text_1icon_2;
60 extern const Elm_Genlist_Item_Class itc_sel_all;
61 extern const Elm_Genlist_Item_Class itc_bg_1icon;
62 extern const Elm_Genlist_Item_Class itc_group_item;
66 * Do process when clicking radio in subitem of expandable item
68 extern void setting_sub_list_rd_change(void *data, Evas_Object *obj,
72 * Hide the input pannel
74 extern void setting_hide_input_pannel_cb(Evas_Object *entry);
77 * Do process when clicking on subitem of expandable item
79 extern void setting_sub_list_sel_cb(void *data, Evas_Object *obj,
83 * Do process when clicking on a common genlist item
85 extern void setting_mouse_up_Gendial_list_radio_cb(void *data,
90 * To intialize an Elm_Genlist_Item_Class, according to item style
92 extern bool setting_create_Gendial_itc(const char *item_style,
93 Elm_Genlist_Item_Class *itc);
96 * Create group style item
97 * @return a pointer to Setting_GenGroupItem_Data
99 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_group_titleItem(Evas_Object *genlist,
100 const Elm_Genlist_Item_Class *itc,
101 Elm_Object_Item *parent,
102 Elm_Genlist_Item_Type flag, /* ELM_GENLIST_ITEM_GROUP or ELM_GENLIST_ITEM_NONE */
104 setting_call_back_func gl_sel);
107 * Create separator style item with title
108 * @return a pointer to Setting_GenGroupItem_Data
110 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_titleItem(
111 Evas_Object *genlist,
112 const Elm_Genlist_Item_Class *itc,
114 setting_call_back_func gl_sel);
117 * Create 1radion-1text style item
118 * @return a pointer to Setting_GenGroupItem_Data
120 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_1radio(
121 Evas_Object *genlist,
122 const Elm_Genlist_Item_Class *itc,
123 setting_call_back_func gl_sel,
125 SWALLOW_Type swallow_type,
126 Evas_Object *rgd, int chk_status,
128 setting_call_back_func chk_change_cb);
130 * Create 2radion style item
131 * @return a pointer to Setting_GenGroupItem_Data
133 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_2radio(
134 Evas_Object *genlist,
135 const Elm_Genlist_Item_Class *itc,
136 setting_call_back_func gl_sel,
138 SWALLOW_Type swallow_type,
139 Evas_Object *rgd, int chk_status,
141 const char *sub_desc,
142 setting_call_back_func chk_change_cb);
145 * Create common style item with menu icon
146 * @return a pointer to Setting_GenGroupItem_Data
148 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_groupitem(
149 Evas_Object *genlist,
150 const Elm_Genlist_Item_Class *itc,
151 Elm_Object_Item *parent,
152 setting_call_back_func gl_sel,
154 SWALLOW_Type swallow_type,
156 char *r_icon_path, int chk_status,
157 const char *keyStr, char *sub_desc,
158 setting_call_back_func
162 * Common function to create a genlist item
163 * @return a pointer to Setting_GenGroupItem_Data
165 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_def(Evas_Object *
167 const Elm_Genlist_Item_Class *itc,
168 setting_call_back_func gl_sel,
170 SWALLOW_Type swallow_type,
176 setting_call_back_func chk_change_cb);
179 * Create 1entry style item
180 * @return a pointer to Setting_GenGroupItem_Data
182 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_entry(Evas_Object *genlist,
183 const Elm_Genlist_Item_Class *itc,
184 setting_call_back_func gl_sel,
186 SWALLOW_Type swallow_type,
192 setting_call_back_func chk_change_cb,
193 Elm_Input_Panel_Layout input_type,
202 * General function to create a subitem of expandable item
204 * @return a pointer to Setting_GenGroupItem_Data
206 extern Setting_GenGroupItem_Data *setting_create_Gendial_exp_sub_field(
207 Evas_Object *genlist,
208 const Elm_Genlist_Item_Class *itc,
209 setting_call_back_func gl_sel,
211 Elm_Object_Item *parent,
212 SWALLOW_Type swallow_type,
213 Evas_Object *rgd, int chk_status,
215 setting_call_back_func
219 * General function to create a parent item of expandable item
221 * @return a pointer to Setting_GenGroupItem_Data
223 extern Setting_GenGroupItem_Data *setting_create_Gendial_exp_parent_field(
224 Evas_Object *genlist,
225 const Elm_Genlist_Item_Class *itc,
226 setting_call_back_func gl_sel,
228 SWALLOW_Type swallow_type,
233 * To make genlist support expandable style item
235 extern void setting_enable_expandable_genlist(Evas_Object *genlist, void *data,
236 setting_call_back_func gl_exp_cb,
237 setting_call_back_func
241 * The API to let an item which with processbar go into "processing"
244 extern void setting_begin_progress_genlist_item(Setting_GenGroupItem_Data *
247 * The API to let an item which with processbar go into "processed"
250 extern void setting_finish_progress_genlist_item(Setting_GenGroupItem_Data *
254 * To create slider object of a genlist item
255 * @return a slider container object
257 extern Evas_Object *setting_create_slider(Evas_Object *win_main, Evas *evas,
258 const char *l_swallow_path,
259 const char *r_swallow_path,
264 setting_call_back_func
266 setting_call_back_func
267 slider_start_change_cb,
268 setting_call_back_func
269 slider_stop_change_cb, void *cb_data);
272 * The main implement body of create a certain size icon
274 extern void create_image_box_add_ex(void *data, Evas_Object *win_main,
275 Evas *evas, char *img_path, int img_w,
277 Evas_Object_Event_Cb mouse_down_cb,
278 Evas_Object_Event_Cb mouse_up_cb,
279 Evas_Object **image_box,
283 * To create a size fixed icon
284 * @return a image container object
286 extern Evas_Object *create_image_box_add(void *data, Evas_Object *win_main,
287 Evas *evas, char *img_path, int img_w,
289 Evas_Object_Event_Cb mouse_down_cb,
290 Evas_Object_Event_Cb mouse_up_cb);
293 * @ To create a size specialized icon
294 * @return a image container object
296 extern Evas_Object *create_bgimage_box_add(void *data, Evas_Object *win_main,
297 Evas *evas, char *img_path,
298 int img_w, int img_h,
299 Evas_Object_Event_Cb mouse_down_cb,
300 Evas_Object_Event_Cb mouse_up_cb);
303 * @ create a box container
305 * @param[in] win_main
307 * @return a box container
309 extern Evas_Object *setting_create_client_bx(Evas_Object *win_main);
312 * The API to Create a lable
315 extern Evas_Object *setting_create_lable(Evas_Object *parent, const char *lable,const char *style);
318 * The API to Create an object to show an image
319 * @return an object to show an image
321 extern Evas_Object *setting_create_image(Evas_Object *parent, const char *img_path);
324 * The API to Create an object to show anamition image
325 * @return an object to show anamition image
327 extern Evas_Object *setting_create_gif(Evas_Object *parent, const char **png_list);
330 * @ create a popup window which contents a progressbar
331 * @return a popup window which contents a progressbar
333 extern Evas_Object *setting_create_popup_with_progressbar(void *data,
335 char *progressbar_style,
338 setting_call_back_func response_cb,
343 * The general API to create a certain popup window with more than one button.
344 * @return a certain popup window
346 extern Evas_Object *setting_create_popup_with_btn(void *data,
350 setting_call_back_func response_cb,
354 * The general API to create a certain popup window
355 * @return a certain popup window
357 extern Evas_Object *setting_create_popup_without_btn(void *data,
361 setting_call_back_func response_cb,
366 * The API to create a certain popup window with title
367 * @return a certain popup window with title
369 extern int setting_create_simple_popup(void *data,
374 * The API to create a certain popup window with a gif and some buttons
375 * @return a certain popup window with title
377 extern Evas_Object *setting_create_popup_with_gif(void *data,
381 const char **png_list,//array end with 'NULL'.
382 setting_call_back_func response_cb,
387 * The API to create a certain popup window with a check
388 * @return a certain popup window with title
390 extern Evas_Object *setting_create_popup_with_checkview(Evas_Object *parent,
393 Evas_Object *checkview_content,
397 * The API to create a certain popup window with a check and some buttons
398 * @return a certain popup window with title
400 extern Evas_Object *setting_create_popup_with_check(void *data,
406 setting_call_back_func response_cb,
411 * The API to create a certain popup window with a image, a check and some buttons
412 * @return a certain popup window with title
414 extern Evas_Object *setting_create_popup_with_image_check(void *data,
422 setting_call_back_func response_cb,
426 * Alternate the check object status and its binded vcof value via original vcofn value
428 extern int setting_draw_onoff_status(Evas_Object *obj,
429 setting_bool_slp_list key);
432 * Set the vconf value via its binded check object.
433 * @return 0: sucess, other: failed
435 extern int setting_reset_slp_key_by_status(Evas_Object *obj,
436 setting_bool_slp_list key);
439 * Set the status of check object via its binded vconf value.
440 * @return 0: sucess, other: failed
442 extern int setting_check_onoff_status(Evas_Object *obj,
443 setting_bool_slp_list key);
446 * Set the status of radio group object via its binded vconf value.
447 * @return 0: sucess, other: failed
449 extern int setting_update_chk_status(Evas_Object *chk,
450 setting_int_slp_list type);
453 * Create a size specilized rectangle object
454 * @return a size specilized rectangle object
456 extern Evas_Object *setting_create_blank_rect_customize(Evas_Object *layout,
460 * Create a size fixed rectangle object
462 * @return a size fixed rectangle object
464 extern Evas_Object *setting_create_blank_rect(Evas_Object *layout);
467 * The API to Create an editfiled object
468 * @return an editfiled object
470 extern Evas_Object *setting_create_editfiled(Evas_Object *win_main,
471 char *title, char *def_str);
473 * The API to Create a standard layout
474 * @return a standard layout
476 extern Evas_Object *setting_create_win_layout(Evas_Object *win_layout,
477 Evas_Object *win_obj);
479 * The API to Create a naviframe
480 * @return a naviframe
482 extern Evas_Object *setting_create_navi_bar(Evas_Object *layout);
485 * The API to Create a button
488 extern Evas_Object *setting_create_button(Evas_Object *parent, const char *btn_str,
489 const char *btn_style,
490 setting_call_back_func btn_click_cb,
494 * The API to Create top buttons onto naviframe
495 * @return a naviframe item
497 extern Elm_Object_Item * setting_create_navi_bar_top_buttons(char *title_str,
501 setting_call_back_func lbutton_click_cb,
502 setting_call_back_func rbutton_click_cb,
503 setting_call_back_func mbutton_click_cb,
504 void *cb_data, Evas_Object *eo_view,/*any container obj */
505 Evas_Object *navigate_bar );
508 * Create buttons on the specialized navigation bar
509 * @param[in] eo_view navigation bar's content
510 * @param[in] controlbar title obj of navigation bar
513 setting_create_navi_bar_buttons(char *title_str,
514 char *lbutton_str, char *rbutton_str,
516 setting_call_back_func lbutton_click_cb,
517 setting_call_back_func rbutton_click_cb,
518 setting_call_back_func mbutton_click_cb,
519 void *cb_data, Evas_Object *eo_view,
520 Evas_Object *navigate_bar,
521 Evas_Object *controlbar);
524 * The general API to create a layout with navigation bar,
525 * which contents any evas container object(@param[eo_view]) as its content
527 * @param[in] eo_view navigation bar's content
528 * @param[out] titleobj title obj of navigation bar
530 * return main layout of UG or App..
533 Evas_Object *setting_create_layout_navi_bar(Evas_Object *win_layout,
534 Evas_Object *win_obj,
539 setting_call_back_func lbutton_click_cb,
540 setting_call_back_func rbutton_click_cb,
541 setting_call_back_func mbutton_click_cb,
543 Evas_Object *eo_view,
544 Evas_Object **navi_bar,
545 Evas_Object **titleobj);
548 * The API to create a layout with navigation bar,
549 * which contents a scroller object as its content
551 * @param[out] scroller navigation bar's content
553 * @return a layout with a special navigation bar and at most 2 buttons
555 extern Evas_Object *setting_create_layout_navi_bar_scroller(Evas_Object * win_layout,
556 Evas_Object * win_obj,
560 setting_call_back_func lbutton_click_cb,
561 setting_call_back_func rbutton_click_cb,
563 Evas_Object ** scroller,
564 Evas_Object ** navi_bar);
567 * The API to create a layout with navigation bar,
568 * which contents a genlist object as its content
570 * @return a layout with a special navigation bar and at most 2 buttons
572 extern Evas_Object *setting_create_layout_navi_bar_genlist(Evas_Object * win_layout,
573 Evas_Object * win_obj,
577 setting_call_back_func lbutton_click_cb,
578 setting_call_back_func rbutton_click_cb,
580 Evas_Object ** genlist,
581 Evas_Object ** navi_bar);
584 * The general API to push any evas object(@param[in][eo_view]) to the specialized navi_bar,
585 * which contents at most 3 buttons
587 extern Elm_Object_Item *setting_push_layout_navi_bar(char *title_str,
588 char *lbutton_str, char *rbutton_str,
590 setting_call_back_func lbutton_click_cb,
591 setting_call_back_func rbutton_click_cb,
592 setting_call_back_func mbutton_click_cb,
594 Evas_Object *eo_view,
595 Evas_Object *navi_bar,
596 Evas_Object **titleobj);
599 * The API to push a scroller object(@param[in][scroller]) to the specialized navi_bar,
600 * which contents at most 2 buttons
602 extern void setting_push_layout_navi_bar_scroller(Evas_Object *win_main,
606 setting_call_back_func lbutton_click_cb,
607 setting_call_back_func rbutton_click_cb,
609 Evas_Object **scroller,
610 Evas_Object *navi_bar);
613 * The API to push a genlist object(@param[in][genlist]) to the specialized navi_bar,
614 * which contents at most 2 buttons
617 setting_push_layout_navi_bar_genlist(Evas_Object *win_layout,
618 Evas_Object *win_obj,
622 setting_call_back_func lbutton_click_cb,
623 setting_call_back_func rbutton_click_cb,
625 Evas_Object **genlist,
626 Evas_Object *navi_bar);
629 * Create a text box, which cannot be edited
630 * @return a text box, which cannot be edited
632 extern Evas_Object *setting_create_textbox(Evas_Object *parent,
633 const char *content);
638 * Create selectinfo popup
640 extern void setting_create_sel_info_popup(Evas_Object *parent,
641 Evas_Object **selInfoPop_layout,
642 Evas_Object **selInfoPop);
645 * Check if some item is selected in done-list
647 * @param[in] list_data
650 extern bool setting_done_list_is_some_item_selected(Setting_Done_List_Data *
654 * Do process when clicking the check object in the done-list item
656 extern void setting_done_list_Gendial_chk_btn_cb(void *data, Evas_Object *obj,
660 * The API to create done-list.
661 * @param[in] list_data
662 * @return a done-list
664 extern Evas_Object *setting_create_done_list(Setting_Done_List_Data *
668 * Get searchbar text and register redraw_cb by idler.
671 * @param[in] search_bar
672 * @param[in] search_text
673 * @param[in] search_idler
674 * @param[in] redraw_cb
676 extern int setting_searchbar_redraw(void *data,
677 Evas_Object *search_bar,
679 Ecore_Idler **search_idler,
680 Ecore_Task_Cb redraw_cb);
683 * Create searchar, register change cb and cancel cb.
687 * @param[in] change_cb
688 * @param[in] cancel_cb
690 extern Evas_Object *setting_create_searchbar(void *data, Evas_Object *parent,
691 Evas_Smart_Cb change_cb,
692 Evas_Smart_Cb cancel_cb);
694 #if APPLIED_BACK_KEY_UG
697 * Get the toppest popup in current evas, cross through all the APP and UGs.
701 * @return the toppest popup in current evas
703 extern Evas_Object *get_toppest_popup_window(Evas *evas);
707 * Make it no effect when clicking on a evas object, such as, layout, genlist
710 extern void setting_disable_evas_object(Evas_Object *obj);
713 * Make it normal acting when clicking on a evas object, such as, layout, genlist
716 extern void setting_enable_evas_object(Evas_Object *obj);
719 * To disable a specialized genlist item
722 extern void setting_disable_genlist_item(Elm_Object_Item *item);
725 * To enable a specialized genlist item
728 extern void setting_enable_genlist_item(Elm_Object_Item *item);
731 * To resize a evas object, such as, icon, button..
734 extern void setting_resize_object(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
737 * To create a bg object
740 extern Evas_Object *setting_create_bg(Evas_Object *parent,Evas_Object *win, const char *bg_style);
743 * To make an object which is operated by setting_dim_evas_object normal color
746 * @param[in] b_transparenct:
747 * 1:the appearence of obj is made up of transparent backgroud color.
748 * 0:the appearence of obj is made up of non transparent color.
750 extern void setting_undo_dim_evas_object(Evas_Object *obj, bool b_transparenct);
753 * To make an object dim color
756 * @param[in] b_transparenct:
757 * 1:the appearence of obj is made up of transparent backgroud color.
758 * 0:the appearence of obj is made up of non transparent color.
760 extern void setting_dim_evas_object(Evas_Object *obj, bool b_transparenct);
763 * To make an object looks clickable: if pressed, it is dim color;if unpressed, it is normal color;
767 extern void setting_make_evas_object_clickable(Evas_Object *obj);
769 * To create an icon which looks clickable(if pressed, it is dim color;if unpressed, it is normal color)
772 * @param[in] img_path
778 extern Evas_Object *setting_create_icon(Evas_Object *parent, const char *img_path,
779 Evas_Object_Event_Cb up_cb,
780 Evas_Object_Event_Cb down_cb,
781 Evas_Object_Event_Cb move_cb,
784 * to make sbu-obj the same size as parent-obj.Notice: subobj is the only sub-obj @parent wants to display
791 * To create a button which only has a image and looks clickable
792 * (if pressed, it is dim color;if unpressed, it is normal color)
794 * @param[in] img_path
800 extern Evas_Object *setting_create_image_button(Evas_Object *parent,
802 setting_call_back_func clicked_cb,
803 setting_call_back_func unpressed_cb,
807 * set font_size, color or align(right, left, middle),if need, you
808 * can add </font_siz>, </color> or </align> to controll a segment words; or else
809 * the text will take the same effect until the end of text.
811 extern char *setting_customize_text(const char *input_str, const int font_size,
812 const char *color, const char *align);
815 * To go to top of list in top view of navibar.
818 extern void setting_go_to_navibar_list_top(Evas_Object *navibar);
820 #endif /* __SETTING_COMMON_DRAW_WIDGET_H__ */