RSA code sync
[apps/core/preloaded/settings.git] / setting-network / include / setting-network.h
index 6af9ac8..702de61 100755 (executable)
 #include <string.h>
 
 #include <glib-object.h>
-
-//#include <NetPMIntf_ext.h>
-//#include <NetCMIntf_ext.h>
-#include <network-pm-config.h>
-#include <network-cm-intf.h>
-#include <network-pm-intf.h>
+#include <net_connection.h>
 
 
 #include <setting-common-draw-widget.h>
 
 #include <Ecore_IMF.h>
 
+#define Keystr_NetBrand_Auto "GSM/WCDMA(auto connect)"
+#define Keystr_NetBrand_Auto_WCDMA_GSM "WCDMA/GSM (auto connect)"
+#define Keystr_NetBrand_WCDMA "WCDMA only"
+#define Keystr_NetBrand_LTE_WCDMA "LTE/WCDMA"
+#define Keystr_NetBrand_GSM "GSM only"
+
 #define SUPPORT_CON_RESET
 #define NET_CON_RESET_DBUS_PARA  "--system --print-reply --dest=com.tcore.ps / com.tcore.ps.master.ResetProfile"
 
-#ifdef SUPPORT_MDM
-#include <mdm.h>
-#define MDM_POLICY_DATA_ROAMING_RESTRICTED_STR         "Security policy restricts use of Data roaming"
-#endif
 
 #define Data_packet_Desc "Data packet through 3G network will be consumed, if you use data download or upload without Wi-Fi connection."
-#define SETTING_NETWORK_DATA_ROMING_DESC "Connect to data services when roaming"
+#define SETTING_NETWORK_DATA_ROMING_DESC "IDS_COM_BODY_CONNECT_TO_DATA_SERVICES_WHEN_ROAMING"
 #define SETTING_NETWORK_DATA_ROMING_OFF_DESC "When data roaming is disabled, the application that uses the data connection may not work"
 
 #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?"
 #define SETTING_NETWORK_USE_PACKET_DATA_ON_DESC "Use data services when roaming. Roaming will charge extra data fee"
 
-#define CONNECTION_DSC "Connections"
-#define KeyStr_Reset_Def "Reset to default"
-#define KeyStr_Edit "Edit"
+#define CONNECTION_DSC "IDS_ST_BODY_CONNECTIONS"
+#define KeyStr_Reset_Def "IDS_ST_BODY_RESET_TO_DEFAULT"
+#define KeyStr_Edit "IDS_ST_BODY_EDIT"
 #define KeyStr_Saved "IDS_ST_BODY_SAVED"
 #define keyStr_Searched "Searched"
 #define keyStr_Failed_Searched "Searching network failed"
 #define Insert_User_Name_Desc "Please input User name !"
 #define Invok_API_Failed_Desc "Failed to invoke API"
 
+//in the feture
+#define NotifyStr_PDP_OFF "PDP will be disabled to find network nearby"
+#define Keystr_UNKNOWN_NETWORK "Untitled network"
+
 #define SETTING_ADD_PROFILE_INDEX -1
 #define Invoking_TAPI_Timeout  8
 #define COUNTRY_CODE_LEN       3
@@ -85,7 +86,6 @@
 
 #define SETTING_NETWORK_POP_RESPONSE_ACTION_CANCEL  10 /*  the popupresponse action ID */
 #define SETTING_NETWORK_SUBS_ID_NET_LEN 7
-
 typedef enum {
        SETTING_NETWORK_PREFERRED_NETWORK_NONE,
        SETTING_NETWORK_PREFERRED_NETWORK_NEW,
@@ -95,6 +95,13 @@ typedef enum {
 
 } setting_network_preferred_network_operation_type_t;
 
+typedef enum {
+       NET_RESTORE_NONE = 0, //do need restore
+       NET_RESTORE_PDP, //restore the vconf of pdp()
+       NET_RESTORE_PDP_ROAM,//restore the vconf of roaming()
+} net_restore_t;//restore type
+
+
 typedef struct _SettingNetworkUG SettingNetworkUG;
 
 struct gl_network_data {
@@ -102,6 +109,7 @@ struct gl_network_data {
        char name[PRE_NETWORK_NAME_MAX];
 };
 
+#define MAX_PROFILE_NUM 100
 /**
  * Setting Network UG context
  * all UG function has void* as an agument. this is casted back to SettingNetworkUG
@@ -110,6 +118,9 @@ struct gl_network_data {
 struct _SettingNetworkUG {
        ui_gadget_h ug;
        TapiHandle *handle;
+       connection_h connection;
+       connection_profile_h sel_profile_h;
+       net_restore_t net_restore;
 
        /* add more variables here (move your appdata to here) */
        Evas *evas;
@@ -120,12 +131,12 @@ struct _SettingNetworkUG {
 
        //connection,
        Elm_Object_Item *navi_it;
-       Evas_Object *controlbar;
-       Evas_Object *conformant;
+       Evas_Object *bottom_btn;
+       //Evas_Object *conformant;
        Evas_Object *back_btn;
        Evas_Object *l_button;
        Evas_Object *r_button;
-       Evas_Object *m_button;
+       //Evas_Object *m_button;
 
        bool has_form_changed;
        Evas_Object *genlist_sel_network;
@@ -134,17 +145,10 @@ struct _SettingNetworkUG {
        Evas_Object *controllbar;
 
        char *view_type_string;
-#ifdef SUPPORT_MDM
-       mdm_result_t mdm_server_state;
-       mdm_status_t roaming_policy_status;
-       policy_receiver_handle mdm_handle;
-#endif
 
        Evas_Object *ly_main;
        unsigned int subs_id_net[SETTING_NETWORK_SUBS_ID_NET_LEN];
 
-       //net_event_callbacks net_evt_cbs;
-
        Setting_GenGroupItem_Data* data_auto_network_item;
        Setting_GenGroupItem_Data* data_search_network_item;
        bool b_searching_network;
@@ -169,21 +173,17 @@ struct _SettingNetworkUG {
        TelNetworkPlmnList_t plmn_info;
 
        int is_show_user;
-       //net_service_type_t con_type;
        char *con_name;
-       net_profile_info_t *prof_list;
-       int prof_count;
-       int prof_sel_idx;
 
        Evas_Object *chk_type;
 
-       const char *ed_acs_name_desc;
-       const char *ed_auth_type_desc;
-       const char *ed_user_name_desc;
-       const char *ed_pwd_desc;
-       const char *ed_pxy_addr_desc;
-       const char *ed_pxy_port_desc;
-       const char *ed_hm_url_desc;
+       char *ed_acs_name_desc;
+       char *ed_auth_type_desc;
+       char *ed_user_name_desc;
+       char *ed_pwd_desc;
+       char *ed_pxy_addr_desc;
+       char *ed_pxy_port_desc;
+       char *ed_hm_url_desc;
        int chkType;
        Elm_Object_Item *item_above_user_name;
        Elm_Object_Item *item_above_proxy_add;