tizen 2.3.1 release
[apps/home/settings.git] / setting-phone / include / setting-phone.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 #ifndef __SETTING_PHONE_H__
22 #define __SETTING_PHONE_H__
23
24 #include <stdio.h>
25 #include <Elementary.h>
26
27 #include <glib-object.h>
28
29 #include <setting-common-draw-widget.h>
30 #include <setting-common-view.h>
31
32 #include <aul.h>
33
34 #ifdef Status
35 #undef Status
36 #endif
37 #include <tapi_common.h>
38 #include <ITapiSim.h>
39 #include <TapiUtility.h>
40
41 #include <unicode/ucal.h>
42 #include <unicode/uloc.h>
43 #include <unicode/udat.h>
44 #include <unicode/ustring.h>
45 #include <unicode/udatpg.h>
46 #include <unicode/utmscale.h>
47 #include <unicode/ucol.h>
48
49 /* Choose default programe*/
50 #define Display_APP_Full_Name 1
51 #define MAX_APP_NAME 1024
52 #define IMAGES_MIME_TYPE "image/png"    /* temporary implement */
53 #define SOUNDS_MIME_TYPE "audio/mpeg"   /* temporary implement */
54 #define VIDEOS_MIME_TYPE "video/3gpp"   /* temporary implement */
55 #define OTHERS_MIME_TYPE "application/pdf"      /* temporary implement */
56 #define TBL_NAME "menu"
57 #define MIME_FIELD_NAME "mimetype"
58 #define NAME_BUF_LEN (128)
59
60 #define REGION_ITEM_MAX 300
61
62 #define SETTING_PHONE_REGION_RECT_SIZE_W                ((int)720 * WIDGET_SCALE_FACTOR)
63 #define SETTING_PHONE_REGION_RECT_SIZE_H                ((int)1280 * WIDGET_SCALE_FACTOR)
64
65 #define ASK_DEREG_PHONE "<linesize=44>Your phone is<br>already registered.<br> Are you sure you<br>wish to deregister?"
66 #define REGISTRATION_GET_FAILED _("IDS_ST_POP_REGISTRATION_CODE_NOT_FOUND")
67 #define REGISTRATION_INDICATOT "IDS_ST_BODY_YOUR_DEVICE_REGISTRATION_CODE_C_PS"
68 #define REGISTRATION_AT "IDS_ST_BODY_REGISTER_AT"
69 #define DEREGISTRATION_INDICATOT "<br><br>Your device<br>deregistration code:<br><br>"
70 #define EREGISTRATION_AT "<br><br><br>Deregister at"
71 #define TRANSFER_INFO "IDS_ST_BODY_EXPLANATION_FOR_TRANSACTION_TRACKING_MENU_VODA"
72
73 #define REGION_FORMAT_LOWER "IDS_ST_BODY_REGION"
74
75 typedef struct _SettingPhoneUG SettingPhoneUG;
76
77 /**
78  * Setting Phone UG context
79  * all UG function has void* as an agument. this is casted back to SettingPhoneUG
80  * and the functions access app context.
81  */
82 struct _SettingPhoneUG {
83         ui_gadget_h ug;
84         TapiHandle *handle;
85
86         /* add more variables here (move your appdata to here) */
87         Evas *evas;
88         Evas_Object *win_main_layout;
89         Evas_Object *win_get;
90         ui_gadget_h ug_loading;
91
92         Evas_Object *gl_lang_region;
93         Evas_Object *gl_lang;
94         Evas_Object *gl_region;
95
96         Evas_Object *ly_region;
97
98         Evas_Object *navi_bar;
99         Evas_Object *popup;
100         Evas_Object *popup_clear_license;
101         void (*popup_cb)(void *data, Evas_Object *obj, void *event_info);
102
103         int intial_shaking_value;
104
105         Evas_Object *ly_language;
106         Evas_Object *ly_ticker;
107         Evas_Object *ly_license;
108
109
110         /* [UI] notification details */
111         Setting_GenGroupItem_Data *data_details_notification;
112         Setting_GenGroupItem_Data *data_details_sound;
113         Setting_GenGroupItem_Data *data_details_display_content;
114         Setting_GenGroupItem_Data *data_details_badge;
115
116         char *sel_string;
117
118         /* [UI] notification */
119         Setting_GenGroupItem_Data *data_n_msg;
120         Setting_GenGroupItem_Data *data_n_email;
121         Setting_GenGroupItem_Data *data_n_im;
122         Setting_GenGroupItem_Data *data_n_fb;
123         Setting_GenGroupItem_Data *data_n_twt;
124
125         /* [UI] license */
126         Evas_Object *chk_lang;
127         int prev_lang;          /** prev is used for special lang. */
128         Setting_GenGroupItem_Data *data_tracking;
129         Setting_GenGroupItem_Data *data_expiry;
130         Setting_GenGroupItem_Data *divx_vod;
131         Setting_GenGroupItem_Data *data_roaming_nw;
132
133         /* divx.... */
134         Setting_GenGroupItem_Data *data_reg;
135         Setting_GenGroupItem_Data *data_dereg;
136         Evas_Object *pop_dereg;
137         int mode;               /* 0: reg, 1: dereg */
138
139         Evas_Object *chk_tracking;
140         Evas_Object *chk_expiry;
141
142         /* Roaming network */
143         Setting_GenGroupItem_Data *auto_download;
144         Setting_GenGroupItem_Data *manual;
145         Setting_GenGroupItem_Data *always_reject;
146
147         /*bundle *bundle_data; */
148         app_control_h bundle_data;
149         setting_view *view_to_load;
150         TelSimImsiInfo_t imsi;
151         const char *sim_lang; /** is just used for '0' (automatic). */
152         Elm_Genlist_Item_Class itc_1text;
153         Elm_Genlist_Item_Class itc_1text_tb;
154         Elm_Genlist_Item_Class itc_1text_1icon_2;
155         Elm_Genlist_Item_Class itc_1text_1icon;
156         Elm_Genlist_Item_Class itc_2text_3_parent;
157         Elm_Genlist_Item_Class itc_1icon_1text_sub;
158         Elm_Genlist_Item_Class itc_1icon_2text;
159         Elm_Genlist_Item_Class itc_1icon_with_no_line;
160
161         /* [view] Language & Region */
162         Setting_GenGroupItem_Data *data_display_language;
163         Setting_GenGroupItem_Data *data_region_fmt;
164         Setting_GenGroupItem_Data *data_region_fmt_example;
165         Setting_GenGroupItem_Data *data_keyboard;
166         Setting_GenGroupItem_Data *data_voice_recog;
167         Setting_GenGroupItem_Data *data_text_speech;
168         Setting_GenGroupItem_Data *data_readout;
169         Setting_GenGroupItem_Data *data_title_keyboard;
170         Setting_GenGroupItem_Data *data_title_speech;
171
172         Evas_Object *chk_region;
173         int prev_region;
174         char *region_keyStr[REGION_ITEM_MAX];
175         char *region_desc[REGION_ITEM_MAX];
176         int region_index[REGION_ITEM_MAX];
177         int region_num;
178         int gl_region_index;
179         int gl_region_cur_index;
180         int selected_region_idx;
181         char *region_vconf_str;
182         Elm_Genlist_Item_Class itc_2text_2;
183         Elm_Genlist_Item_Class itc_bg_1icon;
184         UDateTimePatternGenerator *pattern_generator;
185         char *prev_locale;
186         Elm_Object_Item *selected_item;
187         Eina_List *app_list;
188         Evas_Object *pop_progress;
189         Evas_Object *search_bar;
190         char search_text[MAX_SEARCH_STR_LEN + 1];
191         Ecore_Idler *search_idler;
192         Ecore_Animator *animator;
193         Ecore_Timer *set_timer;
194         Ecore_Idler *set_idler;
195
196         Elm_Object_Item *lang_region_navi_it;
197
198         Ecore_Timer *lang_flush_timer;
199         Eina_Bool lang_change;
200
201         Ecore_Timer *searchlist_update_timer;
202         Ecore_Timer *popup_timer;
203
204         Ecore_Timer *event_freeze_timer;
205
206         Evas_Object *pop_progress_lang;
207
208         char *selected_locale;
209         char *region_search_id;
210 };
211
212 /* extern setting_view setting_view_phone_main; */
213 extern setting_view setting_view_phone_language_region;
214 #ifdef ENABLE_TICKER_NOTI
215 extern setting_view setting_view_phone_ticker_notification;
216 extern setting_view setting_view_phone_ticker_notification_details;
217 #endif
218 extern setting_view setting_view_phone_license_main;
219 extern setting_view setting_view_phone_display_language;
220 extern setting_view setting_view_phone_region_format;
221
222 /* void setting_phone_lang_changed_cb(void *data); */
223 int app_terminate_dead_cb(int pid, void *data);
224 extern char *setting_phone_lang_get_region_str(const char *region);
225 extern char *setting_phone_lang_get_by_pattern(const char *locale,
226                                                const char *skeleton,
227                                                void *data);
228 extern char *setting_phone_lang_get_example_desc(const char *region,
229                                                  void *data);
230 /**
231 * Change language string to UTF8 format, the invoker need to free the return string
232 *
233 * @param unichars The source string will be translated.
234 *
235 * @return UTF8 format string.
236 */
237 extern char *setting_phone_lang_str_to_utf8(const UChar *unichars);
238
239 #endif                          /* __SETTING_PHONE_H__ */