summaryrefslogtreecommitdiff
path: root/include/pwlock.h
blob: 1f8b5ebff1595f73720d6fb4a23e00487e208395 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/*
 *  pwlock
 *
 * Copyright 2012  Samsung Electronics Co., Ltd
 *
 * Licensed under the Flora License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.tizenopensource.org/license
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

#ifndef __PWLOCK_H__
#define __PWLOCK_H__

#include <Elementary.h>
#include <glib.h>
#include <aul.h>
#include <openssl/sha.h>
#include <sysman.h>

#include "tapi.h"
#include "ui-gadget.h"

#if !defined(PACKAGE)
#define PACKAGE "org.tizen.pwlock"
#endif

#if !defined(LOCALEDIR)
#define LOCALEDIR "/opt/apps/org.tizen.pwlock/res/locale"
#endif

#if !defined(EDJDIR)
#define EDJDIR "/opt/apps/"PACKAGE"/res/edje"
#endif

#if !defined(IMAGEDIR)
#define IMAGEDIR "/opt/apps/"PACKAGE"/res/images"
#endif

#define EDJFILE EDJDIR"/"PACKAGE".edj"

typedef enum _UG_BUTTON_STATE {
	UG_BUTTON_STATE_NONE = 0,
	UG_BUTTON_STATE_NEXT_CLICKED = 1,
	UG_BUTTON_STATE_PREV_CLICKED = 2
} UG_BUTTON_STATE;

struct appdata {
	Evas_Object *win;

	Evas_Object *layout_main;
	Evas_Object *layout_contents;
	Evas_Object *layout_entry;
	Evas_Object *layout_second_entry;

	Evas_Object *elm_bg;
	Evas_Object *elm_navigation_frame;
	Evas_Object *elm_button_dial;
	Evas_Object *elm_button_done;
	Evas_Object *elm_conform;

	int ui_type;
	int previous_ui_type;

	int state;
	TelSimLockType_t sub_state;		/* for lock sub state */
	Ecore_Idler *idler;

	int is_first_boot;		/* for checking first boot */
	int is_exec_after_bootup;	/* for calling pwlock from other module */
	int is_no_sim;

	int alpha_window_status;	/* for alpha */
	int date_and_time_settings_loaded;
	int language_settings_loaded;	/* check the language ug first loaded or not  */
	int lock_view_loaded;	/* check the lock view loaded for sim card changed */
	int lock_app_launched;

	char *entry_str;
	char *pin_str;		/* only for new pin */
	char *msg;
	Ecore_Timer *pTimerId;	/* for vconf timer id */
	int sim_changed;
	int pin_changed;
	enum sim_stat sim_status;
	struct tapi *t;
	ui_gadget_h dialer_ug;
	ui_gadget_h language_ug;
	ui_gadget_h connection_ug;
	ui_gadget_h date_ug;
	ui_gadget_h count_ug;
	ui_gadget_h current_ug;
	int kill_ug;		/* If 1 killed by "previous", else killed by "next" button */
	int date_and_time_previous;
	int cancel_setup;	/*  1 means not show setup wizard,0 means show */
	Evas_Object *popup;
	Evas_Object *waiting_popup;
	int win_type;		/* it is set if pwlock is set to ECORE_X_WINDOW_TYPE_NOTIFICATION */
	int tapi_smc_sid;	/* it is tapi resgistered sid for smc lab test */
	int tapi_init_retry_cnt;  /* number of retry to tapi init */

	UG_BUTTON_STATE ug_btn_evt_state;
};

enum {
	STR_E_PW,		/* 0 */
	STR_E_PIN,
	STR_E_NEW,
	STR_R_PIN,
	STR_E_PUK,
	STR_I_PUN,		/* 5 */
	STR_I_PUK,
	STR_A_LEFT,
	STR_DONE,
	STR_DIAL,
	STR_W_PW,		/* 10 */
	STR_N_MAT,
	STR_LANG,
	STR_SET,
	STR_CANCEL,
	STR_ERR_SIMLANG,	/* 15 */
	STR_ERR_UNSUPP,
	STR_BLOCK,
	STR_SIM_LOCK,
	STR_NETWORK_LOCK_NCK,
	STR_NETWORK_LOCK_NSCK,	/* 20 */
	STR_NETWORK_LOCK_SPCK,
	STR_NETWORK_LOCK_CCK,
	STR_PW_LENGTH,		/* 23 */
};

enum {
	_ST_FIRST,
	_ST_TAPI_INIT,
	_ST_SIM,
	_ST_SIM_PINCNF,
	_ST_SIM_PUKCNF,
	_ST_SIM_LOCKCNF,
	_ST_NETWORK_LOCKCNF,
	_ST_EXIT,
	_ST_LANG,
	_ST_NOSIM,
	_ST_TIME,
	_ST_GREETING,
	_ST_CONNECTION,
	_ST_TUTORIAL,
	_ST_FINISH,
	_ST_MAX,
};

extern const char *strtbl[];
void set_win_prop(struct appdata *ad, int type);
void do_state(struct appdata *ad);
void do_state_directly(int state, void *data);

#endif				/* __PWLOCK_H__ */