c3d16887c68b69082db03d45d7c3ff637aa25f91
[profile/mobile/apps/native/accessibility-setting.git] / src / setting-common-draw-widget.h
1 /*
2  * setting
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
5  *
6  * Contact: MyoungJune Park <mj2004.park@samsung.com>
7  *
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
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
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.
19  *
20  */
21 /**
22  *default group setting-common-draw-widget
23  *common UI code for reuse
24  */
25 #ifndef __SETTING_COMMON_DRAW_WIDGET_H__
26 #define __SETTING_COMMON_DRAW_WIDGET_H__
27
28 #include "setting-common-data-type.h"
29 #include "setting-common-general-func.h"
30
31 extern const Elm_Genlist_Item_Class itc_1text;
32 extern const Elm_Genlist_Item_Class itc_1text_1icon_2;
33
34 extern const Elm_Genlist_Item_Class itc_1icon;
35 extern const Elm_Genlist_Item_Class itc_1icon_1text_sub;
36 extern const Elm_Genlist_Item_Class itc_1text_1icon;
37 extern const Elm_Genlist_Item_Class itc_1text_1icon_3;
38 extern const Elm_Genlist_Item_Class itc_1text_2icon;
39
40 extern const Elm_Genlist_Item_Class itc_2text_2;
41 extern const Elm_Genlist_Item_Class itc_2text;
42 extern const Elm_Genlist_Item_Class itc_2text_1icon_3;
43 extern const Elm_Genlist_Item_Class itc_2text_1icon_2;
44
45 extern const Elm_Genlist_Item_Class itc_2text_3_parent;
46 extern const Elm_Genlist_Item_Class itc_2text_3;
47 extern const Elm_Genlist_Item_Class itc_2text_2icon_3;
48
49 extern const Elm_Genlist_Item_Class itc_multiline_text;
50 extern const Elm_Genlist_Item_Class itc_bg_1icon;
51 extern const Elm_Genlist_Item_Class itc_group_item;
52 extern const Elm_Genlist_Item_Class itc_multiline_1text_1icon;
53
54 extern const Elm_Genlist_Item_Class itc_multiline_2text;
55 extern const Elm_Genlist_Item_Class itc_1text_1icon_divider;
56
57 /**
58  * Hide the input pannel
59  */
60 extern void setting_hide_input_pannel_cb(Evas_Object *entry);
61
62 /**
63  * Create separator style item with title
64  * @return a pointer to GenGroupItemData
65  */
66 extern GenGroupItemData *createGendialTitleItem(
67                 Evas_Object *genlist, const Elm_Genlist_Item_Class *itc,
68                 const std::string& keyStr);
69
70 /**
71  * Common function to create a genlist item
72  * @return a pointer to GenGroupItemData
73  */
74 GenGroupItemData *createGendialGroupItem(
75                 Evas_Object *genlist, const Elm_Genlist_Item_Class *itc,
76                 SettingCallback gl_sel,
77                 void *sel_data, SwallowType swallow_type, int chk_status, const std::string& keyStr,
78                 const std::string& sub_desc, SettingCallback chk_change_cb);
79
80 /**
81  * To create slider object of a genlist item
82  * @return a slider container object
83  */
84 extern Evas_Object *setting_create_slider(Evas_Object *window,
85                 GenGroupItemData *item_data);
86
87 /**
88  * To create slider object of a genlist item
89  * @return a slider container object
90  */
91 extern Evas_Object *setting_create_5step_slider(Evas_Object *window,
92                 Evas *evas, const char *l_swallow_path,
93                 const char *r_swallow_path, double value,
94                 bool indicator, double slider_min, double slider_max,
95                 SettingCallback slider_change_cb,
96                 SettingCallback slider_start_change_cb,
97                 SettingCallback slider_stop_change_cb, void *cb_data);
98
99 /**
100  * The API to Create a button
101  * @return a button
102  */
103 extern Evas_Object *setting_create_button(Evas_Object *parent,
104                 const char *btn_str, const char *btn_style,
105                 Evas_Smart_Cb btn_click_cb, void *cb_data);
106
107 extern void __gl_realized_cb(void *data, Evas_Object *obj, void *event_info);
108
109 extern void setting_update_gl_item_chk_status(
110                 GenGroupItemData *item_data, int status);
111
112 extern void setting_conformant_keypad_state(Evas_Object *conform, bool enable);
113
114 extern void setting_decorate_image_RGBA(Evas_Object *obj, int r, int g, int b,
115                 int a);
116
117 extern void setting_popup_del_cb(void *data, Evas_Object *obj,
118                 void *event_info);
119 extern void setting_popup_event_set(Evas_Object *popup, void *data,
120                 SettingCallback response_cb,
121                 int timeout,/*to control the timeout time */
122                 bool blocked_flag,/*to control whether to block the screen */
123                 bool keygrab_flag/*to control whether to block the 'Home key' */
124                 );
125
126 /*********************************************************
127  * @brief The general API to create a default popup window
128  *
129  * @param data                  application context
130  * @param parent                parent window
131  * @param title                 popup title
132  * @param text                  popup text
133  * @param response_cb   called When btn was clicked
134  * @param timeout               timeout sec
135  * @param blocked_flag  to control whether to block the screen
136  * @param keygrab_flag  to control whether to block key
137  * @param btn_num               btn number
138  * @param ...                   btn text
139  *
140  * @return a certain popup window
141  **********************************************************/
142 Evas_Object *setting_create_popup(void *data, Evas_Object *parent,
143                 const char *title, const char *text,
144                 SettingCallback response_cb, int timeout,
145                 bool blocked_flag,
146                 bool keygrab_flag, int btn_num, ...);
147
148 /******************************************************************
149  * @brief The general API to create a popup window which contents a genlist
150  *
151  * @param genlist                       genlist
152  * @param data                          application context
153  * @param parent                        parent window
154  * @param title                         popup title
155  * @param response_cb           called When btn was clicked
156  * @param timeout                       timeout sec
157  * @param blocked_flag          to control whether to block the screen
158  * @param keygrab_flag          to control whether to block key
159  *
160  * @return a popup window which contents a genlist
161  *******************************************************************/
162 Evas_Object *setting_create_popup_with_list(
163                 Evas_Object **genlist,
164                 void *data, Evas_Object *parent, const char *title,
165                 SettingCallback response_cb, int timeout,
166                 bool blocked_flag,
167                 bool keygrab_flag, int btn_num, ...);
168
169 #endif          /* __SETTING_COMMON_DRAW_WIDGET_H__ */