4 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
6 * This file is part of org.tizen.setting
7 * Written by Hyejin Kim <hyejin0906.kim@samsung.com>
9 * PROPRIETARY/CONFIDENTIAL
11 * This software is the confidential and proprietary information of
12 * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
13 * disclose such Confidential Information and shall use it only in
14 * accordance with the terms of the license agreement you entered
15 * into with SAMSUNG ELECTRONICS.
17 * SAMSUNG make no representations or warranties about the suitability
18 * of the software, either express or implied, including but not limited
19 * to the implied warranties of merchantability, fitness for a particular
20 * purpose, or non-infringement. SAMSUNG shall not be liable for any
21 * damages suffered by licensee as a result of using, modifying or
22 * distributing this software or its derivatives.
26 *defgroup setting-common-draw-widget
27 *common UI code for reuse
29 #ifndef __SETTING_COMMON_DRAW_WIDGET_H__
30 #define __SETTING_COMMON_DRAW_WIDGET_H__
31 #include <setting-common-data-type.h> /* including all the data structure */
32 #include <setting-common-general-func.h> /* including one class of common functions */
33 #include <setting-common-data-slp-setting.h> /* including another class of common functions */
35 #define SETTING_COMMON_DRAW_WIDGET_CONTROLBAR_ITEM_LEN 3
36 #define POPUP_INTERVAL 2.0
39 * Do process when clicking radio in subitem of expandable item
41 extern void setting_sub_list_rd_change(void *data, Evas_Object *obj,
45 * Hide the input pannel
47 extern void setting_hide_input_pannel_cb(Evas_Object *entry);
50 * Do process when clicking on subitem of expandable item
52 extern void setting_sub_list_sel_cb(void *data, Evas_Object *obj,
56 * Do process when clicking on a common genlist item
58 extern void setting_mouse_up_Gendial_list_radio_cb(void *data,
63 * To intialize an Elm_Genlist_Item_Class, according to item style
65 extern bool setting_create_Gendial_itc(const char *item_style,
66 Elm_Genlist_Item_Class *itc);
69 * Create group style item
70 * @return a pointer to Setting_GenGroupItem_Data
72 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_group_titleItem(Evas_Object *genlist,
73 const Elm_Genlist_Item_Class *itc,
74 Elm_Object_Item *parent,
75 Elm_Genlist_Item_Type flag, /* ELM_GENLIST_ITEM_GROUP or ELM_GENLIST_ITEM_NONE */
77 setting_call_back_func gl_sel);
80 * Create separator style item with title
81 * @return a pointer to Setting_GenGroupItem_Data
83 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_titleItem(
85 const Elm_Genlist_Item_Class *itc,
87 setting_call_back_func gl_sel);
90 * Create 1radion-1text style item
91 * @return a pointer to Setting_GenGroupItem_Data
93 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_1radio(
95 const Elm_Genlist_Item_Class *itc,
96 setting_call_back_func gl_sel,
98 SWALLOW_Type swallow_type,
99 Evas_Object *rgd, int chk_status,
101 setting_call_back_func chk_change_cb);
104 * Create common style item with menu icon
105 * @return a pointer to Setting_GenGroupItem_Data
107 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_groupitem(
108 Evas_Object *genlist,
109 const Elm_Genlist_Item_Class *itc,
110 Elm_Object_Item *parent,
111 setting_call_back_func gl_sel,
113 SWALLOW_Type swallow_type,
115 char *r_icon_path, int chk_status,
116 const char *keyStr, char *sub_desc,
117 setting_call_back_func
121 * Common function to create a genlist item
122 * @return a pointer to Setting_GenGroupItem_Data
124 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_def(Evas_Object *
126 const Elm_Genlist_Item_Class *itc,
127 setting_call_back_func gl_sel,
129 SWALLOW_Type swallow_type,
135 setting_call_back_func chk_change_cb);
138 * Create 1entry style item
139 * @return a pointer to Setting_GenGroupItem_Data
141 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_entry(Evas_Object *genlist,
142 const Elm_Genlist_Item_Class *itc,
143 setting_call_back_func gl_sel,
145 SWALLOW_Type swallow_type,
151 setting_call_back_func chk_change_cb,
152 Elm_Input_Panel_Layout input_type,
161 * General function to create a subitem of expandable item
163 * @return a pointer to Setting_GenGroupItem_Data
165 extern Setting_GenGroupItem_Data *setting_create_Gendial_exp_sub_field(
166 Evas_Object *genlist,
167 const Elm_Genlist_Item_Class *itc,
168 setting_call_back_func gl_sel,
170 Elm_Object_Item *parent,
171 SWALLOW_Type swallow_type,
172 Evas_Object *rgd, int chk_status,
174 setting_call_back_func
178 * General function to create a parent item of expandable item
180 * @return a pointer to Setting_GenGroupItem_Data
182 extern Setting_GenGroupItem_Data *setting_create_Gendial_exp_parent_field(
183 Evas_Object *genlist,
184 const Elm_Genlist_Item_Class *itc,
185 setting_call_back_func gl_sel,
187 SWALLOW_Type swallow_type,
192 * To make genlist support expandable style item
194 extern void setting_enable_expandable_genlist(Evas_Object *genlist, void *data,
195 setting_call_back_func gl_exp_cb,
196 setting_call_back_func
199 extern void setting_begin_progress_genlist_item(Setting_GenGroupItem_Data *
201 extern void setting_finish_progress_genlist_item(Setting_GenGroupItem_Data *
205 * To create slider object of a genlist item
206 * @return a slider container object
208 extern Evas_Object *setting_create_slider(Evas_Object *win_main, Evas *evas,
209 const char *l_swallow_path,
210 const char *r_swallow_path,
211 double value, double slider_min,
213 setting_call_back_func
215 setting_call_back_func
216 slider_start_change_cb,
217 setting_call_back_func
218 slider_stop_change_cb, void *cb_data);
221 * The main implement body of create a certain size icon
223 extern void create_image_box_add_ex(void *data, Evas_Object *win_main,
224 Evas *evas, char *img_path, int img_w,
226 Evas_Object_Event_Cb mouse_down_cb,
227 Evas_Object_Event_Cb mouse_up_cb,
228 Evas_Object **image_box,
232 * To create a size fixed icon
233 * @return a image container object
235 extern Evas_Object *create_image_box_add(void *data, Evas_Object *win_main,
236 Evas *evas, char *img_path, int img_w,
238 Evas_Object_Event_Cb mouse_down_cb,
239 Evas_Object_Event_Cb mouse_up_cb);
242 * @ To create a size specialized icon
243 * @return a image container object
245 extern Evas_Object *create_bgimage_box_add(void *data, Evas_Object *win_main,
246 Evas *evas, char *img_path,
247 int img_w, int img_h,
248 Evas_Object_Event_Cb mouse_down_cb,
249 Evas_Object_Event_Cb mouse_up_cb);
252 * @ create a box container
254 * @param[in] win_main
256 * @return a box container
258 extern Evas_Object *setting_create_client_bx(Evas_Object *win_main);
260 extern Evas_Object *setting_create_image(Evas_Object *parent, const char *img_path);
261 extern Evas_Object *setting_create_gif(Evas_Object *parent, const char **png_list);
264 * @ create a popup window which contents a progressbar
265 * @return a popup window which contents a progressbar
267 extern Evas_Object *setting_create_popup_with_progressbar(void *data,
269 char *progressbar_style,
270 char *progressbar_title,
271 char *progressbar_lable,
272 setting_call_back_func
273 response_cb, int timeout);
274 extern Evas_Object *setting_create_popup_with_btn(void *data, Evas_Object *parent,
275 char *content_str, char *title_str,
276 setting_call_back_func response_cb,
277 int timeout, int btn_num, ...);
280 * The general API to create a certain popup window
281 * @return a certain popup window
283 extern Evas_Object *setting_create_popup_without_btn(void *data, Evas_Object *parent,
284 char *content_str, char *title_str,
285 setting_call_back_func response_cb,
289 * The API to create a certain popup window without title
290 * @return a certain popup window without title
292 extern int setting_create_popup_without_title(void *data, Evas_Object *win_main,
296 * The API to create a certain popup window with title
297 * @return a certain popup window with title
299 extern int setting_create_popup_with_title(void *data, Evas_Object *win_main,
300 char *str_title, char *str_text);
302 extern Evas_Object *setting_create_popup_with_gif(void *data, Evas_Object *parent, char *content_str, char *title_str, const char **png_list, //array end with 'NULL'.
303 setting_call_back_func
304 response_cb, int timeout, int btn_num, ...);
305 extern Evas_Object *setting_create_popup_with_content(void *data, Evas_Object *parent, char *content_str, char *title_str, Evas_Object *content, //content obj below text
307 extern Evas_Object *setting_create_popup_with_check(void *data,
312 setting_call_back_func
313 response_cb, int timeout,
314 Evas_Object **check, int btn_num, ...);
317 * Alternate the check object status and its binded vcof value via original vcofn value
319 extern int setting_draw_onoff_status(Evas_Object *obj,
320 setting_bool_slp_list key);
323 * Set the vconf value via its binded check object.
324 * @return 0: sucess, other: failed
326 extern int setting_reset_slp_key_by_status(Evas_Object *obj,
327 setting_bool_slp_list key);
330 * Set the status of check object via its binded vconf value.
331 * @return 0: sucess, other: failed
333 extern int setting_check_onoff_status(Evas_Object *obj,
334 setting_bool_slp_list key);
337 * Set the status of radio group object via its binded vconf value.
338 * @return 0: sucess, other: failed
340 extern int setting_update_chk_status(Evas_Object *chk,
341 setting_int_slp_list type);
344 * Create a size specilized rectangle object
345 * @return a size specilized rectangle object
347 extern Evas_Object *setting_create_blank_rect_customize(Evas_Object *layout,
351 * Create a size fixed rectangle object
353 * @return a size fixed rectangle object
355 extern Evas_Object *setting_create_blank_rect(Evas_Object *layout);
358 * The API to Create an editfiled object
359 * @return an editfiled object
361 extern Evas_Object *setting_create_editfiled(Evas_Object *win_main,
362 char *title, char *def_str);
364 extern Evas_Object *setting_create_win_layout(Evas_Object *win_layout,
365 Evas_Object *win_obj);
367 extern Evas_Object *setting_create_navi_bar(Evas_Object *layout);
369 extern Evas_Object *setting_create_button(Evas_Object *parent, const char *btn_str,
370 const char *btn_style,
371 setting_call_back_func btn_click_cb,
374 extern Elm_Object_Item * setting_create_navi_bar_top_buttons(char *title_str,
378 setting_call_back_func lbutton_click_cb,
379 setting_call_back_func rbutton_click_cb,
380 setting_call_back_func mbutton_click_cb,
381 void *cb_data, Evas_Object *eo_view,/*any container obj */
382 Evas_Object *navigate_bar );
385 * Create buttons on the specialized navigation bar
386 * @param[in] eo_view navigation bar's content
387 * @param[in] controlbar title obj of navigation bar
390 setting_create_navi_bar_buttons(char *title_str,
391 char *lbutton_str, char *rbutton_str,
393 setting_call_back_func lbutton_click_cb,
394 setting_call_back_func rbutton_click_cb,
395 setting_call_back_func mbutton_click_cb,
396 void *cb_data, Evas_Object *eo_view,
397 Evas_Object *navigate_bar,
398 Evas_Object *controlbar);
401 * The general API to create a layout with navigation bar,
402 * which contents any evas container object(@param[eo_view]) as its content
404 * @param[in] eo_view navigation bar's content
405 * @param[out] titleobj title obj of navigation bar
407 * return main layout of UG or App..
410 Evas_Object *setting_create_layout_navi_bar(Evas_Object *win_layout,
411 Evas_Object *win_obj,
416 setting_call_back_func lbutton_click_cb,
417 setting_call_back_func rbutton_click_cb,
418 setting_call_back_func mbutton_click_cb,
420 Evas_Object *eo_view,
421 Evas_Object **navi_bar,
422 Evas_Object **titleobj);
425 * The API to create a layout with navigation bar,
426 * which contents a scroller object as its content
428 * @param[out] scroller navigation bar's content
430 * @return a layout with a special navigation bar and at most 2 buttons
432 extern Evas_Object *setting_create_layout_navi_bar_scroller(Evas_Object * win_layout,
433 Evas_Object * win_obj,
437 setting_call_back_func lbutton_click_cb,
438 setting_call_back_func rbutton_click_cb,
440 Evas_Object ** scroller,
441 Evas_Object ** navi_bar);
444 * The API to create a layout with navigation bar,
445 * which contents a genlist object as its content
447 * @return a layout with a special navigation bar and at most 2 buttons
449 extern Evas_Object *setting_create_layout_navi_bar_genlist(Evas_Object * win_layout,
450 Evas_Object * win_obj,
454 setting_call_back_func lbutton_click_cb,
455 setting_call_back_func rbutton_click_cb,
457 Evas_Object ** genlist,
458 Evas_Object ** navi_bar);
461 * The general API to push any evas object(@param[in][eo_view]) to the specialized navi_bar,
462 * which contents at most 3 buttons
464 extern void setting_push_layout_navi_bar(char *title_str,
465 char *lbutton_str, char *rbutton_str,
467 setting_call_back_func lbutton_click_cb,
468 setting_call_back_func rbutton_click_cb,
469 setting_call_back_func mbutton_click_cb,
471 Evas_Object *eo_view,
472 Evas_Object *navi_bar,
473 Evas_Object **titleobj);
476 * The API to push a scroller object(@param[in][scroller]) to the specialized navi_bar,
477 * which contents at most 2 buttons
479 extern void setting_push_layout_navi_bar_scroller(Evas_Object *win_main,
483 setting_call_back_func lbutton_click_cb,
484 setting_call_back_func rbutton_click_cb,
486 Evas_Object **scroller,
487 Evas_Object *navi_bar);
490 * The API to push a genlist object(@param[in][genlist]) to the specialized navi_bar,
491 * which contents at most 2 buttons
494 setting_push_layout_navi_bar_genlist(Evas_Object *win_layout,
495 Evas_Object *win_obj,
499 setting_call_back_func lbutton_click_cb,
500 setting_call_back_func rbutton_click_cb,
502 Evas_Object **genlist,
503 Evas_Object *navi_bar);
506 * Create a text box, which cannot be edited
507 * @return a text box, which cannot be edited
509 extern Evas_Object *setting_create_textbox(Evas_Object *parent,
510 const char *content);
515 * hide selectinfo popup
517 extern void sel_info_popup_hide_cb(void *data, Evas *e, Evas_Object *obj,
521 * show selectinfo popup
523 extern void sel_info_popup_show_cb(void *data, Evas *e, Evas_Object *obj,
527 * Create selectinfo popup
529 extern void setting_create_sel_info_popup(Evas_Object *parent,
530 Evas_Object **selInfoPop_layout,
531 Evas_Object **selInfoPop);
534 * Check if some item is selected in done-list
536 * @param[in] list_data
539 extern bool setting_done_list_is_some_item_selected(Setting_Done_List_Data *
543 * Do process when clicking the check object in the done-list item
545 extern void setting_done_list_Gendial_chk_btn_cb(void *data, Evas_Object *obj,
549 * The API to create done-list.
550 * @param[in] list_data
551 * @return a done-list
553 extern Evas_Object *setting_create_done_list(Setting_Done_List_Data *
557 * Get searchbar text and register redraw_cb by idler.
560 * @param[in] search_bar
561 * @param[in] search_text
562 * @param[in] search_idler
563 * @param[in] redraw_cb
565 extern int setting_searchbar_redraw(void *data,
566 Evas_Object *search_bar,
568 Ecore_Idler **search_idler,
569 Ecore_Task_Cb redraw_cb);
572 * Create searchar, register change cb and cancel cb.
576 * @param[in] change_cb
577 * @param[in] cancel_cb
579 extern Evas_Object *setting_create_searchbar(void *data, Evas_Object *parent,
580 Evas_Smart_Cb change_cb,
581 Evas_Smart_Cb cancel_cb);
584 * Make it no effect when clicking on a evas object, such as, layout, genlist
587 extern void setting_disable_evas_object(Evas_Object *obj);
590 * Make it normal acting when clicking on a evas object, such as, layout, genlist
593 extern void setting_enable_evas_object(Evas_Object *obj);
596 * To disable a specialized genlist item
599 extern void setting_disable_genlist_item(Elm_Object_Item *item);
602 * To enable a specialized genlist item
605 extern void setting_enable_genlist_item(Elm_Object_Item *item);
608 * To resize a evas object, such as, icon, button..
611 extern void setting_resize_object(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
614 * To create a bg object
617 extern Evas_Object *setting_create_bg(Evas_Object *parent,Evas_Object *win, const char *bg_style);
620 * To make an object which is operated by setting_dim_evas_object normal color
623 * @param[in] b_transparenct:
624 * 1:the appearence of obj is made up of transparent backgroud color.
625 * 0:the appearence of obj is made up of non transparent color.
627 extern void setting_undo_dim_evas_object(Evas_Object *obj, bool b_transparenct);
630 * To make an object dim color
633 * @param[in] b_transparenct:
634 * 1:the appearence of obj is made up of transparent backgroud color.
635 * 0:the appearence of obj is made up of non transparent color.
637 extern void setting_dim_evas_object(Evas_Object *obj, bool b_transparenct);
640 * To make an object looks clickable: if pressed, it is dim color;if unpressed, it is normal color;
644 extern void setting_make_evas_object_clickable(Evas_Object *obj);
646 * To create an icon which looks clickable(if pressed, it is dim color;if unpressed, it is normal color)
649 * @param[in] img_path
655 extern Evas_Object *setting_create_icon(Evas_Object *parent, const char *img_path,
656 Evas_Object_Event_Cb up_cb,
657 Evas_Object_Event_Cb down_cb,
658 Evas_Object_Event_Cb move_cb,
662 * To create a button which only has a image and looks clickable
663 * (if pressed, it is dim color;if unpressed, it is normal color)
665 * @param[in] img_path
671 extern Evas_Object *setting_create_image_button(Evas_Object *parent,
673 setting_call_back_func clicked_cb,
674 setting_call_back_func unpressed_cb,
678 * set font_size, color or align(right, left, middle),if need, you
679 * can add </font_siz>, </color> or </align> to controll a segment words; or else
680 * the text will take the same effect until the end of text.
682 extern char *setting_customize_text(const char *input_str, const int font_size,
683 const char *color, const char *align);
685 #endif /* __SETTING_COMMON_DRAW_WIDGET_H__ */