Add Internal Password popup to ode-app for temporary
[platform/core/security/ode.git] / tools / apps / ode / include / ode-app.h
1 /*
2  * Tizen ODE application
3  *
4  * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #ifndef __ODE_H__
21 #define __ODE_H__
22
23 #include <stdio.h>
24
25 #include <app.h>
26 #include <app_control.h>
27 #include <dlog.h>
28 #include <Elementary.h>
29 #include <system_settings.h>
30 #include <limits.h>
31 #include <device/battery.h>
32 #include <device/callback.h>
33 #include <runtime_info.h>
34 #include <vconf.h>
35 #include <gio/gio.h>
36 #include <app_control.h>
37 #include <aul.h>
38 #include <bundle.h>
39
40 #include "ode-app-widget.h"
41
42 #ifdef  LOG_TAG
43 #undef  LOG_TAG
44 #endif
45 #define LOG_TAG "ode"
46
47 #if !defined(PACKAGE)
48 #define PACKAGE "org.tizen.ode"
49 #endif
50
51 typedef struct dpm_encryption_info {
52         int battery_status;
53         int charger_status;
54         int locktype_status;
55
56         int sdcard_status;
57         int sdcard_pw_status;
58
59         int device_option;
60
61         char* sdcard_pw;
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         SD_CARD_PASSWORD,
71 } dpm_encryption_viewtype;
72
73 typedef enum {
74         ICON_CHECK,
75         ICON_BAR,
76 } dpm_encryption_icontype;
77
78 typedef struct appdata {
79         Evas_Object* win;
80         Evas_Object* conform;
81         Evas_Object* nf;
82         Evas_Object* base;
83         Evas_Object* navi_bar;
84         Evas_Object* dpm_encryption_layout;
85         Evas_Object* sdcard_pw_layout;
86         dpm_encryption_info_s device_info;
87
88         char* edj_path;
89         char* icon_check_path;
90         char* icon_bar_path;
91         char *entry_data;
92         int view_type;
93 } appdata_s;
94
95 #define __(str) dgettext("ode", str)
96 #define MSG_TEXT_STYLE "DEFAULT='font=Tizen:style=Regular font_size=30 color=#000000 wrap=mixed align=left'"
97 #define MAIN_MSG_TEXT_STYLE "DEFAULT='font=Tizen:style=Regular font_size=40 color=#000000 wrap=mixed align=left'"
98 #define SUB_MSG_TEXT_STYLE "DEFAULT='font=Tizen:style=Regular font_size=30 color=#000000 wrap=mixed align=left'"
99 #define NEEDED_BATTERY_PERCENT 80
100
101 /* for Progress Bar */
102 #define SUB_TITLE_STYLE_W "DEFAULT='font=Tizen:style=Regular font_size=40 color=#ffffff wrap=mixed align=center'"
103 #define SUB_CONTENT_STYLE_W "DEFAULT='font=Tizen:style=Regular font_size=32 color=#ffffff wrap=mixed align=center'"
104
105 void ode_encrypt_device_create_view(appdata_s* ad);
106 void ode_check_encrypt_device_create_view(appdata_s* ad);
107 void ode_encrypt_sd_card_create_view(appdata_s* ad);
108 void ode_decrypt_sd_card_create_view(appdata_s* ad);
109
110 void ode_confirm_encrypt_device_create_view(appdata_s* ad);
111 void ode_check_encrypt_sd_card_create_view(appdata_s* ad);
112 void ode_confirm_encrypt_sd_card_create_view(appdata_s* ad);
113 void ode_confirm_decrypt_sd_card_create_view(appdata_s* ad);
114
115 void locktype_status_changed_cb(keynode_t* node, void* data);
116 void sdcard_status_changed_cb(keynode_t* node, void* data);
117 void battery_changed_cb(device_callback_e type, void* value, void* user_data);
118
119 void create_base_window();
120 void create_progress_view(const char *type, const char *target);
121
122 #endif                                                  /* __ODE_H__ */