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 * General function to create a subitem of expandable item
205 * @return a pointer to Setting_GenGroupItem_Data
207 extern Setting_GenGroupItem_Data *setting_create_Gendial_exp_sub_field(
208 Evas_Object *genlist,
209 const Elm_Genlist_Item_Class *itc,
210 setting_call_back_func gl_sel,
212 Elm_Object_Item *parent,
213 SWALLOW_Type swallow_type,
214 Evas_Object *rgd, int chk_status,
216 setting_call_back_func
220 * General function to create a parent item of expandable item
222 * @return a pointer to Setting_GenGroupItem_Data
224 extern Setting_GenGroupItem_Data *setting_create_Gendial_exp_parent_field(
225 Evas_Object *genlist,
226 const Elm_Genlist_Item_Class *itc,
227 setting_call_back_func gl_sel,
229 SWALLOW_Type swallow_type,
234 * To make genlist support expandable style item
236 extern void setting_enable_expandable_genlist(Evas_Object *genlist, void *data,
237 setting_call_back_func gl_exp_cb,
238 setting_call_back_func
242 * The API to let an item which with processbar go into "processing"
245 extern void setting_begin_progress_genlist_item(Setting_GenGroupItem_Data *
248 * The API to let an item which with processbar go into "processed"
251 extern void setting_finish_progress_genlist_item(Setting_GenGroupItem_Data *
255 * To create slider object of a genlist item
256 * @return a slider container object
258 extern Evas_Object *setting_create_slider(Evas_Object *win_main, Evas *evas,
259 const char *l_swallow_path,
260 const char *r_swallow_path,
265 setting_call_back_func
267 setting_call_back_func
268 slider_start_change_cb,
269 setting_call_back_func
270 slider_stop_change_cb, void *cb_data);
273 * The main implement body of create a certain size icon
275 extern void create_image_box_add_ex(void *data, Evas_Object *win_main,
276 Evas *evas, char *img_path, int img_w,
278 Evas_Object_Event_Cb mouse_down_cb,
279 Evas_Object_Event_Cb mouse_up_cb,
280 Evas_Object **image_box,
284 * To create a size fixed icon
285 * @return a image container object
287 extern Evas_Object *create_image_box_add(void *data, Evas_Object *win_main,
288 Evas *evas, char *img_path, int img_w,
290 Evas_Object_Event_Cb mouse_down_cb,
291 Evas_Object_Event_Cb mouse_up_cb);
294 * @ To create a size specialized icon
295 * @return a image container object
297 extern Evas_Object *create_bgimage_box_add(void *data, Evas_Object *win_main,
298 Evas *evas, char *img_path,
299 int img_w, int img_h,
300 Evas_Object_Event_Cb mouse_down_cb,
301 Evas_Object_Event_Cb mouse_up_cb);
304 * @ create a box container
306 * @param[in] win_main
308 * @return a box container
310 extern Evas_Object *setting_create_client_bx(Evas_Object *win_main);
313 * The API to Create a lable
316 extern Evas_Object *setting_create_lable(Evas_Object *parent, const char *text,const char *style, const char *align);
319 * The API to Create an object to show an image
320 * @return an object to show an image
322 extern Evas_Object *setting_create_image(Evas_Object *parent, const char *img_path);
325 * The API to Create an object to show anamition image
326 * @return an object to show anamition image
328 extern Evas_Object *setting_create_gif(Evas_Object *parent, const char **png_list);
331 * @ create a popup window which contents a progressbar
332 * @return a popup window which contents a progressbar
334 extern Evas_Object *setting_create_popup_with_progressbar(void *data,
336 char *progressbar_style,
339 setting_call_back_func response_cb,
344 * The general API to create a certain popup window with more than one button.
345 * @return a certain popup window
347 extern Evas_Object *setting_create_popup_with_btn(void *data,
351 setting_call_back_func response_cb,
355 * The general API to create a certain popup window
356 * @return a certain popup window
358 extern Evas_Object *setting_create_popup_without_btn(void *data,
362 setting_call_back_func response_cb,
367 * The API to create a certain popup window with title
368 * @return a certain popup window with title
370 extern int setting_create_simple_popup(void *data,
375 * The API to create a certain popup window with a gif and some buttons
376 * @return a certain popup window with title
378 extern Evas_Object *setting_create_popup_with_gif(void *data,
382 const char **png_list,//array end with 'NULL'.
383 setting_call_back_func response_cb,
388 * The API to create a certain popup window with a check
389 * @return a certain popup window with title
391 extern Evas_Object *setting_create_popup_with_checkview(Evas_Object *parent,
394 Evas_Object *checkview_content,
395 const char *checkview_style,
400 * The API to create a certain popup window with a image, a check and some buttons
401 * @return a certain popup window with title
403 extern Evas_Object *setting_create_popup_with_image_check(void *data,
411 setting_call_back_func response_cb,
415 * Alternate the check object status and its binded vcof value via original vcofn value
417 extern int setting_draw_onoff_status(Evas_Object *obj,
418 setting_bool_slp_list key);
421 * Set the vconf value via its binded check object.
422 * @return 0: sucess, other: failed
424 extern int setting_reset_slp_key_by_status(Evas_Object *obj,
425 setting_bool_slp_list key);
428 * Set the status of check object via its binded vconf value.
429 * @return 0: sucess, other: failed
431 extern int setting_check_onoff_status(Evas_Object *obj,
432 setting_bool_slp_list key);
435 * Set the status of radio group object via its binded vconf value.
436 * @return 0: sucess, other: failed
438 extern int setting_update_chk_status(Evas_Object *chk,
439 setting_int_slp_list type);
442 * Create a size specilized rectangle object
443 * @return a size specilized rectangle object
445 extern Evas_Object *setting_create_blank_rect_customize(Evas_Object *layout,
449 * Create a size fixed rectangle object
451 * @return a size fixed rectangle object
453 extern Evas_Object *setting_create_blank_rect(Evas_Object *layout);
456 * The API to Create an editfiled object
457 * @return an editfiled object
459 extern Evas_Object *setting_create_editfiled(Evas_Object *win_main,
460 char *title, char *def_str);
462 * The API to Create a standard layout
463 * @return a standard layout
465 extern Evas_Object *setting_create_win_layout(Evas_Object *win_layout,
466 Evas_Object *win_obj);
468 * The API to Create a naviframe
469 * @return a naviframe
471 extern Evas_Object *setting_create_navi_bar(Evas_Object *layout);
474 * The API to Create a button
477 extern Evas_Object *setting_create_button(Evas_Object *parent, const char *btn_str,
478 const char *btn_style,
479 setting_call_back_func btn_click_cb,
483 * The API to Create top buttons onto naviframe
484 * @return a naviframe item
486 extern Elm_Object_Item * setting_create_navi_bar_top_buttons(char *title_str,
490 setting_call_back_func lbutton_click_cb,
491 setting_call_back_func rbutton_click_cb,
492 setting_call_back_func mbutton_click_cb,
493 void *cb_data, Evas_Object *eo_view,/*any container obj */
494 Evas_Object *navigate_bar );
497 * Create buttons on the specialized navigation bar
498 * @param[in] eo_view navigation bar's content
499 * @param[in] controlbar title obj of navigation bar
502 setting_create_navi_bar_buttons(char *title_str,
503 char *lbutton_str, char *rbutton_str,
505 setting_call_back_func lbutton_click_cb,
506 setting_call_back_func rbutton_click_cb,
507 setting_call_back_func mbutton_click_cb,
508 void *cb_data, Evas_Object *eo_view,
509 Evas_Object *navigate_bar,
510 Evas_Object *titleobj);
513 * The general API to create a layout with navigation bar,
514 * which contents any evas container object(@param[eo_view]) as its content
516 * @param[in] eo_view navigation bar's content
517 * @param[out] titleobj title obj of navigation bar
519 * return main layout of UG or App..
522 Evas_Object *setting_create_layout_navi_bar(Evas_Object *win_layout,
523 Evas_Object *win_obj,
528 setting_call_back_func lbutton_click_cb,
529 setting_call_back_func rbutton_click_cb,
530 setting_call_back_func mbutton_click_cb,
532 Evas_Object *eo_view,
533 Evas_Object **navi_bar,
534 Evas_Object **titleobj);
537 * The API to create a layout with navigation bar,
538 * which contents a scroller object as its content
540 * @param[out] scroller navigation bar's content
542 * @return a layout with a special navigation bar and at most 2 buttons
544 extern Evas_Object *setting_create_layout_navi_bar_scroller(Evas_Object * win_layout,
545 Evas_Object * win_obj,
549 setting_call_back_func lbutton_click_cb,
550 setting_call_back_func rbutton_click_cb,
552 Evas_Object ** scroller,
553 Evas_Object ** navi_bar);
556 * The API to create a layout with navigation bar,
557 * which contents a genlist object as its content
559 * @return a layout with a special navigation bar and at most 2 buttons
561 extern Evas_Object *setting_create_layout_navi_bar_genlist(Evas_Object * win_layout,
562 Evas_Object * win_obj,
566 setting_call_back_func lbutton_click_cb,
567 setting_call_back_func rbutton_click_cb,
569 Evas_Object ** genlist,
570 Evas_Object ** navi_bar);
573 * The general API to push any evas object(@param[in][eo_view]) to the specialized navi_bar,
574 * which contents at most 3 buttons
576 extern Elm_Object_Item *setting_push_layout_navi_bar(char *title_str,
577 char *lbutton_str, char *rbutton_str,
579 setting_call_back_func lbutton_click_cb,
580 setting_call_back_func rbutton_click_cb,
581 setting_call_back_func mbutton_click_cb,
583 Evas_Object *eo_view,
584 Evas_Object *navi_bar,
585 Evas_Object **titleobj);
588 * The API to push a scroller object(@param[in][scroller]) to the specialized navi_bar,
589 * which contents at most 2 buttons
591 extern void setting_push_layout_navi_bar_scroller(Evas_Object *win_main,
595 setting_call_back_func lbutton_click_cb,
596 setting_call_back_func rbutton_click_cb,
598 Evas_Object **scroller,
599 Evas_Object *navi_bar);
602 * The API to push a genlist object(@param[in][genlist]) to the specialized navi_bar,
603 * which contents at most 2 buttons
606 setting_push_layout_navi_bar_genlist(Evas_Object *win_layout,
607 Evas_Object *win_obj,
611 setting_call_back_func lbutton_click_cb,
612 setting_call_back_func rbutton_click_cb,
614 Evas_Object **genlist,
615 Evas_Object *navi_bar);
618 * Create a text box, which cannot be edited
619 * @return a text box, which cannot be edited
621 extern Evas_Object *setting_create_textbox(Evas_Object *parent,
622 const char *content);
627 * Create selectinfo popup
629 extern void setting_create_sel_info_popup(Evas_Object *parent,
630 Evas_Object **selInfoPop_layout,
631 Evas_Object **selInfoPop);
634 * Check if some item is selected in done-list
636 * @param[in] list_data
639 extern bool setting_done_list_is_some_item_selected(Setting_Done_List_Data *
643 * Do process when clicking the check object in the done-list item
645 extern void setting_done_list_Gendial_chk_btn_cb(void *data, Evas_Object *obj,
649 * The API to create done-list.
650 * @param[in] list_data
651 * @return a done-list
653 extern Evas_Object *setting_create_done_list(Setting_Done_List_Data *
657 * Get searchbar text and register redraw_cb by idler.
660 * @param[in] search_bar
661 * @param[in] search_text
662 * @param[in] search_idler
663 * @param[in] redraw_cb
665 extern int setting_searchbar_redraw(void *data,
666 Evas_Object *search_bar,
668 Ecore_Idler **search_idler,
669 Ecore_Task_Cb redraw_cb);
672 * Create searchar, register change cb and cancel cb.
676 * @param[in] change_cb
677 * @param[in] cancel_cb
679 extern Evas_Object *setting_create_searchbar(void *data, Evas_Object *parent,
680 Evas_Smart_Cb change_cb,
681 Evas_Smart_Cb cancel_cb);
683 #if APPLIED_BACK_KEY_UG
686 * Get the toppest popup in current evas, cross through all the APP and UGs.
690 * @return the toppest popup in current evas
692 extern Evas_Object *get_toppest_popup_window(Evas *evas);
696 * Make it no effect when clicking on a evas object, such as, layout, genlist
699 extern void setting_disable_evas_object(Evas_Object *obj);
702 * Make it normal acting when clicking on a evas object, such as, layout, genlist
705 extern void setting_enable_evas_object(Evas_Object *obj);
708 * To disable a specialized genlist item
711 extern void setting_disable_genlist_item(Elm_Object_Item *item);
714 * To enable a specialized genlist item
717 extern void setting_enable_genlist_item(Elm_Object_Item *item);
720 * To resize a evas object, such as, icon, button..
723 extern void setting_resize_object(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
726 * To create a bg object
729 extern Evas_Object *setting_create_bg(Evas_Object *parent,Evas_Object *win, const char *bg_style);
732 * To make an object which is operated by setting_dim_evas_object normal color
735 * @param[in] b_transparenct:
736 * 1:the appearence of obj is made up of transparent backgroud color.
737 * 0:the appearence of obj is made up of non transparent color.
739 extern void setting_undo_dim_evas_object(Evas_Object *obj, bool b_transparenct);
742 * To make an object dim color
745 * @param[in] b_transparenct:
746 * 1:the appearence of obj is made up of transparent backgroud color.
747 * 0:the appearence of obj is made up of non transparent color.
749 extern void setting_dim_evas_object(Evas_Object *obj, bool b_transparenct);
752 * To make an object looks clickable: if pressed, it is dim color;if unpressed, it is normal color;
756 extern void setting_make_evas_object_clickable(Evas_Object *obj);
758 * To create an icon which looks clickable(if pressed, it is dim color;if unpressed, it is normal color)
761 * @param[in] img_path
767 extern Evas_Object *setting_create_icon(Evas_Object *parent, const char *img_path,
768 Evas_Object_Event_Cb up_cb,
769 Evas_Object_Event_Cb down_cb,
770 Evas_Object_Event_Cb move_cb,
773 * to make sbu-obj the same size as parent-obj.Notice: subobj is the only sub-obj @parent wants to display
780 * To create a button which only has a image and looks clickable
781 * (if pressed, it is dim color;if unpressed, it is normal color)
783 * @param[in] img_path
789 extern Evas_Object *setting_create_image_button(Evas_Object *parent,
791 setting_call_back_func clicked_cb,
792 setting_call_back_func unpressed_cb,
796 * set font_size, color or align(right, left, middle),if need, you
797 * can add </font_siz>, </color> or </align> to controll a segment words; or else
798 * the text will take the same effect until the end of text.
800 extern char *setting_customize_text(const char *input_str, const int font_size,
801 const char *color, const char *align);
804 * To go to top of list in top view of navibar.
807 extern void setting_go_to_navibar_list_top(Evas_Object *navibar);
809 #endif /* __SETTING_COMMON_DRAW_WIDGET_H__ */