4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
6 * Contact: MyoungJune Park <mj2004.park@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #ifndef __SETTING_NETWORK_H__
22 #define __SETTING_NETWORK_H__
27 #include <Elementary.h>
28 #include <Ecore_IMF.h>
31 #include <glib-object.h>
33 //#include <NetPMIntf_ext.h>
34 //#include <NetCMIntf_ext.h>
35 #include <network-pm-config.h>
36 #include <network-cm-intf.h>
37 #include <network-pm-intf.h>
40 #include <setting-common-draw-widget.h>
41 #include <setting-common-view.h>
42 #include <setting-debug.h>
44 #include <TapiUtility.h>
45 #include <ITapiNetwork.h>
50 #include <Ecore_IMF.h>
52 #define SUPPORT_CON_RESET
53 #define NET_CON_RESET_DBUS_PARA "--system --print-reply --dest=com.tcore.ps / com.tcore.ps.master.ResetProfile"
57 #define MDM_POLICY_DATA_ROAMING_RESTRICTED_STR "Security policy restricts use of Data roaming"
60 #define Data_packet_Desc "Data packet through 3G network will be consumed, if you use data download or upload without Wi-Fi connection."
61 #define SETTING_NETWORK_DATA_ROMING_DESC "Connect to data services when roaming"
62 #define SETTING_NETWORK_DATA_ROMING_OFF_DESC "When data roaming is disabled, the application that uses the data connection may not work"
64 #define SETTING_NETWORK_USE_PACKET_DATA_OFF_DESC "Data packet through 3G network will be consumed, if you use data download or upload without Wi-Fi connection. Continue?"
65 #define SETTING_NETWORK_USE_PACKET_DATA_ON_DESC "Use data services when roaming. Roaming will charge extra data fee"
67 #define CONNECTION_DSC "Connections"
68 #define KeyStr_Reset_Def "Reset to default"
69 #define KeyStr_Edit "Edit"
70 #define KeyStr_Saved "IDS_ST_BODY_SAVED"
71 #define keyStr_Searched "Searched"
72 #define keyStr_Failed_Searched "Searching network failed"
73 #define keyStr_Failed_Select_Network "Select network failed"
74 #define keyStr_Failed_Get_PreferNetwork "Get preferred network failed"
76 #define Insert_Access_Name_desc "Please input access name !"
77 #define Insert_User_Name_Desc "Please input User name !"
78 #define Invok_API_Failed_Desc "Failed to invoke API"
80 #define SETTING_ADD_PROFILE_INDEX -1
81 #define Invoking_TAPI_Timeout 8
82 #define COUNTRY_CODE_LEN 3
83 #define NETWORK_CODE_LEN 3
84 #define PRE_NETWORK_NAME_MAX 256
86 #define SETTING_NETWORK_POP_RESPONSE_ACTION_CANCEL 10 /* the popupresponse action ID */
87 #define SETTING_NETWORK_SUBS_ID_NET_LEN 7
90 SETTING_NETWORK_PREFERRED_NETWORK_NONE,
91 SETTING_NETWORK_PREFERRED_NETWORK_NEW,
92 SETTING_NETWORK_PREFERRED_NETWORK_EDIT,
93 SETTING_NETWORK_PREFERRED_NETWORK_LIST,
94 SETTING_NETWORK_PREFERRED_NETWORK_DELETE,
96 } setting_network_preferred_network_operation_type_t;
98 typedef struct _SettingNetworkUG SettingNetworkUG;
100 struct gl_network_data {
102 char name[PRE_NETWORK_NAME_MAX];
106 * Setting Network UG context
107 * all UG function has void* as an agument. this is casted back to SettingNetworkUG
108 * and the functions access app context.
110 struct _SettingNetworkUG {
114 /* add more variables here (move your appdata to here) */
116 Evas_Object *win_main_layout;
117 Evas_Object *win_get;
119 Evas_Object *navi_bar;
122 Elm_Object_Item *navi_it;
123 Evas_Object *controlbar;
124 Evas_Object *conformant;
125 Evas_Object *back_btn;
126 Evas_Object *l_button;
127 Evas_Object *r_button;
128 Evas_Object *m_button;
130 bool has_form_changed;
131 Evas_Object *genlist_sel_network;
133 Evas_Object *network_ug_pop;
134 Evas_Object *controllbar;
136 char *view_type_string;
138 mdm_result_t mdm_server_state;
139 mdm_status_t roaming_policy_status;
140 policy_receiver_handle mdm_handle;
143 Evas_Object *ly_main;
144 unsigned int subs_id_net[SETTING_NETWORK_SUBS_ID_NET_LEN];
146 //net_event_callbacks net_evt_cbs;
148 Setting_GenGroupItem_Data* data_auto_network_item;
149 Setting_GenGroupItem_Data* data_search_network_item;
150 bool b_searching_network;
151 bool b_set_auto_network;
152 bool b_set_manul_network;
154 Setting_GenGroupItem_Data *data_sel_net;
155 Setting_GenGroupItem_Data *data_net_mode;
156 Setting_GenGroupItem_Data *data_use_packet;
157 Setting_GenGroupItem_Data *data_roaming;
159 Evas_Object *chk_sel;
160 Evas_Object *chk_mode;
161 Evas_Object *pop_gsm;
162 Evas_Object *chk_3gcon;
164 int sel_net; /* like vconf key */
165 int sel_act; /* like vconf key */
167 int net_mode; /* like vconf key */
169 TelNetworkPlmnList_t plmn_info;
172 net_service_type_t con_type;
173 net_profile_info_t *prof_list;
177 Evas_Object *chk_type;
179 const char *ed_acs_name_desc;
180 const char *ed_auth_type_desc;
181 const char *ed_user_name_desc;
182 const char *ed_pwd_desc;
183 const char *ed_pxy_addr_desc;
184 const char *ed_pxy_port_desc;
185 const char *ed_hm_url_desc;
187 Elm_Object_Item *item_above_user_name;
188 Elm_Object_Item *item_above_proxy_add;
189 Setting_GenGroupItem_Data *data_user_name;
190 Setting_GenGroupItem_Data *data_pwd;
191 Setting_GenGroupItem_Data *data_acs_name;
192 Setting_GenGroupItem_Data *data_pxy_addr;
193 Setting_GenGroupItem_Data *data_pxy_port;
194 Setting_GenGroupItem_Data *data_hm_url;
195 Setting_GenGroupItem_Data *data_auth_type;
196 Setting_GenGroupItem_Data *data_type_nor;
197 Setting_GenGroupItem_Data *data_type_sec;
198 Setting_GenGroupItem_Data *data_type_none;
200 Evas_Object *scl_edit;
202 /* Preferred network common */
203 TelNetworkPreferredPlmnList_t pref_list;
205 setting_network_preferred_network_operation_type_t op_type;
207 Ecore_Idler *add_view_timer;
208 char search_text[MAX_SEARCH_STR_LEN + 1];
209 Evas_Object *nw_search_bar;
211 Evas_Object *scl_pref;
212 Evas_Object *chk_new_type;
213 Setting_GenGroupItem_Data *data_edit_mcc;
214 Setting_GenGroupItem_Data *data_edit_mnc;
215 Setting_GenGroupItem_Data *data_new_mcc;
216 Setting_GenGroupItem_Data *data_new_mnc;
217 Evas_Object *chk_edit_type;
218 Evas_Object *scl_pref_del;
219 Evas_Object *gl_sel_all;
221 Evas_Object *popup_label;
223 Eina_List *checked_data_list;
224 Eina_List *item_check_list;
226 /* Preferred network network list for genlist */
227 Evas_Object *gl_network;
228 Elm_Genlist_Item_Class itc;
229 struct gl_network_data *cur_sel_mem;
232 Setting_GenGroupItem_Data *data_cl_select_all;
233 Evas_Object *sub_clear_layout;
234 Evas_Object *selInfoPop;
235 Evas_Object *selInfoPop_layout;
239 extern setting_view setting_view_network_main;
240 extern setting_view setting_view_network_select_network;
241 extern setting_view setting_view_network_main_help;
242 extern setting_view setting_view_network_con;
243 extern setting_view setting_view_network_connection_create;
244 extern setting_view setting_view_network_3gcon;
246 extern setting_view setting_view_network_preferred_network;
247 extern setting_view setting_view_network_preferred_network_new;
248 extern setting_view setting_view_network_preferred_network_list;
249 extern setting_view setting_view_network_preferred_network_edit;
250 extern setting_view setting_view_network_preferred_network_delete;
252 const char *setting_network_get_act_str(TelNetworkSystemType_t type);
253 void setting_network_update_sel_network(void *data);
255 void setting_tapi_get_preferred_plmn_cb(TapiHandle *handle, int result, void *data, void *user_data);
256 void setting_tapi_set_preferred_plmn_cb(TapiHandle *handle, int result, void *data, void *user_data);
258 void setting_tapi_cancel_manual_search_cb(TapiHandle *handle, int result, void *data, void *user_data);
259 void setting_tapi_search_network_cb(TapiHandle *handle, int result, void *data, void *user_data);
261 void setting_tapi_get_serving_network_cb(TapiHandle *handle, int result, void *data, void *user_data);
262 void setting_tapi_get_plmn_mode_cb(TapiHandle *handle, int result, void *data, void *user_data);
263 void setting_tapi_set_plmn_mode_cb(TapiHandle *handle, int result, void *data, void *user_data);
265 void setting_tapi_get_band_cb(TapiHandle *handle, int result, void *data, void *user_data);
266 void setting_tapi_set_band_cb(TapiHandle *handle, int result, void *data, void *user_data);
268 void setting_network_select_network_chk_changed(void *data, Evas_Object *obj, void *event_info);
269 void setting_network_Gendial_select_plmn_cb(void *data, Evas_Object *obj, void *event_info);
270 void setting_network_popup_delete(void *data);
272 #endif /* __SETTING_NETWORK_H__ */