tizen 2.4 release
[apps/home/settings.git] / setting-about / include / setting-about.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  * @file setting-about.h
23  *
24  * @brief      Setting > About
25  * @details    'About' view object by UI gadget
26  */
27
28
29
30 /**
31  * @defgroup setting-about Setting About
32  * @{
33  */
34
35 #ifndef __SETTING_ABOUT_H__
36 #define __SETTING_ABOUT_H__
37
38 #include <stdio.h>
39 #include <Elementary.h>
40 #include <ITapiSim.h>
41
42 #include <glib-object.h>
43
44 /* #include <mobileap_lib.h> */
45 #include<telephony.h>
46
47 #include <setting-common-draw-widget.h>
48 #include <setting-common-view.h>
49
50 #include <TapiUtility.h>
51 #include <tapi_common.h>
52 #include <ITapiSim.h>
53 /*#include <tethering.h> */
54 #include <notification.h>
55
56 #define MAX_DISPLAY_STR_LEN_ON_PHONE_INFO       256
57
58 #define SETTING_ABOUT_PROGRESSBAR_TIMEOUT 10
59 /*#define SETTING_ABOUT_MOBILE_AP_TURNED_OFF "Mobile hotspot will be turned off." */
60 #define SETTING_ABOUT_MOBILE_AP_TURNED_OFF "IDS_ST_POP_DISABLE_TETHERING_Q"
61
62 #define SETTING_ABOUT_MY_NUMBERS_LEN 3
63 #define SETTING_ABOUT_WIFI_MAC_STR_LEN 17
64 #define SETTING_ABOUT_DEFAULT_DEVICE_NAME       "Redwood"
65 #define SETTING_ABOUT_PUK_LOCKED "PUK is locked"
66 #define SETTING_SIM_MSISDN_DIALING_NUMBER_LEN TAPI_SIM_MSISDN_DIALING_NUMBER_LEN+1
67
68 typedef enum _SETTING_SIM_STATUS {
69     SETTING_SIM_STATUS_UNKNOWN = 0,
70     SETTING_SIM_STATUS_IN_CHECKING = 1,
71     SETTING_SIM_STATUS_LOCKED = 2,
72     SETTING_SIM_STATUS_PERM_BLOCKED = 3
73 } SETTING_SIM_STATUS;
74
75 typedef struct _SettingAboutUG SettingAboutUG;
76
77 /**
78  * Setting About UG context
79  * all UG function has void* as an agument. this is casted back to SettingAboutUG
80  * and the functions access app context.
81  */
82 struct _SettingAboutUG {
83         ui_gadget_h ug;
84         TapiHandle *handle;
85         bool tapi_responsed;
86         bool pause_flag;
87
88         setting_view *view_to_load;
89
90         Elm_Genlist_Item_Class itc_1text;
91         Elm_Genlist_Item_Class itc_2text_2;
92         Elm_Genlist_Item_Class itc_group_item;
93         Elm_Genlist_Item_Class itc_2text_3_parent;
94         Elm_Genlist_Item_Class itc_1icon_1text_sub;
95         Elm_Genlist_Item_Class itc_help_style;
96
97         /* add more variables here (move your appdata to here) */
98         Evas *evas;
99         Evas_Object *win_main_layout;
100         Evas_Object *win_get;
101
102         ui_gadget_h ug_loading;
103
104         Evas_Object *navi_bar;
105         Evas_Object *ly_main;
106         Evas_Object *genlsit;
107         Elm_Object_Item *navi_item;
108         Evas_Object *back_key;
109         Evas_Object *btn_done;
110         Evas_Object *btn_cancel;
111
112         Ecore_Timer *update_timer;
113         Ecore_Idler *update_idler;
114         Setting_GenGroupItem_Data *item_dev_name;
115         Setting_GenGroupItem_Data *item_dev_name_main;
116         bool is_dev_name_focus;
117         int cursor_pos;
118         Setting_GenGroupItem_Data *item_data_imei;
119         Setting_GenGroupItem_Data *item_model;
120         Setting_GenGroupItem_Data *item_version;
121         Setting_GenGroupItem_Data *item_data_cpu;
122         Setting_GenGroupItem_Data *item_data_battery;
123         Setting_GenGroupItem_Data *item_data_bt;
124         Setting_GenGroupItem_Data *item_data_wifi;
125         Setting_GenGroupItem_Data *item_data_sn;
126         Setting_GenGroupItem_Data *item_data_my_phone_number;
127         Setting_GenGroupItem_Data *item_data_status;
128         Evas_Object *popup;
129         Evas_Object *popup_space;
130         char *old_name;
131         bool empty_flag;
132         /*char *my_numbers[SETTING_ABOUT_MY_NUMBERS_LEN]; */
133         TelSimMsisdnList_t my_numbers;
134         bool popup_showed_flag; /** if popup has been showed, do not show again*/
135         bool drag_flag;
136         int noti_id;
137         SETTING_SIM_STATUS sim_status;
138         Eina_Bool need_update;
139
140         /*idler for popup */
141         Ecore_Idler *idler_remove_popup;
142         Ecore_Idler *idler_add_popup;
143         Ecore_Idler *idler_remove_space_popup;
144
145         Ecore_Event_Handler *event_handler;
146         Ecore_Idler *name_update_idler;
147 };
148
149 extern setting_view setting_view_about_main;
150 extern void setting_about_main_get_wifi_mac_address_string(char *str, int size);
151 extern void setting_about_main_get_bluetooth_address_string(char *str, int size);
152
153
154 /**
155 * @brief ug layout callback
156 *
157 * @param ug
158 * @param mode
159 * @param priv
160 */
161 void setting_about_layout_ug_cb(ui_gadget_h ug, enum ug_mode mode,
162                                 void *priv);
163
164 /**
165  * @}
166  */
167 #endif                          /* __SETTING_ABOUT_H__ */