3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Flora License, Version 1.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://floralicense.org/license/
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an AS IS BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 *default group setting-common-draw-widget
19 *common UI code for reuse
21 #ifndef __SETTING_COMMON_DRAW_WIDGET_H__
22 #define __SETTING_COMMON_DRAW_WIDGET_H__
23 #include <setting-common-data-type.h> /* including all the data structure */
24 #include <setting-common-general-func.h> /* including one class of common functions */
25 #include <setting-common-data-slp-setting.h> /* including another class of common functions */
27 #define SETTING_COMMON_DRAW_WIDGET_CONTROLBAR_ITEM_LEN 3
28 #define POPUP_INTERVAL 2.0
30 extern const Elm_Genlist_Item_Class itc_seperator;
31 extern const Elm_Genlist_Item_Class itc_bottom_seperator;
32 extern const Elm_Genlist_Item_Class itc_sep_line;
34 extern const Elm_Genlist_Item_Class itc_1text;
35 extern const Elm_Genlist_Item_Class itc_1text_1icon_2;
37 extern const Elm_Genlist_Item_Class itc_1icon;
38 extern const Elm_Genlist_Item_Class itc_1icon_1text_sub;
39 extern const Elm_Genlist_Item_Class itc_1text_1icon;
40 extern const Elm_Genlist_Item_Class itc_1text_2icon;
41 extern const Elm_Genlist_Item_Class itc_1text_2icon_2;
43 extern const Elm_Genlist_Item_Class itc_2text_2;
44 extern const Elm_Genlist_Item_Class itc_2text;
45 extern const Elm_Genlist_Item_Class itc_multiline_2text_1icon;
46 extern const Elm_Genlist_Item_Class itc_2text_1icon_3;
47 extern const Elm_Genlist_Item_Class itc_2text_1icon_6;
48 extern const Elm_Genlist_Item_Class itc_2text_1icon_7;
50 extern const Elm_Genlist_Item_Class itc_2text_3_parent;
51 extern const Elm_Genlist_Item_Class itc_2text_3;
52 extern const Elm_Genlist_Item_Class itc_2text_2icon_3;
54 extern const Elm_Genlist_Item_Class itc_multiline_text;
55 extern const Elm_Genlist_Item_Class itc_1text_1icon_3_tb;
56 extern const Elm_Genlist_Item_Class itc_cm_1text_1icon_2;
57 extern const Elm_Genlist_Item_Class itc_sel_all;
58 extern const Elm_Genlist_Item_Class itc_bg_1icon;
59 extern const Elm_Genlist_Item_Class itc_group_item;
63 * Do process when clicking radio in subitem of expandable item
65 extern void setting_sub_list_rd_change(void *data, Evas_Object *obj,
69 * Hide the input pannel
71 extern void setting_hide_input_pannel_cb(Evas_Object *entry);
74 * Do process when clicking on subitem of expandable item
76 extern void setting_sub_list_sel_cb(void *data, Evas_Object *obj,
80 * Do process when clicking on a common genlist item
82 extern void setting_mouse_up_Gendial_list_radio_cb(void *data,
87 * To intialize an Elm_Genlist_Item_Class, according to item style
89 extern bool setting_create_Gendial_itc(const char *item_style,
90 Elm_Genlist_Item_Class *itc);
93 * Create group style item
94 * @return a pointer to Setting_GenGroupItem_Data
96 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_group_titleItem(Evas_Object *genlist,
97 const Elm_Genlist_Item_Class *itc,
98 Elm_Object_Item *parent,
99 Elm_Genlist_Item_Type flag, /* ELM_GENLIST_ITEM_GROUP or ELM_GENLIST_ITEM_NONE */
101 setting_call_back_func gl_sel);
104 * Create separator style item with title
105 * @return a pointer to Setting_GenGroupItem_Data
107 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_titleItem(
108 Evas_Object *genlist,
109 const Elm_Genlist_Item_Class *itc,
111 setting_call_back_func gl_sel);
114 * Create 1radion-1text style item
115 * @return a pointer to Setting_GenGroupItem_Data
117 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_1radio(
118 Evas_Object *genlist,
119 const Elm_Genlist_Item_Class *itc,
120 setting_call_back_func gl_sel,
122 SWALLOW_Type swallow_type,
123 Evas_Object *rgd, int chk_status,
125 setting_call_back_func chk_change_cb);
127 * Create 2radion style item
128 * @return a pointer to Setting_GenGroupItem_Data
130 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_2radio(
131 Evas_Object *genlist,
132 const Elm_Genlist_Item_Class *itc,
133 setting_call_back_func gl_sel,
135 SWALLOW_Type swallow_type,
136 Evas_Object *rgd, int chk_status,
138 const char *sub_desc,
139 setting_call_back_func chk_change_cb);
142 * Create common style item with menu icon
143 * @return a pointer to Setting_GenGroupItem_Data
145 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_groupitem(
146 Evas_Object *genlist,
147 const Elm_Genlist_Item_Class *itc,
148 Elm_Object_Item *parent,
149 setting_call_back_func gl_sel,
151 SWALLOW_Type swallow_type,
153 char *r_icon_path, int chk_status,
154 const char *keyStr, char *sub_desc,
155 setting_call_back_func
159 * Common function to create a genlist item
160 * @return a pointer to Setting_GenGroupItem_Data
162 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_def(Evas_Object *
164 const Elm_Genlist_Item_Class *itc,
165 setting_call_back_func gl_sel,
167 SWALLOW_Type swallow_type,
173 setting_call_back_func chk_change_cb);
176 * Create 1entry style item
177 * @return a pointer to Setting_GenGroupItem_Data
179 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_entry(Evas_Object *genlist,
180 const Elm_Genlist_Item_Class *itc,
181 setting_call_back_func gl_sel,
183 SWALLOW_Type swallow_type,
189 setting_call_back_func chk_change_cb,
190 Elm_Input_Panel_Layout input_type,
199 * Create 1entry style item
200 * @return a pointer to Setting_GenGroupItem_Data
202 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_entry_fo(Evas_Object *genlist,
203 const Elm_Genlist_Item_Class *itc,
204 setting_call_back_func gl_sel,
206 SWALLOW_Type swallow_type,
212 setting_call_back_func chk_change_cb,
213 setting_call_back_func chk_focus_out_cb,
214 Elm_Input_Panel_Layout input_type,
224 * General function to create a subitem of expandable item
226 * @return a pointer to Setting_GenGroupItem_Data
228 extern Setting_GenGroupItem_Data *setting_create_Gendial_exp_sub_field(
229 Evas_Object *genlist,
230 const Elm_Genlist_Item_Class *itc,
231 setting_call_back_func gl_sel,
233 Elm_Object_Item *parent,
234 SWALLOW_Type swallow_type,
235 Evas_Object *rgd, int chk_status,
237 setting_call_back_func
241 * General function to create a parent item of expandable item
243 * @return a pointer to Setting_GenGroupItem_Data
245 extern Setting_GenGroupItem_Data *setting_create_Gendial_exp_parent_field(
246 Evas_Object *genlist,
247 const Elm_Genlist_Item_Class *itc,
248 setting_call_back_func gl_sel,
250 SWALLOW_Type swallow_type,
255 * To make genlist support expandable style item
257 extern void setting_enable_expandable_genlist(Evas_Object *genlist, void *data,
258 setting_call_back_func gl_exp_cb,
259 setting_call_back_func
263 * The API to let an item which with processbar go into "processing"
266 extern void setting_begin_progress_genlist_item(Setting_GenGroupItem_Data *
269 * The API to let an item which with processbar go into "processed"
272 extern void setting_finish_progress_genlist_item(Setting_GenGroupItem_Data *
276 * To create slider object of a genlist item
277 * @return a slider container object
279 extern Evas_Object *setting_create_slider(Evas_Object *win_main, Evas *evas,
280 const char *l_swallow_path,
281 const char *r_swallow_path,
286 setting_call_back_func
288 setting_call_back_func
289 slider_start_change_cb,
290 setting_call_back_func
291 slider_stop_change_cb, void *cb_data);
294 * The main implement body of create a certain size icon
296 extern void create_image_box_add_ex(void *data, Evas_Object *win_main,
297 Evas *evas, char *img_path, int img_w,
299 Evas_Object_Event_Cb mouse_down_cb,
300 Evas_Object_Event_Cb mouse_up_cb,
301 Evas_Object **image_box,
305 * To create a size fixed icon
306 * @return a image container object
308 extern Evas_Object *create_image_box_add(void *data, Evas_Object *win_main,
309 Evas *evas, char *img_path, int img_w,
311 Evas_Object_Event_Cb mouse_down_cb,
312 Evas_Object_Event_Cb mouse_up_cb);
315 * @ To create a size specialized icon
316 * @return a image container object
318 extern Evas_Object *create_bgimage_box_add(void *data, Evas_Object *win_main,
319 Evas *evas, char *img_path,
320 int img_w, int img_h,
321 Evas_Object_Event_Cb mouse_down_cb,
322 Evas_Object_Event_Cb mouse_up_cb);
325 * @ create a box container
327 * @param[in] win_main
329 * @return a box container
331 extern Evas_Object *setting_create_client_bx(Evas_Object *win_main);
334 * The API to Create a lable
337 extern Evas_Object *setting_create_lable(Evas_Object *parent, const char *text,const char *style, const char *align);
340 * The API to Create an object to show an image
341 * @return an object to show an image
343 extern Evas_Object *setting_create_image(Evas_Object *parent, const char *img_path);
346 * The API to Create an object to show anamition image
347 * @return an object to show anamition image
349 extern Evas_Object *setting_create_gif(Evas_Object *parent, const char **png_list);
352 * @ create a popup window which contents a progressbar
353 * @return a popup window which contents a progressbar
355 extern Evas_Object *setting_create_popup_with_progressbar(void *data,
357 char *progressbar_style,
360 setting_call_back_func response_cb,
365 * The general API to create a certain popup window with more than one button.
366 * @return a certain popup window
368 extern Evas_Object *setting_create_popup_with_btn(void *data,
372 setting_call_back_func response_cb,
376 * The general API to create a certain popup window
377 * @return a certain popup window
379 extern Evas_Object *setting_create_popup_without_btn(void *data,
383 setting_call_back_func response_cb,
388 * The API to create a certain popup window with title
389 * @return a certain popup window with title
391 extern int setting_create_simple_popup(void *data,
396 * The API to create a certain popup window with a gif and some buttons
397 * @return a certain popup window with title
399 extern Evas_Object *setting_create_popup_with_gif(void *data,
403 const char **png_list,//array end with 'NULL'.
404 setting_call_back_func response_cb,
409 * The API to create a certain popup window with a check
410 * @return a certain popup window with title
412 extern Evas_Object *setting_create_popup_with_checkview(Evas_Object *parent,
415 Evas_Object *checkview_content,
416 const char *checkview_style,
421 * The API to create a certain popup window with a image, a check and some buttons
422 * @return a certain popup window with title
424 extern Evas_Object *setting_create_popup_with_image_check(void *data,
432 setting_call_back_func response_cb,
436 * Alternate the check object status and its binded vcof value via original vcofn value
438 extern int setting_draw_onoff_status(Evas_Object *obj,
439 setting_bool_slp_list key);
442 * Set the vconf value via its binded check object.
443 * @return 0: sucess, other: failed
445 extern int setting_reset_slp_key_by_status(Evas_Object *obj,
446 setting_bool_slp_list key);
449 * Set the status of check object via its binded vconf value.
450 * @return 0: sucess, other: failed
452 extern int setting_check_onoff_status(Evas_Object *obj,
453 setting_bool_slp_list key);
456 * Set the status of radio group object via its binded vconf value.
457 * @return 0: sucess, other: failed
459 extern int setting_update_chk_status(Evas_Object *chk,
460 setting_int_slp_list type);
463 * Create a size specilized rectangle object
464 * @return a size specilized rectangle object
466 extern Evas_Object *setting_create_blank_rect_customize(Evas_Object *layout,
470 * Create a size fixed rectangle object
472 * @return a size fixed rectangle object
474 extern Evas_Object *setting_create_blank_rect(Evas_Object *layout);
477 * The API to Create an editfiled object
478 * @return an editfiled object
480 extern Evas_Object *setting_create_editfiled(Evas_Object *win_main,
481 char *title, char *def_str);
483 * The API to Create a standard layout
484 * @return a standard layout
486 extern Evas_Object *setting_create_win_layout(Evas_Object *win_layout,
487 Evas_Object *win_obj);
489 * The API to Create a naviframe
490 * @return a naviframe
492 extern Evas_Object *setting_create_navi_bar(Evas_Object *layout);
495 * The API to Create a button
498 extern Evas_Object *setting_create_button(Evas_Object *parent, const char *btn_str,
499 const char *btn_style,
500 setting_call_back_func btn_click_cb,
504 * The API to Create top buttons onto naviframe
505 * @return a naviframe item
507 extern Elm_Object_Item * setting_create_navi_bar_top_buttons(char *title_str,
511 setting_call_back_func lbutton_click_cb,
512 setting_call_back_func rbutton_click_cb,
513 setting_call_back_func mbutton_click_cb,
514 void *cb_data, Evas_Object *eo_view,/*any container obj */
515 Evas_Object *navigate_bar );
518 * Create buttons on the specialized navigation bar
519 * @param[in] eo_view navigation bar's content
520 * @param[in] controlbar title obj of navigation bar
523 setting_create_navi_bar_buttons(char *title_str,
524 char *lbutton_str, char *rbutton_str,
526 setting_call_back_func lbutton_click_cb,
527 setting_call_back_func rbutton_click_cb,
528 setting_call_back_func mbutton_click_cb,
529 void *cb_data, Evas_Object *eo_view,
530 Evas_Object *navigate_bar,
531 Evas_Object *titleobj);
534 * The general API to create a layout with navigation bar,
535 * which contents any evas container object(@param[eo_view]) as its content
537 * @param[in] eo_view navigation bar's content
538 * @param[out] titleobj title obj of navigation bar
540 * return main layout of UG or App..
543 Evas_Object *setting_create_layout_navi_bar(Evas_Object *win_layout,
544 Evas_Object *win_obj,
549 setting_call_back_func lbutton_click_cb,
550 setting_call_back_func rbutton_click_cb,
551 setting_call_back_func mbutton_click_cb,
553 Evas_Object *eo_view,
554 Evas_Object **navi_bar,
555 Evas_Object **titleobj);
558 * The API to create a layout with navigation bar,
559 * which contents a scroller object as its content
561 * @param[out] scroller navigation bar's content
563 * @return a layout with a special navigation bar and at most 2 buttons
565 extern Evas_Object *setting_create_layout_navi_bar_scroller(Evas_Object * win_layout,
566 Evas_Object * win_obj,
570 setting_call_back_func lbutton_click_cb,
571 setting_call_back_func rbutton_click_cb,
573 Evas_Object ** scroller,
574 Evas_Object ** navi_bar);
577 * The API to create a layout with navigation bar,
578 * which contents a genlist object as its content
580 * @return a layout with a special navigation bar and at most 2 buttons
582 extern Evas_Object *setting_create_layout_navi_bar_genlist(Evas_Object * win_layout,
583 Evas_Object * win_obj,
587 setting_call_back_func lbutton_click_cb,
588 setting_call_back_func rbutton_click_cb,
590 Evas_Object ** genlist,
591 Evas_Object ** navi_bar);
594 * The general API to push any evas object(@param[in][eo_view]) to the specialized navi_bar,
595 * which contents at most 3 buttons
597 extern Elm_Object_Item *setting_push_layout_navi_bar(char *title_str,
598 char *lbutton_str, char *rbutton_str,
600 setting_call_back_func lbutton_click_cb,
601 setting_call_back_func rbutton_click_cb,
602 setting_call_back_func mbutton_click_cb,
604 Evas_Object *eo_view,
605 Evas_Object *navi_bar,
606 Evas_Object **titleobj);
609 * The API to push a scroller object(@param[in][scroller]) to the specialized navi_bar,
610 * which contents at most 2 buttons
612 extern void setting_push_layout_navi_bar_scroller(Evas_Object *win_main,
616 setting_call_back_func lbutton_click_cb,
617 setting_call_back_func rbutton_click_cb,
619 Evas_Object **scroller,
620 Evas_Object *navi_bar);
623 * The API to push a genlist object(@param[in][genlist]) to the specialized navi_bar,
624 * which contents at most 2 buttons
627 setting_push_layout_navi_bar_genlist(Evas_Object *win_layout,
628 Evas_Object *win_obj,
632 setting_call_back_func lbutton_click_cb,
633 setting_call_back_func rbutton_click_cb,
635 Evas_Object **genlist,
636 Evas_Object *navi_bar);
639 * Create a text box, which cannot be edited
640 * @return a text box, which cannot be edited
642 extern Evas_Object *setting_create_textbox(Evas_Object *parent,
643 const char *content);
648 * Create selectinfo popup
650 extern void setting_create_sel_info_popup(Evas_Object *parent,
651 Evas_Object **selInfoPop_layout,
652 Evas_Object **selInfoPop);
655 * Check if some item is selected in done-list
657 * @param[in] list_data
660 extern bool setting_done_list_is_some_item_selected(Setting_Done_List_Data *
664 * Do process when clicking the check object in the done-list item
666 extern void setting_done_list_Gendial_chk_btn_cb(void *data, Evas_Object *obj,
670 * The API to create done-list.
671 * @param[in] list_data
672 * @return a done-list
674 extern Evas_Object *setting_create_done_list(Setting_Done_List_Data *
678 * Get searchbar text and register redraw_cb by idler.
681 * @param[in] search_bar
682 * @param[in] search_text
683 * @param[in] search_idler
684 * @param[in] redraw_cb
686 extern int setting_searchbar_redraw(void *data,
687 Evas_Object *search_bar,
689 Ecore_Idler **search_idler,
690 Ecore_Task_Cb redraw_cb);
693 * Create searchar, register change cb and cancel cb.
697 * @param[in] change_cb
698 * @param[in] cancel_cb
700 extern Evas_Object *setting_create_searchbar(void *data, Evas_Object *parent,
701 Evas_Smart_Cb change_cb,
702 Evas_Smart_Cb cancel_cb);
704 #if APPLIED_BACK_KEY_UG
707 * Get the toppest popup in current evas, cross through all the APP and UGs.
711 * @return the toppest popup in current evas
713 extern Evas_Object *get_toppest_popup_window(Evas *evas);
717 * Make it no effect when clicking on a evas object, such as, layout, genlist
720 extern void setting_disable_evas_object(Evas_Object *obj);
723 * Make it normal acting when clicking on a evas object, such as, layout, genlist
726 extern void setting_enable_evas_object(Evas_Object *obj);
729 * To disable a specialized genlist item
732 extern void setting_disable_genlist_item(Elm_Object_Item *item);
735 * To enable a specialized genlist item
738 extern void setting_enable_genlist_item(Elm_Object_Item *item);
741 * To resize a evas object, such as, icon, button..
744 extern void setting_resize_object(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
747 * To create a bg object
750 extern Evas_Object *setting_create_bg(Evas_Object *parent,Evas_Object *win, const char *bg_style);
753 * To make an object which is operated by setting_dim_evas_object normal 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_undo_dim_evas_object(Evas_Object *obj, bool b_transparenct);
763 * To make an object dim color
766 * @param[in] b_transparenct:
767 * 1:the appearence of obj is made up of transparent backgroud color.
768 * 0:the appearence of obj is made up of non transparent color.
770 extern void setting_dim_evas_object(Evas_Object *obj, bool b_transparenct);
773 * To make an object looks clickable: if pressed, it is dim color;if unpressed, it is normal color;
777 extern void setting_make_evas_object_clickable(Evas_Object *obj);
779 * To create an icon which looks clickable(if pressed, it is dim color;if unpressed, it is normal color)
782 * @param[in] img_path
788 extern Evas_Object *setting_create_icon(Evas_Object *parent, const char *img_path,
789 Evas_Object_Event_Cb up_cb,
790 Evas_Object_Event_Cb down_cb,
791 Evas_Object_Event_Cb move_cb,
794 * to make sbu-obj the same size as parent-obj.Notice: subobj is the only sub-obj @parent wants to display
801 * To create a button which only has a image and looks clickable
802 * (if pressed, it is dim color;if unpressed, it is normal color)
804 * @param[in] img_path
810 extern Evas_Object *setting_create_image_button(Evas_Object *parent,
812 setting_call_back_func clicked_cb,
813 setting_call_back_func unpressed_cb,
817 * set font_size, color or align(right, left, middle),if need, you
818 * can add </font_siz>, </color> or </align> to controll a segment words; or else
819 * the text will take the same effect until the end of text.
821 extern char *setting_customize_text(const char *input_str, const int font_size,
822 const char *color, const char *align);
825 * To go to top of list in top view of navibar.
828 extern void setting_go_to_navibar_list_top(Evas_Object *navibar);
830 #endif /* __SETTING_COMMON_DRAW_WIDGET_H__ */