apply FSL(Flora Software License)
[apps/core/preloaded/settings.git] / setting-phone / include / setting-phone.h
1 /*
2   * Copyright 2012  Samsung Electronics Co., Ltd
3   *
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
7   *
8   *     http://www.tizenopensource.org/license
9   *
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.
15   */
16
17
18 #ifndef __SETTING_PHONE_H__
19 #define __SETTING_PHONE_H__
20
21 #include <stdio.h>
22 #include <appcore-efl.h>
23 #include <Elementary.h>
24 #include <heynoti.h>
25
26 #include <glib-object.h>
27 #include <ui-gadget.h>
28 #include <ui-gadget-module.h>
29 #include <bundle.h>
30
31 #include <setting-common-draw-widget.h>
32 #include <setting-common-view.h>
33
34 #include <aul.h>
35
36 #ifdef Status
37 #undef Status
38 #endif
39 #include <TapiEvent.h>
40 #include <ITapiNetwork.h>
41 #include <ITapiSim.h>
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 typedef struct _SettingPhoneUG SettingPhoneUG;
63
64 /**
65  * Setting Phone UG context
66  * all UG function has void* as an agument. this is casted back to SettingPhoneUG 
67  * and the functions access app context.
68  */
69 struct _SettingPhoneUG {
70         struct ui_gadget *ug;
71
72         /* add more variables here (move your appdata to here) */
73         Evas *evas;
74         Evas_Object *win_main_layout;
75         Evas_Object *win_get;
76
77         Evas_Object *gl_lang_region;
78         Evas_Object *gl_lang;
79         Evas_Object *gl_region;
80
81         Evas_Object *navi_bar;
82         Evas_Object *popup;
83         Evas_Object *popup_clear_license;
84         void (*popup_cb) (void *data, Evas_Object *obj, void *event_info);
85
86         int intial_shaking_value;
87
88         Evas_Object *ly_language;
89         Evas_Object *ly_ticker;
90         Evas_Object *ly_license;
91
92         Setting_GenGroupItem_Data *data_n_dsp;
93         Setting_GenGroupItem_Data *data_n_msg;
94         Setting_GenGroupItem_Data *data_n_vmail;
95         Setting_GenGroupItem_Data *data_n_email;
96
97         Setting_GenGroupItem_Data *data_n_sns;
98         Setting_GenGroupItem_Data *data_n_file;
99
100         Evas_Object *chk_lang;
101         int prev_lang;          /** prev is used for special lang. */
102         Setting_GenGroupItem_Data *data_tracking;
103         Setting_GenGroupItem_Data *data_expiry;
104         Setting_GenGroupItem_Data *data_roaming_nw;
105
106         /* divx.... */
107         Setting_GenGroupItem_Data *data_reg;
108         Setting_GenGroupItem_Data *data_dereg;
109         Evas_Object *pop_dereg;
110         int mode;               /* 0: reg, 1: dereg */
111
112         Evas_Object *chk_tracking;
113         Evas_Object *chk_expiry;
114
115         bundle *bundle_data;
116         setting_view *view_to_load;
117         TelSimImsiInfo_t imsi;
118         const char *sim_lang; /** is just used for '0' (automatic). */
119         Elm_Genlist_Item_Class itc_1text;
120         Elm_Genlist_Item_Class itc_1text_1icon_2;
121         Elm_Genlist_Item_Class itc_1text_1icon;
122         Elm_Genlist_Item_Class itc_seperator;
123         Elm_Genlist_Item_Class itc_2text_3_parent;
124         Elm_Genlist_Item_Class itc_1icon_1text_sub;
125
126         Setting_GenGroupItem_Data *data_display_language;
127         Setting_GenGroupItem_Data *data_region_fmt;
128         Setting_GenGroupItem_Data *data_region_fmt_example;
129         Evas_Object *chk_region;
130         int prev_region;
131         char *region_keyStr[REGION_ITEM_MAX];
132         char *region_desc[REGION_ITEM_MAX];
133         int region_index[REGION_ITEM_MAX];
134         int region_num;
135         int gl_region_index;
136         int gl_region_cur_index;
137         int selected_region_idx;
138         char *region_vconf_str;
139         Elm_Genlist_Item_Class itc_2text_2;
140         Elm_Genlist_Item_Class itc_bg_1icon;
141         UDateTimePatternGenerator *pattern_generator;
142         char *prev_locale;
143         Elm_Object_Item *selected_item;
144         Eina_List *app_list;
145         Evas_Object *pop_progress;
146         Eina_List *killed_pid_list;
147         Evas_Object *search_bar;
148         char search_text[MAX_SEARCH_STR_LEN + 1];
149         Ecore_Idler *search_idler;
150         Ecore_Animator *animator;
151 };
152
153 /* extern setting_view setting_view_phone_main; */
154 extern setting_view setting_view_phone_language_region;
155 extern setting_view setting_view_phone_ticker_notification;
156 extern setting_view setting_view_phone_license_main;
157 extern setting_view setting_view_phone_license_divx_main;
158 extern setting_view setting_view_phone_license_divx_mode;
159 extern setting_view setting_view_phone_display_language;
160 extern setting_view setting_view_phone_region_format;
161
162 /* void setting_phone_lang_changed_cb(void *data); */
163 int app_terminate_func(const aul_app_info *info, void *data);
164 int app_terminate_dead_cb(int pid, void *data);
165 extern char *setting_phone_lang_get_region_str(const char *region);
166 extern char *setting_phone_lang_get_by_pattern(const char *locale,
167                                                const char *skeleton,
168                                                void *data);
169 extern char *setting_phone_lang_get_example_desc(const char *region,
170                                                  void *data);
171 /**
172 * Change language string to UTF8 format, the invoker need to free the return string
173 *
174 * @param unichars The source string will be translated.
175 *
176 * @return UTF8 format string.
177 */
178 extern char *setting_phone_lang_str_to_utf8(const UChar *unichars);
179
180 #endif                          /* __SETTING_PHONE_H__ */