Apply tizen coding rules
[platform/core/security/ode.git] / tools / apps / ode / src / interface / internal / decrypt-device.h
1 /*
2  *
3  * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18
19 #ifndef __DECRYPT_DEVICE_H__
20 #define __DECRYPT_DEVICE_H__
21
22 #include "../interface.h"
23 #include "../tools/battery.h"
24 #include "../tools/vconf.h"
25 #include "../tools/encryption.h"
26 #include "../tools/locktype.h"
27 #include "../../widgets/genlist.h"
28 #include "../../widgets/button.h"
29
30 class DecryptDeviceCheck : public Page, public GenlistContentProvider<std::string> {
31 public:
32         DecryptDeviceCheck(Widget *parent);
33         ~DecryptDeviceCheck();
34
35         void setPartContent();
36         char *getLabel(const std::string &part, Evas_Object *obj, std::string *data);
37         void addItems(Genlist<std::string> *genlist);
38
39         void checkCharger();
40         void checkCapacity();
41
42 private:
43         void updateNextButton();
44         void registStatusCallback();
45         void removeStatusCallback();
46 private:
47         std::unique_ptr<Genlist<std::string>> genlist;
48         std::string groupIndex;
49         Battery battery;
50         bool chargerState;
51         bool capacityState;
52 };
53
54 class DecryptDeviceConfirm : public Page {
55 public:
56         DecryptDeviceConfirm(Widget *parent);
57         ~DecryptDeviceConfirm();
58
59         void setPartContent();
60 };
61
62 class DecryptDeviceInterface : public ODEInterface {
63 public:
64         DecryptDeviceInterface();
65         ~DecryptDeviceInterface();
66
67         void create();
68         void dispose();
69
70         void onConfirmed(const std::string &current);
71         void checkPassword();
72         void createConfirmPage();
73
74 private:
75         std::unique_ptr<Button> exitButton;
76         std::unique_ptr<DecryptDeviceCheck> checkPage;
77         std::unique_ptr<DecryptDeviceConfirm> confirmPage;
78
79         Locktype locktype;
80         InternalEncryption encryption;
81 };
82
83 #endif