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_LOCKTYPE_H__
22 #define __SETTING_LOCKTYPE_H__
27 #include <Elementary.h>
28 #include <Ecore_IMF.h>
29 #include <glib-object.h>
31 #include <setting-common-draw-widget.h>
32 #include <setting-common-view.h>
33 #include <setting-debug.h>
36 #include <app_manager.h>
38 //#include <ckmc/ckmc-control.h>
39 //#include <ckmc/ckmc-type.h>
42 /////////////////////face and voice unlock
43 #define SET_AS_LOCK_STR "IDS_COM_SK_SET"//"Set as lock"
44 #define CONTINUE_STR "Continue"
45 #define SET_UP_STR "Set it up"
46 #define ADAPT_VOICE_STR "Adapt Voice"
48 #define About_Motion_Unlock_Str "IDS_ST_HEADER_MOTION_UNLOCK"
49 #define About_Face_Unlock_Str "About Face Unlock"
50 #define Setup_Face_Unlock_Str "Set up Face Unlock"
51 #define Voice_Record_BtnStr "Voice record icon"
52 #define Put_Face_Str "<align=middle>Put your face here</align>"
53 #define Show_Face_Str "Show your face"
55 #define Motion_Unlock_Guildtext "Unlock device using motion<br><br>"\
56 "Tap and hold the screen then tilt the device "\
57 "towards you to unlock it. If the screen does not unlock, "\
58 "try tiling the device more. When learn about tilt or motion "\
59 "lock are set,motion activation will be automatically enabled "\
62 #define Motion_Unlock_Guildtext1 "IDS_ST_HEADER_UNLOCK_DEVICE_USING_MOTION_ABB"
63 #define Motion_Unlock_Guildtext2 "IDS_ST_BODY_TAP_AND_HOLD_THE_SCREEN_THEN_TILT_THE_DEVICE_TOWARDS_YOU_TO_UNLOCK_IT_IF_THE_SCREEN_DOES_NOT_UNLOCK_TRY_TILTING_THE_DEVICE_MORE"
64 #define Motion_Unlock_Guildtext3 "IDS_ST_BODY_WHEN_LEARN_ABOUT_TILT_OR_MOTION_UNLOCK_ARE_SET_MOTION_ACTIVATION_WILL_BE_AUTOMATICALLY_ENABLED_IN_SETTINGS"
66 #define Face_Unlock_Warring "Warning<br><br>"\
67 "Do not use face unlock while driving, it may distract you from "\
68 "the road and cause an accident"
70 #define Face_Unlock_Warring2 "Look at your phone to Unlock it<br><br>"\
71 "Keep these things in mind<br>"\
72 ".Face Unlock is less secure than PIN or password.<br><br>"\
73 ".Someone who looks similar to you could unlock your phone.<br><br>"\
74 ".The data used to identify your face is kept private on the phone."
76 #define Face_Unlock_Warring3 "For best results:<br><br>"\
77 ".Find an indoor spot that is not too bright or too dim.<br><br>"\
78 ".Hold the phone at eye level."
80 #define Voice_Unlock_Guildtext "Tap button below then say voice command you want to use for Unlock 4 times all at once"
81 #define Voice_Unlock_Guildtext2 "Use 3-5 syllable words and maintain constant intonation.<br><br>"\
82 "All background music and recording will stop when you unlock the device using Face and voice<br>"
83 #define Voice_Recognized_text "Recognised. Now you can use your own voice command for Unlock.<br><br>"\
84 "For assuring higher security. You can adapt voice command by tapping 'Adapt voice' button."
86 #define Adapt_voice_Str "Adapt Voice"
88 #define Finish_Setup_Face "You've finished!<br><br>"\
89 "To unlock your phone, just look at it.<br><br>"\
90 "Tip : improve face matching by having your face capture in different "\
93 #define Speak_Now_Str "Speak now"
95 #define Keystr_ScreenLockType "IDS_ST_BODY_SCREEN_LOCK_TYPE"
96 #define Keystr_LockScreenOptions "IDS_ST_BODY_LOCK_SCREEN_OPTIONS"
97 #define Keystr_Swipe "IDS_ST_MBODY_SWIPE"
98 #define Keystr_FaceAndVoice "IDS_ST_BODY_FACE_AND_VOICE"
99 #define Keystr_FingerPrint "Fingerprint"
102 typedef struct _SettingLocktypeUG SettingLocktypeUG;
104 struct _locktype_item {
106 char *pw_type_string;
107 int (*passwd_handler)(SettingLocktypeUG *ad, void* data);
110 #define MAX_VOICE_TIME 4
111 #define MAX_SEC_PROFILE_NUM 100
114 SETTING_LOCKTYPE_PW_PASSWORD,
115 SETTING_LOCKTYPE_PW_SIMPLE_PASSWD,
116 SETTING_LOCKTYPE_PW_CHANGE_PASSWD,
117 SETTING_LOCKTYPE_PW_CHANGE_SIMPLE_PASSWD,
118 SETTING_LOCKTYPE_PW_MAX
122 SETTING_LOCKTYPE_VIEWTYPE_MAIN,
123 SETTING_LOCKTYPE_VIEWTYPE_ENCRYPTION,
124 SETTING_LOCKTYPE_VIEWTYPE_RECOVERY, /* In case that recovery password using tizen account, lockscreen can call locktype */
128 * Setting Security UG context
129 * all UG function has void* as an agument. this is casted back to SettingSecurityUG
130 * and the functions access app context.
132 struct _SettingLocktypeUG {
135 /* add more variables here (move your appdata to here) */
137 Evas_Object *win_main_layout;
138 Evas_Object *win_get;
140 Evas_Object *video_ly;
141 Evas_Object *video_ly_show_face_btn;
142 Evas_Object *video_ly_content_face;
143 Ecore_Timer *update_timer;
144 Evas_Object *image[MAX_VOICE_TIME];
145 int processed_img_num;
146 Evas_Object *record_genlist;
147 Elm_Object_Item *screen_lock_main_item;
148 char *selected_lock_type;
149 recorder_h recorder_handle;
151 Evas_Object *ly_guild;
152 Evas_Object *ly_main;
153 Evas_Object *navi_bar;
154 ui_gadget_h ug_passwd;
155 ui_gadget_h ug_loading;
156 Evas_Object *genlist;
157 Evas_Object *save_popup;
159 Elm_Genlist_Item_Class itc_1text;
160 Elm_Genlist_Item_Class itc_bg_1icon;
161 Elm_Genlist_Item_Class itc_1text_1icon;
162 Elm_Genlist_Item_Class itc_seperator;
163 Elm_Genlist_Item_Class itc_2text_2;
164 Elm_Genlist_Item_Class itc_1icon;
165 Elm_Genlist_Item_Class itc_group_item;
166 Elm_Genlist_Item_Class itc_2text_3_parent;
170 Evas_Object *lock_type_rd;
171 Setting_GenGroupItem_Data *data_sl_simple_pw;
172 Setting_GenGroupItem_Data *data_sl_pw;
175 Setting_GenGroupItem_Data *data_locktype_none;
176 Setting_GenGroupItem_Data *data_locktype_swipe;
177 Setting_GenGroupItem_Data *data_locktype_fingerprint;
178 Setting_GenGroupItem_Data *data_locktype_motion;
179 Setting_GenGroupItem_Data *data_locktype_face;
180 Setting_GenGroupItem_Data *data_locktype_simple;
181 Setting_GenGroupItem_Data *data_locktype_password;
182 Setting_GenGroupItem_Data *data_locktype_3rd[128];
184 Ecore_Timer *update_locktype_timer;
186 bool ug_is_destroying;
192 extern setting_view setting_view_locktype_main;
195 void setting_locktype_result_password_ug_cb(ui_gadget_h ug,
196 app_control_h service, void *priv);
197 gboolean setting_locktype_create_password_sg(void *data);
198 void setting_locktype_destroy_password_ug_cb(ui_gadget_h ug,
200 void setting_locktype_layout_passwd_ug_cb(ui_gadget_h ug,
201 enum ug_mode mode, void *priv);