50783831c1365e490a530bfb1213ca0a955ab5d1
[apps/home/settings.git] / setting-personalpage / include / setting-personalpage.h
1 /*
2  * setting
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
5  *
6  * Contact: MyoungJune Park <mj2004.park@samsung.com>
7  *
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
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
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.
19  *
20  */
21 #ifndef __SETTING_PERSONALPAGE_H__
22 #define __SETTING_PERSONALPAGE_H__
23
24 #include <glib.h>
25 #include <stdio.h>
26 #include <Elementary.h>
27
28 #include <glib-object.h>
29
30 #include <setting-common-draw-widget.h>
31 #include <setting-common-view.h>
32 #include <setting-debug.h>
33 #include <dlog.h>
34
35 #define SUPPORT_MASTER_CONTROL 1
36
37 /**
38  * Setting Personalpage UG context
39  * all UG function has void* as an agument. this is casted back to SettingPersonalpageUG
40  * and the functions access app context.
41  */
42 typedef enum {
43     SETTING_PERSONAL_PW_CALLER_PERSONAL = 0,
44     SETTING_PERSONAL_PW_CALLER_UNLOCK_METHOD,
45     SETTING_PERSONAL_PW_CALLER_UNLOCK_PIN,
46     SETTING_PERSONAL_PW_CALLER_UNLOCK_PASSWORD,
47     SETTING_PERSONAL_PW_CALLER_ON_OFF,
48     SETTING_PERSONAL_PW_CALLER_MAX,
49 } pw_view_caller_t;
50
51
52 typedef enum {
53     PERSONAL_VIEW_MAIN = 0,
54     PERSONAL_VIEW_UNLOCK_METHOD,
55     PERSONAL_VIEW_PW_UG,
56 } pw_view_type_t;
57
58 typedef struct _SettingPersonalpageUG {
59         ui_gadget_h ug;
60         ui_gadget_h ug_passwd;
61         ui_gadget_h ug_lockscreen;
62
63         /* add more variables here (move your appdata to here) */
64         Evas *evas;
65         Evas_Object *win_main_layout;
66         Evas_Object *win_get;
67
68         setting_view *view_to_load;
69         ui_gadget_h ug_loaded;
70
71         Evas_Object *ly_main;
72         Evas_Object *navi_bar;
73         Evas_Object *genlist;
74         Evas_Object *rd_option;
75         Evas_Object *init_popup; /* if unlock method is not assigned, show init popup */
76         Evas_Object *off_popup; /* if turn off in exteral like notification panel and setting main, show off popup */
77         Evas_Object *off_popup_check; /* off popup has one checkbox */
78         Evas_Object *unmount_popup;
79
80 #if SUPPORT_MASTER_CONTROL
81         Evas_Object     *master_control;
82 #endif
83         /* page 1 */
84         Setting_GenGroupItem_Data *data_personal_mode;
85         Setting_GenGroupItem_Data *data_unlock_method;
86         Setting_GenGroupItem_Data *data_set_screenlock_btn;
87
88         /* page 2 */
89         Setting_GenGroupItem_Data *data_unlock_pin;
90         Setting_GenGroupItem_Data *data_unlock_password;
91
92         pw_view_caller_t pw_ug_caller;
93         int do_nothing_flag;
94         int unmount_flag;
95         int result_cb_called;
96         int viewtype;
97         char *change_unlock_method_data;
98 } SettingPersonalpageUG;
99
100 extern setting_view setting_view_personalpage_main;
101 extern setting_view setting_view_personalpage_unlock;
102
103 gboolean setting_personalpage_create_password_sg(void *data, int caller);
104 void setting_personalpage_unmount(void *data);
105 char *get_unlock_method_str(void *priv);
106
107 void create_notification(void *data);
108
109 #endif