[Feature] Add number example in Setting > Langauage and region .
[apps/core/preloaded/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 #include <heynoti.h>
27
28 #include <glib-object.h>
29
30 #include <setting-common-draw-widget.h>
31 #include <setting-common-view.h>
32
33 #include <aul.h>
34
35 #ifdef Status
36 #undef Status
37 #endif
38 #include <tapi_common.h>
39 #include <ITapiSim.h>
40 #include <TapiUtility.h>
41
42 #include <unicode/ucal.h>
43 #include <unicode/uloc.h>
44 #include <unicode/udat.h>
45 #include <unicode/ustring.h>
46 #include <unicode/udatpg.h>
47 #include <unicode/utmscale.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_EXAMPLE_NUMBER "Number"
63
64 #define ASK_DEREG_PHONE "<linesize=44>Your phone is<br>already registered.<br> Are you sure you<br>wish to deregister?"
65 #define REGISTRATION_GET_FAILED "Failed to get registration code"
66 #define REGISTRATION_INDICATOT "<br><br><br><br>Your device<br>registration code:<br><br>"
67 #define REGISTRATION_AT "<br><br><br>Register at"
68 #define DEREGISTRATION_INDICATOT "<br><br><br><br>Your device<br>deregistration code:<br><br>"
69 #define EREGISTRATION_AT "<br><br><br>Deregister at"
70 #define TRANSFER_INFO "Your recommendation information is also sent with the file you transfer"
71
72 typedef struct _SettingPhoneUG SettingPhoneUG;
73
74 /**
75  * Setting Phone UG context
76  * all UG function has void* as an agument. this is casted back to SettingPhoneUG
77  * and the functions access app context.
78  */
79 struct _SettingPhoneUG {
80         ui_gadget_h ug;
81         TapiHandle* handle;
82
83         /* add more variables here (move your appdata to here) */
84         Evas *evas;
85         Evas_Object *win_main_layout;
86         Evas_Object *win_get;
87         ui_gadget_h ug_loading;
88
89         Evas_Object *gl_lang_region;
90         Evas_Object *gl_lang;
91         Evas_Object *gl_region;
92
93         Evas_Object *navi_bar;
94         Evas_Object *popup;
95         Evas_Object *popup_clear_license;
96         void (*popup_cb) (void *data, Evas_Object *obj, void *event_info);
97
98         int intial_shaking_value;
99
100         Evas_Object *ly_language;
101
102         // [UI] license
103         Evas_Object *chk_lang;
104         int prev_lang;          /** prev is used for special lang. */
105
106         //bundle *bundle_data;
107         service_h bundle_data;
108         setting_view *view_to_load;
109         TelSimImsiInfo_t imsi;
110         const char *sim_lang; /** is just used for '0' (automatic). */
111         Elm_Genlist_Item_Class itc_1text;
112         Elm_Genlist_Item_Class itc_1text_1icon_2;
113         Elm_Genlist_Item_Class itc_1text_1icon;
114         Elm_Genlist_Item_Class itc_seperator;
115         Elm_Genlist_Item_Class itc_2text_3_parent;
116         Elm_Genlist_Item_Class itc_1icon_1text_sub;
117         Elm_Genlist_Item_Class itc_1icon_2text;
118
119         // [view] Language & Region
120         Setting_GenGroupItem_Data *data_display_language;
121         Setting_GenGroupItem_Data *data_region_fmt;
122         Setting_GenGroupItem_Data *data_region_fmt_example;
123
124         Evas_Object *chk_region;
125         int prev_region;
126         char *region_keyStr[REGION_ITEM_MAX];
127         char *region_desc[REGION_ITEM_MAX];
128         int region_index[REGION_ITEM_MAX];
129         int region_num;
130         int gl_region_index;
131         int gl_region_cur_index;
132         int selected_region_idx;
133         char *region_vconf_str;
134         Elm_Genlist_Item_Class itc_2text_2;
135         Elm_Genlist_Item_Class itc_bg_1icon;
136         UDateTimePatternGenerator *pattern_generator;
137         char *prev_locale;
138         Elm_Object_Item *selected_item;
139         Eina_List *app_list;
140         Evas_Object *pop_progress;
141         Evas_Object *search_bar;
142         char search_text[MAX_SEARCH_STR_LEN + 1];
143         Ecore_Idler *search_idler;
144         Ecore_Animator *animator;
145 };
146
147 /* extern setting_view setting_view_phone_main; */
148 extern setting_view setting_view_phone_language_region;
149 extern setting_view setting_view_phone_display_language;
150 extern setting_view setting_view_phone_region_format;
151
152 /* void setting_phone_lang_changed_cb(void *data); */
153 int app_terminate_dead_cb(int pid, void *data);
154 extern char *setting_phone_lang_get_region_str(const char *region);
155 extern char *setting_phone_lang_get_by_pattern(const char *locale,
156                                                const char *skeleton,
157                                                void *data);
158 extern char *setting_phone_lang_get_example_desc(const char *region,
159                                                  void *data);
160 /**
161 * Change language string to UTF8 format, the invoker need to free the return string
162 *
163 * @param unichars The source string will be translated.
164 *
165 * @return UTF8 format string.
166 */
167 extern char *setting_phone_lang_str_to_utf8(const UChar *unichars);
168
169 #endif                          /* __SETTING_PHONE_H__ */