1 /*
2  * Copyright 2023, The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <stdint.h>
20 #include <teeui/error.h>
21 #include <teeui/utils.h>
22 #include <string>
23 
24 namespace teeui {
25 namespace layouts {
26 
27 static constexpr teeui::Color kColorEnabled = 0xff242120;
28 static constexpr teeui::Color kColorDisabled = 0xffbdbdbd;
29 static constexpr teeui::Color kColorEnabledInv = 0xffdedede;
30 static constexpr teeui::Color kColorDisabledInv = 0xff424242;
31 static constexpr teeui::Color kColorShieldInv = 0xfff69d66;
32 static constexpr teeui::Color kColorShield = 0xffe8731a;
33 static constexpr teeui::Color kColorHintInv = 0xffa6a09a;
34 static constexpr teeui::Color kColorHint = 0xff68635f;
35 static constexpr teeui::Color kColorButton = 0xffe8731a;
36 static constexpr teeui::Color kColorButtonInv = 0xfff69d66;
37 static constexpr teeui::Color kColorBackground = 0xffffffff;
38 static constexpr teeui::Color kColorBackgroundInv = 0xff000000;
39 
40 class ILayout {
41 public:
ILayout(bool inverted)42     explicit ILayout(bool inverted) : inverted_(inverted) {}
43 
44     virtual void setLanguage(const char*) = 0;
45     virtual void setConfirmationMessage(const char*) = 0;
46     virtual void showInstructions(bool) = 0;
47     virtual teeui::Error drawElements(const teeui::PixelDrawer& drawPixel) = 0;
48     virtual ~ILayout() = default;
49 
50 protected:
51     bool inverted_;
52 };
53 
54 }  // namespace layouts
55 }  // namespace teeui
56