~aleteoryx/muditaos

ref: c8c4f82080c1fd95c54c4fc28d64b9eed2255f92 muditaos/module-apps/application-desktop/windows/PinLockBaseWindow.hpp -rw-r--r-- 1.4 KiB
c8c4f820 — Piotr Tanski [EGD-4487] Application notes implemented. (#1094) 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "AppWindow.hpp"
#include "Text.hpp"

namespace gui
{
    class PinLock;
}

namespace gui
{
    class PinLockBaseWindow : public AppWindow
    {
      public:
        PinLockBaseWindow(app::Application *app, std::string name) : AppWindow(app, name)
        {}
        void build();
        void buildInfoText(unsigned int textHight);
        void buildPinLabels(std::function<Rect *()> itemBuilder,
                            unsigned int pinSize,
                            unsigned int offsetX,
                            unsigned int offsetY,
                            unsigned int boxWidth);
        void buildImages(const std::string &lockImg, const std::string &infoImg);
        void setBottomBarWidgetsActive(bool left, bool center, bool right);
        void setImagesVisible(bool lockImg, bool infoImg);
        void setBottomBarWidgetText(BottomBar::Side side, const UTF8 &txt);

        gui::Label *titleLabel = nullptr;
        gui::Text *infoText    = nullptr;
        gui::Image *lockImage = nullptr;
        gui::Image *infoImage = nullptr;
        gui::HBox *pinLabelsBox = nullptr;

        std::unique_ptr<PinLock> lock = nullptr;

      private:
        void buildBottomBar();
        void buildTopBar();
        void buildTitleLabel();
    };
} // namespace gui