69f95d612099e3551178e06a1d8717cc932fa0fb
[platform/core/security/krate.git] / tools / apps / setup-wizard / include / krate-setup.h
1 /*
2  * Tizen Krate Setup-Wizard application
3  *
4  * Copyright (c) 2016 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 #ifndef __KRATE_SETUP_H__
20 #define __KRATE_SETUP_H__
21
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <string.h>
25 #include <limits.h>
26 #include <app.h>
27 #include <app_common.h>
28 #include <bundle.h>
29 #include <dlog.h>
30 #include <Elementary.h>
31 #include <system_settings.h>
32
33 #include <krate/krate.h>
34 #include <krate/app-proxy.h>
35
36 #ifdef  LOG_TAG
37 #undef  LOG_TAG
38 #endif
39 #define LOG_TAG "krate-setup-wizard"
40
41 #if !defined(PACKAGE)
42 #define PACKAGE "org.tizen.krate-setup-wizard"
43 #endif
44
45 #define KEYGUARD_PACKAGE "org.tizen.keyguard"
46 #define KASKIT_PACKAGE "org.tizen.kaskit"
47
48 #define DPM_SYSPOPUP_ICON_PATH "/usr/share/icons/default/small/org.tizen.dpm-syspopup.png"
49 #define TITLE_STYLE_W "DEFAULT='font=Tizen:style=Reqular font_size=46 color=#ffffff wrap=mixed align=center'"
50 #define SUB_TITLE_STYLE_B "DEFAULT='font=Tizen:style=Regular font_size=50 color=#000000 wrap=mixed align=center'"
51 #define SUB_CONTENT_STYLE_B "DEFAULT='font=Tizen:style=Regular font_size=36 color=#000000 wrap=mixed align=center'"
52 #define SUB_TITLE_STYLE_W "DEFAULT='font=Tizen:style=Regular font_size=50 color=#ffffff wrap=mixed align=center'"
53 #define SUB_CONTENT_STYLE_W "DEFAULT='font=Tizen:style=Regular font_size=36 color=#ffffff wrap=mixed align=center'"
54
55 #define ENTRY_TITLE_STYLE_B "DEFAULT='font=Tizen:style=Regular font_size=36 color=#000000 wrap=mixed'"
56 #define ENTRY_INFO_STYLE_G "DEFAULT='font=Tizen:style=Regular font_size=32 color=#A9A9A9 wrap=mixed'"
57
58 #define BODY_KRATE_CREATE_ERROR "Failed to create the Separated Krate."
59 #define BODY_KRATE_REMOVE_ERROR "Failed to remove the Separated Krate."
60
61 #define __(str) dgettext("krate-setup-wizard", str)
62
63 typedef struct {
64         char *mode;
65         char *krate_name;
66         char *krate_password;
67
68         krate_manager_h krate_manager;
69         int krate_event_cb_id;
70         bool request_done;
71
72         app_control_h app_control;
73 } appdata_s;
74
75 typedef struct {
76         Evas_Object *win;
77         Evas_Object *conform;
78         Evas_Object *nf;
79         char *edj_path;
80 } uidata_s;
81
82 void _create_base_window(appdata_s *data);
83 void _create_security_view(appdata_s *data);
84 void _create_setup_view(appdata_s *data);
85 void _create_two_button_layout(Evas_Object *parent, Evas_Object *left_button, Evas_Object *right_button);
86
87 int _send_krate_create_request(appdata_s *ad);
88 int _send_krate_remove_request(appdata_s *ad);
89 void _create_notification(app_control_h app_control);
90 void *krate_request_fail(void *ad);
91
92 #endif /* __KRATE_SETUP_H__ */