01e0d7875605d8d603dfb3c030179c5ae7bbd6f4
[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         char* sdcard_pw;
60         Evas_Object *next_button;
61 } dpm_encryption_info_s;
62
63 typedef enum {
64         ENCRYPT_DEVICE,
65         DECRYPT_DEVICE,
66         ENCRYPT_SD_CARD,
67         DECRYPT_SD_CARD,
68         SD_CARD_PASSWORD,
69 } dpm_encryption_viewtype;
70
71 typedef enum {
72         ICON_CHECK,
73         ICON_BAR,
74 } dpm_encryption_icontype;
75
76 typedef struct appdata {
77         Evas_Object* win;
78         Evas_Object* conform;
79         Evas_Object* nf;
80         Evas_Object* base;
81         Evas_Object* navi_bar;
82         Evas_Object* dpm_encryption_layout;
83         Evas_Object* sdcard_pw_layout;
84         dpm_encryption_info_s device_info;
85
86         char* edj_path;
87         char* icon_check_path;
88         char* icon_bar_path;
89         char *entry_data;
90         int view_type;
91 } appdata_s;
92
93 #define __(str) dgettext("ode", str)
94 #define MSG_TEXT_STYLE "DEFAULT='font=Tizen:style=Regular font_size=30 color=#000000 wrap=mixed align=left'"
95 #define MAIN_MSG_TEXT_STYLE "DEFAULT='font=Tizen:style=Regular font_size=40 color=#000000 wrap=mixed align=left'"
96 #define SUB_MSG_TEXT_STYLE "DEFAULT='font=Tizen:style=Regular font_size=30 color=#000000 wrap=mixed align=left'"
97 #define NEEDED_BATTERY_PERCENT 80
98
99 /* for Progress Bar */
100 #define SUB_TITLE_STYLE_W "DEFAULT='font=Tizen:style=Regular font_size=40 color=#ffffff wrap=mixed align=center'"
101 #define SUB_CONTENT_STYLE_W "DEFAULT='font=Tizen:style=Regular font_size=32 color=#ffffff wrap=mixed align=center'"
102
103 void ode_encrypt_device_create_view(appdata_s* ad);
104 void ode_check_encrypt_device_create_view(appdata_s* ad);
105 void ode_encrypt_sd_card_create_view(appdata_s* ad);
106 void ode_decrypt_sd_card_create_view(appdata_s* ad);
107
108 void ode_confirm_encrypt_device_create_view(appdata_s* ad);
109 void ode_check_encrypt_sd_card_create_view(appdata_s* ad);
110 void ode_confirm_encrypt_sd_card_create_view(appdata_s* ad);
111 void ode_confirm_decrypt_sd_card_create_view(appdata_s* ad);
112
113 void locktype_status_changed_cb(keynode_t* node, void* data);
114 void sdcard_status_changed_cb(keynode_t* node, void* data);
115 void battery_changed_cb(device_callback_e type, void* value, void* user_data);
116
117 void create_base_window();
118 void create_progress_view(const char *type, const char *target);
119
120 #endif                                                  /* __ODE_H__ */