~aleteoryx/muditaos

ref: d29ee76fa546a32e9e004de2833c25e818fb94f5 muditaos/module-apps/application-desktop/windows/ScreenLockBox.hpp -rw-r--r-- 1.3 KiB
d29ee76f — Michał Kamoń [EGD-4168] passcodes for sim change to variable length (#924) 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
// 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 "PinLockBox.hpp"
#include "BoxLayout.hpp"
#include "Image.hpp"

namespace gui
{
    class PinLockBaseWindow;
}

namespace gui
{
    class ScreenLockBox : public PinLockBox
    {
      public:
        ScreenLockBox(PinLockBaseWindow *LockBaseWindow) : LockWindow(LockBaseWindow)
        {}

      private:
        struct PinLabel : public HBox
        {
            gui::Image *image;
            PinLabel(Item *parent, const uint32_t &w, const uint32_t &h);
            void setVisibleState(bool isImageVisible);
        };

        std::vector<PinLabel *> pinLabels;
        PinLockBaseWindow *LockWindow;
        void popChar(unsigned int charNum) override final;
        void putChar(unsigned int charNum) override final;

        void setVisibleStateEnterPin() override final;
        void setVisibleStateVerifiedPin() override final;
        void setVisibleStateInvalidPin() override final;
        void setVisibleStateBlocked() override final;

        void buildLockBox(unsigned int pinSize) override final;
        void buildPinLabels(unsigned int pinSize);
        void clearPinLabels();
    };
} // namespace gui