Apply GUI resource and layout to progressbar
[platform/core/security/ode.git] / tools / apps / ode / include / ode-app.h
1 /*
2  * Tizen ODE application
3  *
4  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
5  *
6  * Contact: SeolHeui Kim <s414.kim@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
22 #ifndef __ODE_H__
23 #define __ODE_H__
24
25 #include <stdio.h>
26
27 #include <app.h>
28 #include <app_control.h>
29 #include <dlog.h>
30 #include <efl_extension.h>
31 #include <Elementary.h>
32 #include <system_settings.h>
33 #include <limits.h>
34 #include <device/battery.h>
35 #include <device/callback.h>
36 #include <runtime_info.h>
37 #include <vconf.h>
38 #include <gio/gio.h>
39 #include <app_control.h>
40 #include <aul.h>
41 #include <bundle.h>
42
43 #include "ode-app-widget.h"
44
45 #ifdef  LOG_TAG
46 #undef  LOG_TAG
47 #endif
48 #define LOG_TAG "ode"
49
50 #if !defined(PACKAGE)
51 #define PACKAGE "org.tizen.ode"
52 #endif
53
54 typedef struct dpm_encryption_info {
55         int battery_status;
56         int charger_status;
57         int locktype_status;
58
59         int sdcard_status;
60         int sdcard_pw_status;
61
62         Evas_Object *next_button;
63 } dpm_encryption_info_s;
64
65 typedef enum {
66         ENCRYPT_DEVICE,
67         DECRYPT_DEVICE,
68         ENCRYPT_SD_CARD,
69         DECRYPT_SD_CARD,
70 } dpm_encryption_viewtype;
71
72 typedef enum {
73         ICON_CHECK,
74         ICON_BAR,
75 } dpm_encryption_icontype;
76
77 typedef struct appdata {
78         Evas_Object* win;
79         Evas_Object* conform;
80         Evas_Object* nf;
81         Evas_Object* base;
82         Evas_Object* navi_bar;
83         Evas_Object* dpm_encryption_layout;
84         dpm_encryption_info_s device_info;
85
86         char* edj_path;
87         char* icon_check_path;
88         char* icon_bar_path;
89         int view_type;
90 } appdata_s;
91
92 #define MSG_TEXT_STYLE "DEFAULT='font=Tizen:style=Regular font_size=30 color=#000000 wrap=mixed align=left'"
93 #define NEEDED_BATTERY_PERCENT 80
94
95 /* for Encrypt device */
96 #define IDS_ST_HEADER_ENCRYPTION "Encryption"
97 #define IDS_ST_MBODY_ENCRYPT_DEVICE "Encrypt device"
98 #define IDS_ST_MBODY_DECRYPT_DEVICE "Decrypt device"
99 #define IDS_ST_SBODY_DEVICE_NOT_ENCRYPTED_M_STATUS "Device not encrypted."
100 #define IDS_ST_SBODY_DEVICE_ENCRYPTED_M_STATUS "Device encrypted."
101
102 #define IDS_ST_MBODY_ENCRYPT_SD_CARD_ABB "Encrypt SD card"
103 #define IDS_ST_MBODY_DECRYPT_SD_CARD "Decrypt SD card"
104 #define IDS_ST_SBODY_SD_CARD_NOT_INSERTED_M_STATUS "SD card not inserted"
105 #define IDS_ST_SBODY_SD_CARD_NOT_ENCRYPTED_M_STATUS_SBODY "SD card not encrypted"
106 #define IDS_ST_SBODY_SD_CARD_ENCRYPTED_M_STATUS "SD card encrypted"
107 #define IDS_ST_SBODY_ENCRYPTING_ING_M_STATUS "Encrypting..."
108 #define IDS_ST_SBODY_DECRYPTING_ING_M_STATUS "Decrypting..."
109 #define IDS_ST_SBODY_FAILED_TO_ENCRYPT_SD_CARD_TAP_HERE_TO_TRY_AGAIN "Failed to encrypt SD card. Tap here to try again."
110 #define IDS_ST_SBODY_FAILED_TO_DECRYPT_SD_CARD_TAP_HERE_TO_TRY_AGAIN "Failed to decrypt SD card. Tap here to try again."
111 #define IDS_ST_SBODY_TAP_HERE_TO_ENTER_PW_FOR_SD_CARD_ABB "Tap here to enter PW for SD card."
112
113 #define IDS_ST_HEADER_ENCRYPT_DEVICE "Encrypt device"
114 #define IDS_ST_BODY_ENCRYPTING_MSG_1 "Encrypting your device will secure the apps, data, and other content on your device. To decrypt your device once it has been encrypted, you will need to unlock the screen whenever the device is powered on."
115 #define IDS_ST_BODY_ENCRYPTING_MSG_2 "The encryption process may take a long time<br>depending on the amount of data that is encrypted. Interrupting this process may cause data loss, so make sure you have time for it to finish before you start."
116 #define IDS_ST_BODY_TO_ENCRYPTION_YOUR_DEVICE_C_ABB "To encrypt your device:"
117 #define IDS_ST_BODY_CHARGE_THE_BATTERY_TO_AT_LEAST_PDP "Charge the battery to at least 80%."
118 #define IDS_ST_BODY_CONNECT_THE_DEVICE_TO_A_CHARGER "Connect the device to a charger."
119 #define IDS_ST_BODY_SET_THE_SCREEN_LOCK_TYPE_AS_PATTERN_PIN_OR_PASSWORD "Set the screen lock type as pattern, PIN, or password."
120 #define IDS_ST_BUTTON_SCREEN_LOCK_TYPE_ABB "Screen lock type"
121 #define IDS_ST_BUTTON_NEXT "Next"
122
123 /* for Decrypt device */
124 #define IDS_ST_HEADER_DECRYPT_DEVICE "Decrypt device"
125 #define IDS_ST_BODY_DECRYPTING_MSG_1 "Decrypting your device will decrypt the apps, data, and other content on your device."
126 #define IDS_ST_BODY_DECRYPTING_MSG_2 "This may take a long time depending on the amount of data. Interrupting this process may cause data loss, so make sure you have time for it to finish before you start."
127 #define IDS_ST_HEADER_TO_DECRYPT_YOUR_DEVICE_C_ABB "To decrypt your device:"
128
129 /* for Encrypt SD card */
130 #define IDS_ST_HEADER_ENCRYPT_SD_CARD "Encrypt SD card"
131 #define IDS_ST_BODY_SD_CARD_ENCRYPTING_MSG_1 "Encrypting your SD card will protect its data if it's lost or stolen. SD cards encrypted on this device can't be used on any other device."
132 #define IDS_ST_BODY_SD_CARD_ENCRYPTING_MSG_2 "Once the SD card is encrypted, a password is required to use it. The same password must be used for all encrypted SD cards. If you enter an incorrect password 15 times in a row, you will no longer be able to use any of the SD cards encrypted by this device."
133 #define IDS_ST_BODY_SD_CARD_ENCRYPTING_MSG_3 "The encryption process may take a long time depending on the amount of data that is encrypted. Interrupting this process may cause data loss, so make sure you have time for it to finish before you start."
134 #define IDS_ST_BODY_TO_ENCRYPT_YOUR_SD_CARD_C "To encrypt your SD card :"
135 #define IDS_ST_BODY_INSERT_THE_SD_CARD_ABB "Insert the SD card to encrypt."
136 #define IDS_ST_BODY_CREATE_AN_SD_CARD_PASSWORD "Create an SD card password."
137 #define IDS_ST_BUTTON_CREATE_PASSWORD "Create password"
138 #define IDS_ST_BUTTON_CHANGE_PW_ABB "Change PW"
139 #define IDS_ST_BUTTON_DELETE_PW_ABB "Delete PW"
140
141 /* for Decrypt SD card */
142 #define IDS_ST_HEADER_DECRYPT_SD_CARD "Decrypt SD card"
143 #define IDS_ST_BODY_SD_CARD_DECRYPTION_MSG "The decryption process may take a long time depending on the amount of data that is decrypted. Interrupting this process may cause data loss, so make sure you have time for it to finish before you start."
144 #define IDS_ST_BUTTON_CHANGE_PASSWORD_ABB2 "Change password"
145
146 /* for Encrypt Device Confirm */
147 #define IDS_ST_HEADER_CONFIRM_ENCRYPTION "Confirm encryption"
148 #define IDS_ST_BODY_CONFIRM_ENCRYPT_DEVICE_MSG_1 "Tap Encrypt device to start the encryption process."
149 #define IDS_ST_BODY_CONFIRM_ENCRYPT_DEVICE_MSG_2 "The encryption can't be cancelled and data will be lost if the process is interrupted. During the encryption process, your device can't be used. After the encryption, your device will restart."
150 #define IDS_ST_HEADER_ENCRYPTION_OPTIONS_ABB "Encryption options"
151 #define IDS_ST_MBODY_FAST_ENCRYPTION "Fast Encryption"
152 #define IDS_ST_SBODY_ENCRYPT_USED_DEVICE_STORAGE_ONLY "Encrypt used device storage only."
153 #define IDS_ST_BUTTON_ENCRYPT_DEVICE "Encrypt device"
154
155 /* for Decrypt Device Confirm */
156 #define IDS_ST_HEADER_CONFIRM_DECRYPTION "Confirm decryption"
157 #define IDS_ST_BODY_CONFIRM_DECRYPT_DEVICE_MSG_1 "Tap Decrypt device to start the decryption process."
158 #define IDS_ST_BODY_CONFIRM_DECRYPT_DEVICE_MSG_2 "The decryption can't be cancelled and data will be lost if the process is interrupted. During the decryption process, your device can't be used. After the decryption, your device will restart."
159 #define IDS_ST_BUTTON_DECRYPT_DEVICE "Decrypt device"
160
161 /* for Encrypt SD card Confirm */
162 #define IDS_ST_BODY_CONFIRM_ENCRYPT_SD_CARD_MSG_1 "Tap Encrypt SD card to start the encryption process. All open files on SD card will be closed."
163 #define IDS_ST_BODY_CONFIRM_ENCRYPT_SD_CARD_MSG_2 "The encryption can't be cancelled and data will be lost if the process is interrupted. During the encryption process, your SD card can't be used. After the encryption, your SD card will be mounted again."
164 #define IDS_ST_MBODY_ENCRYPT_NEW_FILES "Encrypt all files"
165 #define IDS_ST_BODY_ENCRYPT_NEW_FILES_MSG "Encrypt all files saved on the SD card. New files will also be encrypted."
166 #define IDS_ST_MBODY_ENCRYPT_ALL_FILES "Encrypt new files"
167 #define IDS_ST_BODY_ENCRYPT_ALL_FILES_MSG "Encrypt all new files created using this device. Existing files will not be encrypted."
168 #define IDS_ST_BUTTON_ENCRYPT_SD_CARD_ABB "Encrypt SD card"
169
170 /* for Decrypt SD Card Confirm */
171 #define IDS_ST_BODY_CONFIRM_DECRYPT_SD_CARD_MSG_1 "Tap Decrypt SD card to start the decryption process. All open files on SD card will be closed."
172 #define IDS_ST_BODY_CONFIRM_DECRYPT_SD_CARD_MSG_2 "The decryption can't be cancelled and data will be lost if the process is interrupted. During the decryption process, your SD card can't be used. After the decryption, your SD card will be mounted again."
173 #define IDS_ST_BUTTON_DECRYPT_SD_CARD_ABB3 "Decrypt SD card"
174
175 void dpm_encryption_create_view(appdata_s* ad);
176 void dpm_decryption_create_view(appdata_s* ad);
177 void dpm_encryption_sd_card_create_view(appdata_s* ad);
178 void dpm_decryption_sd_card_create_view(appdata_s* ad);
179
180 void dpm_encryption_device_confirm_create_view(appdata_s* ad);
181 void dpm_decryption_device_confirm_create_view(appdata_s* ad);
182 void dpm_encryption_sd_card_confirm_create_view(appdata_s* ad);
183 void dpm_decryption_sd_card_confirm_create_view(appdata_s* ad);
184
185 void locktype_status_changed_cb(keynode_t* node, void* data);
186 void sdcard_status_changed_cb(keynode_t* node, void* data);
187 void battery_changed_cb(device_callback_e type, void* value, void* user_data);
188
189 #endif                                                  /* __ODE_H__ */