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_1text_1icon_3_tb;
60 extern const Elm_Genlist_Item_Class itc_cm_1text_1icon_2;
61 extern const Elm_Genlist_Item_Class itc_sel_all;
62 extern const Elm_Genlist_Item_Class itc_bg_1icon;
63 extern const Elm_Genlist_Item_Class itc_group_item;
67 * Do process when clicking radio in subitem of expandable item
69 extern void setting_sub_list_rd_change(void *data, Evas_Object *obj,
73 * Hide the input pannel
75 extern void setting_hide_input_pannel_cb(Evas_Object *entry);
78 * Do process when clicking on subitem of expandable item
80 extern void setting_sub_list_sel_cb(void *data, Evas_Object *obj,
84 * Do process when clicking on a common genlist item
86 extern void setting_mouse_up_Gendial_list_radio_cb(void *data,
91 * To intialize an Elm_Genlist_Item_Class, according to item style
93 extern bool setting_create_Gendial_itc(const char *item_style,
94 Elm_Genlist_Item_Class *itc);
97 * Create group style item
98 * @return a pointer to Setting_GenGroupItem_Data
100 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_group_titleItem(Evas_Object *genlist,
101 const Elm_Genlist_Item_Class *itc,
102 Elm_Object_Item *parent,
103 Elm_Genlist_Item_Type flag, /* ELM_GENLIST_ITEM_GROUP or ELM_GENLIST_ITEM_NONE */
105 setting_call_back_func gl_sel);
108 * Create separator style item with title
109 * @return a pointer to Setting_GenGroupItem_Data
111 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_titleItem(
112 Evas_Object *genlist,
113 const Elm_Genlist_Item_Class *itc,
115 setting_call_back_func gl_sel);
118 * Create 1radion-1text style item
119 * @return a pointer to Setting_GenGroupItem_Data
121 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_1radio(
122 Evas_Object *genlist,
123 const Elm_Genlist_Item_Class *itc,
124 setting_call_back_func gl_sel,
126 SWALLOW_Type swallow_type,
127 Evas_Object *rgd, int chk_status,
129 setting_call_back_func chk_change_cb);
131 * Create 2radion style item
132 * @return a pointer to Setting_GenGroupItem_Data
134 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_2radio(
135 Evas_Object *genlist,
136 const Elm_Genlist_Item_Class *itc,
137 setting_call_back_func gl_sel,
139 SWALLOW_Type swallow_type,
140 Evas_Object *rgd, int chk_status,
142 const char *sub_desc,
143 setting_call_back_func chk_change_cb);
146 * Create common style item with menu icon
147 * @return a pointer to Setting_GenGroupItem_Data
149 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_groupitem(
150 Evas_Object *genlist,
151 const Elm_Genlist_Item_Class *itc,
152 Elm_Object_Item *parent,
153 setting_call_back_func gl_sel,
155 SWALLOW_Type swallow_type,
157 char *r_icon_path, int chk_status,
158 const char *keyStr, char *sub_desc,
159 setting_call_back_func
163 * Common function to create a genlist item
164 * @return a pointer to Setting_GenGroupItem_Data
166 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_def(Evas_Object *
168 const Elm_Genlist_Item_Class *itc,
169 setting_call_back_func gl_sel,
171 SWALLOW_Type swallow_type,
177 setting_call_back_func chk_change_cb);
180 * Create 1entry style item
181 * @return a pointer to Setting_GenGroupItem_Data
183 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_entry(Evas_Object *genlist,
184 const Elm_Genlist_Item_Class *itc,
185 setting_call_back_func gl_sel,
187 SWALLOW_Type swallow_type,
193 setting_call_back_func chk_change_cb,
194 Elm_Input_Panel_Layout input_type,
203 * Create 1entry style item
204 * @return a pointer to Setting_GenGroupItem_Data
206 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_entry_fo(Evas_Object *genlist,
207 const Elm_Genlist_Item_Class *itc,
208 setting_call_back_func gl_sel,
210 SWALLOW_Type swallow_type,
216 setting_call_back_func chk_change_cb,
217 setting_call_back_func chk_focus_out_cb,
218 Elm_Input_Panel_Layout input_type,
228 * General function to create a subitem of expandable item
230 * @return a pointer to Setting_GenGroupItem_Data
232 extern Setting_GenGroupItem_Data *setting_create_Gendial_exp_sub_field(
233 Evas_Object *genlist,
234 const Elm_Genlist_Item_Class *itc,
235 setting_call_back_func gl_sel,
237 Elm_Object_Item *parent,
238 SWALLOW_Type swallow_type,
239 Evas_Object *rgd, int chk_status,
241 setting_call_back_func
245 * General function to create a parent item of expandable item
247 * @return a pointer to Setting_GenGroupItem_Data
249 extern Setting_GenGroupItem_Data *setting_create_Gendial_exp_parent_field(
250 Evas_Object *genlist,
251 const Elm_Genlist_Item_Class *itc,
252 setting_call_back_func gl_sel,
254 SWALLOW_Type swallow_type,
259 * To make genlist support expandable style item
261 extern void setting_enable_expandable_genlist(Evas_Object *genlist, void *data,
262 setting_call_back_func gl_exp_cb,
263 setting_call_back_func
267 * The API to let an item which with processbar go into "processing"
270 extern void setting_begin_progress_genlist_item(Setting_GenGroupItem_Data *
273 * The API to let an item which with processbar go into "processed"
276 extern void setting_finish_progress_genlist_item(Setting_GenGroupItem_Data *
280 * To create slider object of a genlist item
281 * @return a slider container object
283 extern Evas_Object *setting_create_slider(Evas_Object *win_main, Evas *evas,
284 const char *l_swallow_path,
285 const char *r_swallow_path,
290 setting_call_back_func
292 setting_call_back_func
293 slider_start_change_cb,
294 setting_call_back_func
295 slider_stop_change_cb, void *cb_data);
298 * The main implement body of create a certain size icon
300 extern void create_image_box_add_ex(void *data, Evas_Object *win_main,
301 Evas *evas, char *img_path, int img_w,
303 Evas_Object_Event_Cb mouse_down_cb,
304 Evas_Object_Event_Cb mouse_up_cb,
305 Evas_Object **image_box,
309 * To create a size fixed icon
310 * @return a image container object
312 extern Evas_Object *create_image_box_add(void *data, Evas_Object *win_main,
313 Evas *evas, char *img_path, int img_w,
315 Evas_Object_Event_Cb mouse_down_cb,
316 Evas_Object_Event_Cb mouse_up_cb);
319 * @ To create a size specialized icon
320 * @return a image container object
322 extern Evas_Object *create_bgimage_box_add(void *data, Evas_Object *win_main,
323 Evas *evas, char *img_path,
324 int img_w, int img_h,
325 Evas_Object_Event_Cb mouse_down_cb,
326 Evas_Object_Event_Cb mouse_up_cb);
329 * @ create a box container
331 * @param[in] win_main
333 * @return a box container
335 extern Evas_Object *setting_create_client_bx(Evas_Object *win_main);
338 * The API to Create a lable
341 extern Evas_Object *setting_create_lable(Evas_Object *parent, const char *text,const char *style, const char *align);
344 * The API to Create an object to show an image
345 * @return an object to show an image
347 extern Evas_Object *setting_create_image(Evas_Object *parent, const char *img_path);
350 * The API to Create an object to show anamition image
351 * @return an object to show anamition image
353 extern Evas_Object *setting_create_gif(Evas_Object *parent, const char **png_list);
356 * @ create a popup window which contents a progressbar
357 * @return a popup window which contents a progressbar
359 extern Evas_Object *setting_create_popup_with_progressbar(void *data,
361 char *progressbar_style,
364 setting_call_back_func response_cb,
369 * The general API to create a certain popup window with more than one button.
370 * @return a certain popup window
372 extern Evas_Object *setting_create_popup_with_btn(void *data,
376 setting_call_back_func response_cb,
380 * The general API to create a certain popup window
381 * @return a certain popup window
383 extern Evas_Object *setting_create_popup_without_btn(void *data,
387 setting_call_back_func response_cb,
392 * The API to create a certain popup window with title
393 * @return a certain popup window with title
395 extern int setting_create_simple_popup(void *data,
400 * The API to create a certain popup window with a gif and some buttons
401 * @return a certain popup window with title
403 extern Evas_Object *setting_create_popup_with_gif(void *data,
407 const char **png_list,//array end with 'NULL'.
408 setting_call_back_func response_cb,
413 * The API to create a certain popup window with a check
414 * @return a certain popup window with title
416 extern Evas_Object *setting_create_popup_with_checkview(Evas_Object *parent,
419 Evas_Object *checkview_content,
420 const char *checkview_style,
425 * The API to create a certain popup window with a image, a check and some buttons
426 * @return a certain popup window with title
428 extern Evas_Object *setting_create_popup_with_image_check(void *data,
436 setting_call_back_func response_cb,
440 * Alternate the check object status and its binded vcof value via original vcofn value
442 extern int setting_draw_onoff_status(Evas_Object *obj,
443 setting_bool_slp_list key);
446 * Set the vconf value via its binded check object.
447 * @return 0: sucess, other: failed
449 extern int setting_reset_slp_key_by_status(Evas_Object *obj,
450 setting_bool_slp_list key);
453 * Set the status of check object via its binded vconf value.
454 * @return 0: sucess, other: failed
456 extern int setting_check_onoff_status(Evas_Object *obj,
457 setting_bool_slp_list key);
460 * Set the status of radio group object via its binded vconf value.
461 * @return 0: sucess, other: failed
463 extern int setting_update_chk_status(Evas_Object *chk,
464 setting_int_slp_list type);
467 * Create a size specilized rectangle object
468 * @return a size specilized rectangle object
470 extern Evas_Object *setting_create_blank_rect_customize(Evas_Object *layout,
474 * Create a size fixed rectangle object
476 * @return a size fixed rectangle object
478 extern Evas_Object *setting_create_blank_rect(Evas_Object *layout);
481 * The API to Create an editfiled object
482 * @return an editfiled object
484 extern Evas_Object *setting_create_editfiled(Evas_Object *win_main,
485 char *title, char *def_str);
487 * The API to Create a standard layout
488 * @return a standard layout
490 extern Evas_Object *setting_create_win_layout(Evas_Object *win_layout,
491 Evas_Object *win_obj);
493 * The API to Create a naviframe
494 * @return a naviframe
496 extern Evas_Object *setting_create_navi_bar(Evas_Object *layout);
499 * The API to Create a button
502 extern Evas_Object *setting_create_button(Evas_Object *parent, const char *btn_str,
503 const char *btn_style,
504 setting_call_back_func btn_click_cb,
508 * The API to Create top buttons onto naviframe
509 * @return a naviframe item
511 extern Elm_Object_Item * setting_create_navi_bar_top_buttons(char *title_str,
515 setting_call_back_func lbutton_click_cb,
516 setting_call_back_func rbutton_click_cb,
517 setting_call_back_func mbutton_click_cb,
518 void *cb_data, Evas_Object *eo_view,/*any container obj */
519 Evas_Object *navigate_bar );
522 * Create buttons on the specialized navigation bar
523 * @param[in] eo_view navigation bar's content
524 * @param[in] controlbar title obj of navigation bar
527 setting_create_navi_bar_buttons(char *title_str,
528 char *lbutton_str, char *rbutton_str,
530 setting_call_back_func lbutton_click_cb,
531 setting_call_back_func rbutton_click_cb,
532 setting_call_back_func mbutton_click_cb,
533 void *cb_data, Evas_Object *eo_view,
534 Evas_Object *navigate_bar,
535 Evas_Object *titleobj);
538 * The general API to create a layout with navigation bar,
539 * which contents any evas container object(@param[eo_view]) as its content
541 * @param[in] eo_view navigation bar's content
542 * @param[out] titleobj title obj of navigation bar
544 * return main layout of UG or App..
547 Evas_Object *setting_create_layout_navi_bar(Evas_Object *win_layout,
548 Evas_Object *win_obj,
553 setting_call_back_func lbutton_click_cb,
554 setting_call_back_func rbutton_click_cb,
555 setting_call_back_func mbutton_click_cb,
557 Evas_Object *eo_view,
558 Evas_Object **navi_bar,
559 Evas_Object **titleobj);
562 * The API to create a layout with navigation bar,
563 * which contents a scroller object as its content
565 * @param[out] scroller navigation bar's content
567 * @return a layout with a special navigation bar and at most 2 buttons
569 extern Evas_Object *setting_create_layout_navi_bar_scroller(Evas_Object * win_layout,
570 Evas_Object * win_obj,
574 setting_call_back_func lbutton_click_cb,
575 setting_call_back_func rbutton_click_cb,
577 Evas_Object ** scroller,
578 Evas_Object ** navi_bar);
581 * The API to create a layout with navigation bar,
582 * which contents a genlist object as its content
584 * @return a layout with a special navigation bar and at most 2 buttons
586 extern Evas_Object *setting_create_layout_navi_bar_genlist(Evas_Object * win_layout,
587 Evas_Object * win_obj,
591 setting_call_back_func lbutton_click_cb,
592 setting_call_back_func rbutton_click_cb,
594 Evas_Object ** genlist,
595 Evas_Object ** navi_bar);
598 * The general API to push any evas object(@param[in][eo_view]) to the specialized navi_bar,
599 * which contents at most 3 buttons
601 extern Elm_Object_Item *setting_push_layout_navi_bar(char *title_str,
602 char *lbutton_str, char *rbutton_str,
604 setting_call_back_func lbutton_click_cb,
605 setting_call_back_func rbutton_click_cb,
606 setting_call_back_func mbutton_click_cb,
608 Evas_Object *eo_view,
609 Evas_Object *navi_bar,
610 Evas_Object **titleobj);
613 * The API to push a scroller object(@param[in][scroller]) to the specialized navi_bar,
614 * which contents at most 2 buttons
616 extern void setting_push_layout_navi_bar_scroller(Evas_Object *win_main,
620 setting_call_back_func lbutton_click_cb,
621 setting_call_back_func rbutton_click_cb,
623 Evas_Object **scroller,
624 Evas_Object *navi_bar);
627 * The API to push a genlist object(@param[in][genlist]) to the specialized navi_bar,
628 * which contents at most 2 buttons
631 setting_push_layout_navi_bar_genlist(Evas_Object *win_layout,
632 Evas_Object *win_obj,
636 setting_call_back_func lbutton_click_cb,
637 setting_call_back_func rbutton_click_cb,
639 Evas_Object **genlist,
640 Evas_Object *navi_bar);
643 * Create a text box, which cannot be edited
644 * @return a text box, which cannot be edited
646 extern Evas_Object *setting_create_textbox(Evas_Object *parent,
647 const char *content);
652 * Create selectinfo popup
654 extern void setting_create_sel_info_popup(Evas_Object *parent,
655 Evas_Object **selInfoPop_layout,
656 Evas_Object **selInfoPop);
659 * Check if some item is selected in done-list
661 * @param[in] list_data
664 extern bool setting_done_list_is_some_item_selected(Setting_Done_List_Data *
668 * Do process when clicking the check object in the done-list item
670 extern void setting_done_list_Gendial_chk_btn_cb(void *data, Evas_Object *obj,
674 * The API to create done-list.
675 * @param[in] list_data
676 * @return a done-list
678 extern Evas_Object *setting_create_done_list(Setting_Done_List_Data *
682 * Get searchbar text and register redraw_cb by idler.
685 * @param[in] search_bar
686 * @param[in] search_text
687 * @param[in] search_idler
688 * @param[in] redraw_cb
690 extern int setting_searchbar_redraw(void *data,
691 Evas_Object *search_bar,
693 Ecore_Idler **search_idler,
694 Ecore_Task_Cb redraw_cb);
697 * Create searchar, register change cb and cancel cb.
701 * @param[in] change_cb
702 * @param[in] cancel_cb
704 extern Evas_Object *setting_create_searchbar(void *data, Evas_Object *parent,
705 Evas_Smart_Cb change_cb,
706 Evas_Smart_Cb cancel_cb);
708 #if APPLIED_BACK_KEY_UG
711 * Get the toppest popup in current evas, cross through all the APP and UGs.
715 * @return the toppest popup in current evas
717 extern Evas_Object *get_toppest_popup_window(Evas *evas);
721 * Make it no effect when clicking on a evas object, such as, layout, genlist
724 extern void setting_disable_evas_object(Evas_Object *obj);
727 * Make it normal acting when clicking on a evas object, such as, layout, genlist
730 extern void setting_enable_evas_object(Evas_Object *obj);
733 * To disable a specialized genlist item
736 extern void setting_disable_genlist_item(Elm_Object_Item *item);
739 * To enable a specialized genlist item
742 extern void setting_enable_genlist_item(Elm_Object_Item *item);
745 * To resize a evas object, such as, icon, button..
748 extern void setting_resize_object(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
751 * To create a bg object
754 extern Evas_Object *setting_create_bg(Evas_Object *parent,Evas_Object *win, const char *bg_style);
757 * To make an object which is operated by setting_dim_evas_object normal color
760 * @param[in] b_transparenct:
761 * 1:the appearence of obj is made up of transparent backgroud color.
762 * 0:the appearence of obj is made up of non transparent color.
764 extern void setting_undo_dim_evas_object(Evas_Object *obj, bool b_transparenct);
767 * To make an object dim color
770 * @param[in] b_transparenct:
771 * 1:the appearence of obj is made up of transparent backgroud color.
772 * 0:the appearence of obj is made up of non transparent color.
774 extern void setting_dim_evas_object(Evas_Object *obj, bool b_transparenct);
777 * To make an object looks clickable: if pressed, it is dim color;if unpressed, it is normal color;
781 extern void setting_make_evas_object_clickable(Evas_Object *obj);
783 * To create an icon which looks clickable(if pressed, it is dim color;if unpressed, it is normal color)
786 * @param[in] img_path
792 extern Evas_Object *setting_create_icon(Evas_Object *parent, const char *img_path,
793 Evas_Object_Event_Cb up_cb,
794 Evas_Object_Event_Cb down_cb,
795 Evas_Object_Event_Cb move_cb,
798 * to make sbu-obj the same size as parent-obj.Notice: subobj is the only sub-obj @parent wants to display
805 * To create a button which only has a image and looks clickable
806 * (if pressed, it is dim color;if unpressed, it is normal color)
808 * @param[in] img_path
814 extern Evas_Object *setting_create_image_button(Evas_Object *parent,
816 setting_call_back_func clicked_cb,
817 setting_call_back_func unpressed_cb,
821 * set font_size, color or align(right, left, middle),if need, you
822 * can add </font_siz>, </color> or </align> to controll a segment words; or else
823 * the text will take the same effect until the end of text.
825 extern char *setting_customize_text(const char *input_str, const int font_size,
826 const char *color, const char *align);
829 * To go to top of list in top view of navibar.
832 extern void setting_go_to_navibar_list_top(Evas_Object *navibar);
834 #endif /* __SETTING_COMMON_DRAW_WIDGET_H__ */