2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 *defgroup setting-common-draw-widget
20 *common UI code for reuse
22 #ifndef __SETTING_COMMON_DRAW_WIDGET_H__
23 #define __SETTING_COMMON_DRAW_WIDGET_H__
24 #include <setting-common-data-type.h> /* including all the data structure */
25 #include <setting-common-general-func.h> /* including one class of common functions */
26 #include <setting-common-data-slp-setting.h> /* including another class of common functions */
28 #define SETTING_COMMON_DRAW_WIDGET_CONTROLBAR_ITEM_LEN 3
29 #define POPUP_INTERVAL 2.0
32 * Do process when clicking radio in subitem of expandable item
34 extern void setting_sub_list_rd_change(void *data, Evas_Object *obj,
38 * Hide the input pannel
40 extern void setting_hide_input_pannel_cb(Evas_Object *entry);
43 * Do process when clicking on subitem of expandable item
45 extern void setting_sub_list_sel_cb(void *data, Evas_Object *obj,
49 * Do process when clicking on a common genlist item
51 extern void setting_mouse_up_Gendial_list_radio_cb(void *data,
56 * To intialize an Elm_Genlist_Item_Class, according to item style
58 extern bool setting_create_Gendial_itc(const char *item_style,
59 Elm_Genlist_Item_Class *itc);
62 * Create group style item
63 * @return a pointer to Setting_GenGroupItem_Data
65 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_group_titleItem(Evas_Object *genlist,
66 const Elm_Genlist_Item_Class *itc,
67 Elm_Object_Item *parent,
68 Elm_Genlist_Item_Type flag, /* ELM_GENLIST_ITEM_GROUP or ELM_GENLIST_ITEM_NONE */
70 setting_call_back_func gl_sel);
73 * Create separator style item with title
74 * @return a pointer to Setting_GenGroupItem_Data
76 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_titleItem(
78 const Elm_Genlist_Item_Class *itc,
80 setting_call_back_func gl_sel);
83 * Create 1radion-1text style item
84 * @return a pointer to Setting_GenGroupItem_Data
86 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_1radio(
88 const Elm_Genlist_Item_Class *itc,
89 setting_call_back_func gl_sel,
91 SWALLOW_Type swallow_type,
92 Evas_Object *rgd, int chk_status,
94 setting_call_back_func chk_change_cb);
97 * Create common style item with menu icon
98 * @return a pointer to Setting_GenGroupItem_Data
100 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_groupitem(
101 Evas_Object *genlist,
102 const Elm_Genlist_Item_Class *itc,
103 Elm_Object_Item *parent,
104 setting_call_back_func gl_sel,
106 SWALLOW_Type swallow_type,
108 char *r_icon_path, int chk_status,
109 const char *keyStr, char *sub_desc,
110 setting_call_back_func
114 * Common function to create a genlist item
115 * @return a pointer to Setting_GenGroupItem_Data
117 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_def(Evas_Object *
119 const Elm_Genlist_Item_Class *itc,
120 setting_call_back_func gl_sel,
122 SWALLOW_Type swallow_type,
128 setting_call_back_func chk_change_cb);
131 * Create 1entry style item
132 * @return a pointer to Setting_GenGroupItem_Data
134 extern Setting_GenGroupItem_Data *setting_create_Gendial_field_entry(Evas_Object *genlist,
135 const Elm_Genlist_Item_Class *itc,
136 setting_call_back_func gl_sel,
138 SWALLOW_Type swallow_type,
144 setting_call_back_func chk_change_cb,
145 Elm_Input_Panel_Layout input_type,
154 * General function to create a subitem of expandable item
156 * @return a pointer to Setting_GenGroupItem_Data
158 extern Setting_GenGroupItem_Data *setting_create_Gendial_exp_sub_field(
159 Evas_Object *genlist,
160 const Elm_Genlist_Item_Class *itc,
161 setting_call_back_func gl_sel,
163 Elm_Object_Item *parent,
164 SWALLOW_Type swallow_type,
165 Evas_Object *rgd, int chk_status,
167 setting_call_back_func
171 * General function to create a parent item of expandable item
173 * @return a pointer to Setting_GenGroupItem_Data
175 extern Setting_GenGroupItem_Data *setting_create_Gendial_exp_parent_field(
176 Evas_Object *genlist,
177 const Elm_Genlist_Item_Class *itc,
178 setting_call_back_func gl_sel,
180 SWALLOW_Type swallow_type,
185 * To make genlist support expandable style item
187 extern void setting_enable_expandable_genlist(Evas_Object *genlist, void *data,
188 setting_call_back_func gl_exp_cb,
189 setting_call_back_func
192 extern void setting_begin_progress_genlist_item(Setting_GenGroupItem_Data *
194 extern void setting_finish_progress_genlist_item(Setting_GenGroupItem_Data *
198 * To create slider object of a genlist item
199 * @return a slider container object
201 extern Evas_Object *setting_create_slider(Evas_Object *win_main, Evas *evas,
202 const char *l_swallow_path,
203 const char *r_swallow_path,
204 double value, double slider_min,
206 setting_call_back_func
208 setting_call_back_func
209 slider_start_change_cb,
210 setting_call_back_func
211 slider_stop_change_cb, void *cb_data);
214 * The main implement body of create a certain size icon
216 extern void create_image_box_add_ex(void *data, Evas_Object *win_main,
217 Evas *evas, char *img_path, int img_w,
219 Evas_Object_Event_Cb mouse_down_cb,
220 Evas_Object_Event_Cb mouse_up_cb,
221 Evas_Object **image_box,
225 * To create a size fixed icon
226 * @return a image container object
228 extern Evas_Object *create_image_box_add(void *data, Evas_Object *win_main,
229 Evas *evas, char *img_path, int img_w,
231 Evas_Object_Event_Cb mouse_down_cb,
232 Evas_Object_Event_Cb mouse_up_cb);
235 * @ To create a size specialized icon
236 * @return a image container object
238 extern Evas_Object *create_bgimage_box_add(void *data, Evas_Object *win_main,
239 Evas *evas, char *img_path,
240 int img_w, int img_h,
241 Evas_Object_Event_Cb mouse_down_cb,
242 Evas_Object_Event_Cb mouse_up_cb);
245 * @ create a box container
247 * @param[in] win_main
249 * @return a box container
251 extern Evas_Object *setting_create_client_bx(Evas_Object *win_main);
253 extern Evas_Object *setting_create_image(Evas_Object *parent, const char *img_path);
254 extern Evas_Object *setting_create_gif(Evas_Object *parent, const char **png_list);
257 * @ create a popup window which contents a progressbar
258 * @return a popup window which contents a progressbar
260 extern Evas_Object *setting_create_popup_with_progressbar(void *data,
262 char *progressbar_style,
263 char *progressbar_title,
264 char *progressbar_lable,
265 setting_call_back_func
266 response_cb, int timeout);
267 extern Evas_Object *setting_create_popup_with_btn(void *data, Evas_Object *parent,
268 char *content_str, char *title_str,
269 setting_call_back_func response_cb,
270 int timeout, int btn_num, ...);
273 * The general API to create a certain popup window
274 * @return a certain popup window
276 extern Evas_Object *setting_create_popup_without_btn(void *data, Evas_Object *parent,
277 char *content_str, char *title_str,
278 setting_call_back_func response_cb,
282 * The API to create a certain popup window without title
283 * @return a certain popup window without title
285 extern int setting_create_popup_without_title(void *data, Evas_Object *win_main,
289 * The API to create a certain popup window with title
290 * @return a certain popup window with title
292 extern int setting_create_popup_with_title(void *data, Evas_Object *win_main,
293 char *str_title, char *str_text);
295 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'.
296 setting_call_back_func
297 response_cb, int timeout, int btn_num, ...);
298 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
300 extern Evas_Object *setting_create_popup_with_check(void *data,
305 setting_call_back_func
306 response_cb, int timeout,
307 Evas_Object **check, int btn_num, ...);
310 * Alternate the check object status and its binded vcof value via original vcofn value
312 extern int setting_draw_onoff_status(Evas_Object *obj,
313 setting_bool_slp_list key);
316 * Set the vconf value via its binded check object.
317 * @return 0: sucess, other: failed
319 extern int setting_reset_slp_key_by_status(Evas_Object *obj,
320 setting_bool_slp_list key);
323 * Set the status of check object via its binded vconf value.
324 * @return 0: sucess, other: failed
326 extern int setting_check_onoff_status(Evas_Object *obj,
327 setting_bool_slp_list key);
330 * Set the status of radio group object via its binded vconf value.
331 * @return 0: sucess, other: failed
333 extern int setting_update_chk_status(Evas_Object *chk,
334 setting_int_slp_list type);
337 * Create a size specilized rectangle object
338 * @return a size specilized rectangle object
340 extern Evas_Object *setting_create_blank_rect_customize(Evas_Object *layout,
344 * Create a size fixed rectangle object
346 * @return a size fixed rectangle object
348 extern Evas_Object *setting_create_blank_rect(Evas_Object *layout);
351 * The API to Create an editfiled object
352 * @return an editfiled object
354 extern Evas_Object *setting_create_editfiled(Evas_Object *win_main,
355 char *title, char *def_str);
357 extern Evas_Object *setting_create_win_layout(Evas_Object *win_layout,
358 Evas_Object *win_obj);
360 extern Evas_Object *setting_create_navi_bar(Evas_Object *layout);
362 extern Evas_Object *setting_create_button(Evas_Object *parent, const char *btn_str,
363 const char *btn_style,
364 setting_call_back_func btn_click_cb,
367 extern Elm_Object_Item * setting_create_navi_bar_top_buttons(char *title_str,
371 setting_call_back_func lbutton_click_cb,
372 setting_call_back_func rbutton_click_cb,
373 setting_call_back_func mbutton_click_cb,
374 void *cb_data, Evas_Object *eo_view,/*any container obj */
375 Evas_Object *navigate_bar );
378 * Create buttons on the specialized navigation bar
379 * @param[in] eo_view navigation bar's content
380 * @param[in] controlbar title obj of navigation bar
383 setting_create_navi_bar_buttons(char *title_str,
384 char *lbutton_str, char *rbutton_str,
386 setting_call_back_func lbutton_click_cb,
387 setting_call_back_func rbutton_click_cb,
388 setting_call_back_func mbutton_click_cb,
389 void *cb_data, Evas_Object *eo_view,
390 Evas_Object *navigate_bar,
391 Evas_Object *controlbar);
394 * The general API to create a layout with navigation bar,
395 * which contents any evas container object(@param[eo_view]) as its content
397 * @param[in] eo_view navigation bar's content
398 * @param[out] titleobj title obj of navigation bar
400 * return main layout of UG or App..
403 Evas_Object *setting_create_layout_navi_bar(Evas_Object *win_layout,
404 Evas_Object *win_obj,
409 setting_call_back_func lbutton_click_cb,
410 setting_call_back_func rbutton_click_cb,
411 setting_call_back_func mbutton_click_cb,
413 Evas_Object *eo_view,
414 Evas_Object **navi_bar,
415 Evas_Object **titleobj);
418 * The API to create a layout with navigation bar,
419 * which contents a scroller object as its content
421 * @param[out] scroller navigation bar's content
423 * @return a layout with a special navigation bar and at most 2 buttons
425 extern Evas_Object *setting_create_layout_navi_bar_scroller(Evas_Object * win_layout,
426 Evas_Object * win_obj,
430 setting_call_back_func lbutton_click_cb,
431 setting_call_back_func rbutton_click_cb,
433 Evas_Object ** scroller,
434 Evas_Object ** navi_bar);
437 * The API to create a layout with navigation bar,
438 * which contents a genlist object as its content
440 * @return a layout with a special navigation bar and at most 2 buttons
442 extern Evas_Object *setting_create_layout_navi_bar_genlist(Evas_Object * win_layout,
443 Evas_Object * win_obj,
447 setting_call_back_func lbutton_click_cb,
448 setting_call_back_func rbutton_click_cb,
450 Evas_Object ** genlist,
451 Evas_Object ** navi_bar);
454 * The general API to push any evas object(@param[in][eo_view]) to the specialized navi_bar,
455 * which contents at most 3 buttons
457 extern void setting_push_layout_navi_bar(char *title_str,
458 char *lbutton_str, char *rbutton_str,
460 setting_call_back_func lbutton_click_cb,
461 setting_call_back_func rbutton_click_cb,
462 setting_call_back_func mbutton_click_cb,
464 Evas_Object *eo_view,
465 Evas_Object *navi_bar,
466 Evas_Object **titleobj);
469 * The API to push a scroller object(@param[in][scroller]) to the specialized navi_bar,
470 * which contents at most 2 buttons
472 extern void setting_push_layout_navi_bar_scroller(Evas_Object *win_main,
476 setting_call_back_func lbutton_click_cb,
477 setting_call_back_func rbutton_click_cb,
479 Evas_Object **scroller,
480 Evas_Object *navi_bar);
483 * The API to push a genlist object(@param[in][genlist]) to the specialized navi_bar,
484 * which contents at most 2 buttons
487 setting_push_layout_navi_bar_genlist(Evas_Object *win_layout,
488 Evas_Object *win_obj,
492 setting_call_back_func lbutton_click_cb,
493 setting_call_back_func rbutton_click_cb,
495 Evas_Object **genlist,
496 Evas_Object *navi_bar);
499 * Create a text box, which cannot be edited
500 * @return a text box, which cannot be edited
502 extern Evas_Object *setting_create_textbox(Evas_Object *parent,
503 const char *content);
508 * hide selectinfo popup
510 extern void sel_info_popup_hide_cb(void *data, Evas *e, Evas_Object *obj,
514 * show selectinfo popup
516 extern void sel_info_popup_show_cb(void *data, Evas *e, Evas_Object *obj,
520 * Create selectinfo popup
522 extern void setting_create_sel_info_popup(Evas_Object *parent,
523 Evas_Object **selInfoPop_layout,
524 Evas_Object **selInfoPop);
527 * Check if some item is selected in done-list
529 * @param[in] list_data
532 extern bool setting_done_list_is_some_item_selected(Setting_Done_List_Data *
536 * Do process when clicking the check object in the done-list item
538 extern void setting_done_list_Gendial_chk_btn_cb(void *data, Evas_Object *obj,
542 * The API to create done-list.
543 * @param[in] list_data
544 * @return a done-list
546 extern Evas_Object *setting_create_done_list(Setting_Done_List_Data *
550 * Get searchbar text and register redraw_cb by idler.
553 * @param[in] search_bar
554 * @param[in] search_text
555 * @param[in] search_idler
556 * @param[in] redraw_cb
558 extern int setting_searchbar_redraw(void *data,
559 Evas_Object *search_bar,
561 Ecore_Idler **search_idler,
562 Ecore_Task_Cb redraw_cb);
565 * Create searchar, register change cb and cancel cb.
569 * @param[in] change_cb
570 * @param[in] cancel_cb
572 extern Evas_Object *setting_create_searchbar(void *data, Evas_Object *parent,
573 Evas_Smart_Cb change_cb,
574 Evas_Smart_Cb cancel_cb);
577 * Make it no effect when clicking on a evas object, such as, layout, genlist
580 extern void setting_disable_evas_object(Evas_Object *obj);
583 * Make it normal acting when clicking on a evas object, such as, layout, genlist
586 extern void setting_enable_evas_object(Evas_Object *obj);
589 * To disable a specialized genlist item
592 extern void setting_disable_genlist_item(Elm_Object_Item *item);
595 * To enable a specialized genlist item
598 extern void setting_enable_genlist_item(Elm_Object_Item *item);
601 * To resize a evas object, such as, icon, button..
604 extern void setting_resize_object(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
607 * To create a bg object
610 extern Evas_Object *setting_create_bg(Evas_Object *parent,Evas_Object *win, const char *bg_style);
613 * To make an object which is operated by setting_dim_evas_object normal color
616 * @param[in] b_transparenct:
617 * 1:the appearence of obj is made up of transparent backgroud color.
618 * 0:the appearence of obj is made up of non transparent color.
620 extern void setting_undo_dim_evas_object(Evas_Object *obj, bool b_transparenct);
623 * To make an object dim color
626 * @param[in] b_transparenct:
627 * 1:the appearence of obj is made up of transparent backgroud color.
628 * 0:the appearence of obj is made up of non transparent color.
630 extern void setting_dim_evas_object(Evas_Object *obj, bool b_transparenct);
633 * To make an object looks clickable: if pressed, it is dim color;if unpressed, it is normal color;
637 extern void setting_make_evas_object_clickable(Evas_Object *obj);
639 * To create an icon which looks clickable(if pressed, it is dim color;if unpressed, it is normal color)
642 * @param[in] img_path
648 extern Evas_Object *setting_create_icon(Evas_Object *parent, const char *img_path,
649 Evas_Object_Event_Cb up_cb,
650 Evas_Object_Event_Cb down_cb,
651 Evas_Object_Event_Cb move_cb,
655 * To create a button which only has a image and looks clickable
656 * (if pressed, it is dim color;if unpressed, it is normal color)
658 * @param[in] img_path
664 extern Evas_Object *setting_create_image_button(Evas_Object *parent,
666 setting_call_back_func clicked_cb,
667 setting_call_back_func unpressed_cb,
671 * set font_size, color or align(right, left, middle),if need, you
672 * can add </font_siz>, </color> or </align> to controll a segment words; or else
673 * the text will take the same effect until the end of text.
675 extern char *setting_customize_text(const char *input_str, const int font_size,
676 const char *color, const char *align);
678 #endif /* __SETTING_COMMON_DRAW_WIDGET_H__ */