3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Flora License, Version 1.1 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://floralicense.org/license/
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an AS IS BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 #ifndef __SETTING_SECURITY_H__
18 #define __SETTING_SECURITY_H__
22 #include <Elementary.h>
23 #include <Ecore_IMF.h>
28 #include <TapiUtility.h>
29 #include <ITapiModem.h>
31 #include <glib-object.h>
33 #include <setting-common-draw-widget.h>
34 #include <setting-common-view.h>
35 #include <setting-debug.h>
37 #define USELESS_SIM_CARD "Not useful SIM card"
38 #define Keystr_ScreenLockType "IDS_ST_BODY_SCREEN_LOCK_TYPE"
39 #define Keystr_Swipe "IDS_ST_MBODY_SWIPE"
41 #if SUPPORT_PARENTAL_MODE
42 #define Keystr_ParentalMode "Parental mode"
45 typedef struct _SettingSecurityUG SettingSecurityUG;
48 SETTING_SEC_PW_SIM_LOCK_ON,
49 SETTING_SEC_PW_SIM_LOCK_OFF,
50 SETTING_SEC_PW_SIM_LOCK_DISABLED,
51 SETTING_SEC_PW_PIN_LOCK_ON,
52 SETTING_SEC_PW_PIN_LOCK_OFF,
53 SETTING_SEC_PW_CHANGE_PIN1,
54 SETTING_SEC_PW_CHANGE_PIN2,
55 SETTING_SEC_PW_PIN1_BLOCKED,
56 SETTING_SEC_PW_PIN2_BLOCKED,
57 SETTING_SEC_PW_PIN1_UNBLOCKED,
58 SETTING_SEC_PW_PIN2_UNBLOCKED,
60 } setting_sec_pw_type;
62 struct _security_item {
65 int (*passwd_handler)(SettingSecurityUG *ad, void* data);
69 * Setting Security UG context
70 * all UG function has void* as an agument. this is casted back to SettingSecurityUG
71 * and the functions access app context.
73 struct _SettingSecurityUG {
76 TelSimFacilityStatus_t sim_status;
77 TelSimFacilityStatus_t pin1_status;
78 TelSimFacilityStatus_t pin2_status;//it indicates fdn status too
80 /* add more variables here (move your appdata to here) */
82 Evas_Object *win_main_layout;
87 Evas_Object *navi_bar;
88 Evas_Object *sim_popup;
89 ui_gadget_h ug_passwd;
91 Setting_GenGroupItem_Data *data_sim_lk;
92 Setting_GenGroupItem_Data *data_pin_lk;
93 Setting_GenGroupItem_Data *data_change_pin1;
94 Setting_GenGroupItem_Data *data_change_pin2;
95 Setting_GenGroupItem_Data *data_screen_lock_type;
97 Setting_GenGroupItem_Data *data_locktype_swipe;
99 Setting_GenGroupItem_Data *data_locktype_3rd[128];
100 Evas_Object *sl_scroller;
101 Evas_Object *lock_type_rd;
103 Elm_Object_Item *screen_lock_main_item;
104 char *selected_lock_type;
105 /* for simple password */
107 Elm_Genlist_Item_Class itc_1text;
108 Elm_Genlist_Item_Class itc_1text_1icon;
109 Elm_Genlist_Item_Class itc_seperator;
110 Elm_Genlist_Item_Class itc_2text_2;
112 setting_sec_pw_type pw_type;
116 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 */
117 Ecore_Timer *update_view_timer;
120 extern setting_view setting_view_security_main;
121 extern setting_view setting_view_security_sim_settings;
122 extern setting_view setting_view_security_locktype;
124 SettingSecurityUG *g_ad; /* for tapi callback */
126 void setting_security_result_password_ug_cb(ui_gadget_h ug,
127 service_h service, void *priv);
128 void setting_security_sim_get_facility_cb(TapiHandle *handle, int result, void *data, void *user_data);
129 void setting_security_pin_get_facility_cb(TapiHandle *handle, int result, void *data, void *user_data);
131 gboolean setting_security_create_password_sg(void *data);