Initialize Tizen 2.3
[apps/home/settings.git] / setting-phone / include / setting-phone.h
1 /*
2  * setting
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Flora License, Version 1.1 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://floralicense.org/license/
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an AS IS BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 #ifndef __SETTING_PHONE_H__
18 #define __SETTING_PHONE_H__
19
20 #include <stdio.h>
21 #include <Elementary.h>
22
23 #include <glib-object.h>
24
25 #include <setting-common-draw-widget.h>
26 #include <setting-common-view.h>
27
28 #include <aul.h>
29
30 #ifdef Status
31 #undef Status
32 #endif
33 #include <tapi_common.h>
34 #include <ITapiSim.h>
35 #include <TapiUtility.h>
36
37 #include <unicode/ucal.h>
38 #include <unicode/uloc.h>
39 #include <unicode/udat.h>
40 #include <unicode/ustring.h>
41 #include <unicode/udatpg.h>
42 #include <unicode/utmscale.h>
43
44 /* Choose default programe*/
45 #define Display_APP_Full_Name 1
46 #define MAX_APP_NAME 1024
47 #define IMAGES_MIME_TYPE "image/png"    /* temporary implement */
48 #define SOUNDS_MIME_TYPE "audio/mpeg"   /* temporary implement */
49 #define VIDEOS_MIME_TYPE "video/3gpp"   /* temporary implement */
50 #define OTHERS_MIME_TYPE "application/pdf"      /* temporary implement */
51 #define TBL_NAME "menu"
52 #define MIME_FIELD_NAME "mimetype"
53 #define NAME_BUF_LEN (128)
54
55 #define REGION_ITEM_MAX 300
56
57 #define ASK_DEREG_PHONE "<linesize=44>Your phone is<br>already registered.<br> Are you sure you<br>wish to deregister?"
58 #define REGISTRATION_GET_FAILED "Failed to get registration code"
59 #define REGISTRATION_INDICATOT "<br><br><br><br>Your device<br>registration code:<br><br>"
60 #define REGISTRATION_AT "<br><br><br>Register at"
61 #define DEREGISTRATION_INDICATOT "<br><br><br><br>Your device<br>deregistration code:<br><br>"
62 #define EREGISTRATION_AT "<br><br><br>Deregister at"
63 #define TRANSFER_INFO "Your recommendation information is also sent with the file you transfer"
64
65 typedef struct _SettingPhoneUG SettingPhoneUG;
66
67 /**
68  * Setting Phone UG context
69  * all UG function has void* as an agument. this is casted back to SettingPhoneUG
70  * and the functions access app context.
71  */
72 struct _SettingPhoneUG {
73         ui_gadget_h ug;
74         TapiHandle* handle;
75
76         /* add more variables here (move your appdata to here) */
77         Evas *evas;
78         Evas_Object *win_main_layout;
79         Evas_Object *win_get;
80         ui_gadget_h ug_loading;
81
82         Evas_Object *gl_lang_region;
83         Evas_Object *gl_lang;
84         Evas_Object *gl_region;
85
86         Evas_Object *navi_bar;
87         Evas_Object *popup;
88         Evas_Object *popup_clear_license;
89         void (*popup_cb) (void *data, Evas_Object *obj, void *event_info);
90
91         int intial_shaking_value;
92
93         Evas_Object *ly_language;
94
95         // [UI] license
96         Evas_Object *chk_lang;
97         int prev_lang;          /** prev is used for special lang. */
98
99         //bundle *bundle_data;
100         service_h bundle_data;
101         setting_view *view_to_load;
102         TelSimImsiInfo_t imsi;
103         const char *sim_lang; /** is just used for '0' (automatic). */
104         Elm_Genlist_Item_Class itc_1text;
105         Elm_Genlist_Item_Class itc_1text_1icon_2;
106         Elm_Genlist_Item_Class itc_1text_1icon;
107         Elm_Genlist_Item_Class itc_seperator;
108         Elm_Genlist_Item_Class itc_2text_3_parent;
109         Elm_Genlist_Item_Class itc_1icon_1text_sub;
110         Elm_Genlist_Item_Class itc_1icon_2text;
111
112         // [view] Language & Region
113         Setting_GenGroupItem_Data *data_display_language;
114         Setting_GenGroupItem_Data *data_region_fmt;
115         Setting_GenGroupItem_Data *data_region_fmt_example;
116
117         Evas_Object *chk_region;
118         int prev_region;
119         char *region_keyStr[REGION_ITEM_MAX];
120         char *region_desc[REGION_ITEM_MAX];
121         int region_index[REGION_ITEM_MAX];
122         int region_num;
123         int gl_region_index;
124         int gl_region_cur_index;
125         int selected_region_idx;
126         char *region_vconf_str;
127         Elm_Genlist_Item_Class itc_2text_2;
128         Elm_Genlist_Item_Class itc_bg_1icon;
129         UDateTimePatternGenerator *pattern_generator;
130         char *prev_locale;
131         Elm_Object_Item *selected_item;
132         Eina_List *app_list;
133         Evas_Object *pop_progress;
134         Evas_Object *search_bar;
135         char search_text[MAX_SEARCH_STR_LEN + 1];
136         Ecore_Idler *search_idler;
137         Ecore_Animator *animator;
138 };
139
140 /* extern setting_view setting_view_phone_main; */
141 extern setting_view setting_view_phone_language_region;
142 extern setting_view setting_view_phone_display_language;
143 extern setting_view setting_view_phone_region_format;
144
145 /* void setting_phone_lang_changed_cb(void *data); */
146 int app_terminate_dead_cb(int pid, void *data);
147 extern char *setting_phone_lang_get_region_str(const char *region);
148 extern char *setting_phone_lang_get_by_pattern(const char *locale,
149                                                const char *skeleton,
150                                                void *data);
151 extern char *setting_phone_lang_get_example_desc(const char *region,
152                                                  void *data);
153 /**
154 * Change language string to UTF8 format, the invoker need to free the return string
155 *
156 * @param unichars The source string will be translated.
157 *
158 * @return UTF8 format string.
159 */
160 extern char *setting_phone_lang_str_to_utf8(const UChar *unichars);
161
162 #endif                          /* __SETTING_PHONE_H__ */