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_SECURITY_H__
22 #define __SETTING_SECURITY_H__
26 #include <Elementary.h>
27 #include <Ecore_IMF.h>
32 #include <TapiUtility.h>
33 #include <ITapiModem.h>
35 #include <glib-object.h>
37 #include <setting-common-draw-widget.h>
38 #include <setting-common-view.h>
39 #include <setting-debug.h>
44 #define Keystr_FDN "IDS_ST_BODY_FIXED_DIALLING_MODE"
46 #if SUPPORT_ENCRYPTION
47 #define keystr_DeviceDecryption "Device decryption"
48 #define DEVICE_ENCRYPTION_DESC "IDS_ST_BODY_PASSWORD_REQUIRED_TO_DECRYPT_DEVICE_EACH_TIME_YOU_TURN_IT_ON"
49 #define DEVICE_DECRYPTION_DESC "IDS_ST_BODY_DEVICE_ENCRYPTED"
51 #define Keystr_ConfirmEncryption "Confirm encryption"
52 #define Keystr_ConfirmDecryption "Confirm decryption"
55 #define USELESS_SIM_CARD "Not useful SIM card"
57 #if SUPPORT_SCREEN_SECURITY
58 #define Keystr_ScreenLockType "IDS_ST_BODY_SCREEN_LOCK_TYPE"
59 #define Keystr_LockScreenOptions "IDS_ST_BODY_LOCK_SCREEN_OPTIONS"
60 #define Keystr_Swipe "IDS_ST_MBODY_SWIPE"
61 #define Keystr_FaceAndVoice "IDS_ST_BODY_FACE_AND_VOICE"
64 #if SUPPORT_PARENTAL_MODE
65 #define Keystr_ParentalMode "Parental mode"
68 typedef struct _SettingSecurityUG SettingSecurityUG;
71 SETTING_SEC_PW_PASSWORD,
72 SETTING_SEC_PW_SIMPLE_PASSWD,
73 SETTING_SEC_PW_CHANGE_PASSWD,
74 SETTING_SEC_PW_CHANGE_SIMPLE_PASSWD,
75 SETTING_SEC_PW_ENTER_LOCK_TYPE,
76 SETTING_SEC_PW_SIM_LOCK_ON,
77 SETTING_SEC_PW_SIM_LOCK_OFF,
78 SETTING_SEC_PW_SIM_LOCK_DISABLED,
79 SETTING_SEC_PW_PIN_LOCK_ON,
80 SETTING_SEC_PW_PIN_LOCK_OFF,
81 SETTING_SEC_PW_CHANGE_PIN1,
83 SETTING_SEC_PW_FDN_MODE_ON,
84 SETTING_SEC_PW_FDN_MODE_OFF,
86 SETTING_SEC_PW_CHANGE_PIN2,
87 SETTING_SEC_PW_PIN1_BLOCKED,
88 SETTING_SEC_PW_PIN2_BLOCKED,
90 } setting_sec_pw_type;
92 struct _security_item {
95 int (*passwd_handler)(SettingSecurityUG *ad, void* data);
99 * Setting Security UG context
100 * all UG function has void* as an agument. this is casted back to SettingSecurityUG
101 * and the functions access app context.
103 struct _SettingSecurityUG {
106 TelSimFacilityStatus_t sim_status;
107 TelSimFacilityStatus_t pin1_status;
108 TelSimFacilityStatus_t pin2_status;//it indicates fdn status too
110 /* add more variables here (move your appdata to here) */
112 Evas_Object *win_main_layout;
113 Evas_Object *win_get;
116 Evas_Object *ly_main;
117 Evas_Object *navi_bar;
118 ui_gadget_h ug_passwd;
121 Setting_GenGroupItem_Data *data_phone_lk;
122 Setting_GenGroupItem_Data *data_mb;
123 Setting_GenGroupItem_Data *data_sim_lk;
124 Setting_GenGroupItem_Data *data_pin_lk;
125 Setting_GenGroupItem_Data *data_parental_md;
126 Setting_GenGroupItem_Data *data_simple_pw;
127 Setting_GenGroupItem_Data *data_change_pin1;
128 /* for simple password */
130 Setting_GenGroupItem_Data *data_cng_pw;
131 #if SUPPORT_ENCRYPTION
132 Setting_GenGroupItem_Data *data_device_enc;
133 Setting_GenGroupItem_Data *data_mmc_enc;
135 Elm_Genlist_Item_Class itc_1text;
136 Elm_Genlist_Item_Class itc_1text_1icon;
137 Elm_Genlist_Item_Class itc_seperator;
138 Elm_Genlist_Item_Class itc_2text_2;
142 Setting_GenGroupItem_Data *data_fdn;
143 Evas_Object *chk_fdn;
146 setting_sec_pw_type pw_type;
149 mdm_data_t *mdm_data;
150 mdm_password_policy_t *mdm_policy;
151 mdm_result_t mdm_status;
152 policy_receiver_handle mdm_handle;
158 #if SUPPORT_SCREEN_SECURITY
159 Setting_GenGroupItem_Data *data_screen_lock_type;
160 Evas_Object *lock_type_rd;
161 Setting_GenGroupItem_Data *data_sl_simple_pw;
162 Setting_GenGroupItem_Data *data_sl_pw;
163 ui_gadget_h ug_lockscreen;
168 int sel_item; /**< It's used to check PIN1, PIN2 _BLOCKED. 0:click pin lock, 1:change pin1 code, 2:fdn, 3: change pin2 code */
169 Ecore_Timer *update_view_timer;
172 extern setting_view setting_view_security_main;
173 extern setting_view setting_view_security_encryption;
174 extern setting_view setting_view_security_screen_lock_type;
175 extern setting_view setting_view_security_sim_settings;
177 SettingSecurityUG *g_ad; /* for tapi callback */
179 char *get_screen_lock_type_str(void * priv);
180 char *get_find_my_mobile_on_off_str(void *priv);
181 void setting_security_result_password_ug_cb(ui_gadget_h ug,
182 service_h service, void *priv);
183 void setting_security_sim_get_facility_cb(TapiHandle *handle, int result, void *data, void *user_data);
185 gboolean setting_security_create_password_sg(void *data);
186 void setting_security_create_find_my_mobile_sg(void *cb, int argc, char **argv);
187 void setting_security_destroy_find_my_mobile_ug_cb(ui_gadget_h ug,
191 void setting_security_destroy_password_ug_cb(ui_gadget_h ug,
193 void setting_security_layout_passwd_ug_cb(ui_gadget_h ug,
194 enum ug_mode mode, void *priv);
198 void setting_security_disable_items_for_mdm(void *data);
201 gboolean setting_security_create_lockscreen_options_sg(void *data);