~aleteoryx/muditaos

ref: bcdaf15ed1560876b4a784f758ead67a7e240968 muditaos/module-apps/locks/widgets/LockBox.hpp -rw-r--r-- 1.1 KiB
bcdaf15e — Przemyslaw Brudny [EGD-6740] Availability and Change handled by PhoneLockHandler 4 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
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <cstdint>

namespace gui
{
    class LockBox
    {
      public:
        enum class InputActionType
        {
            ProvideInput,
            ProvideNewInput,
            ConfirmNewInput
        };

        enum class InputErrorType
        {
            InvalidInput,
            NewInputConfirmFailed,
            UnhandledError
        };

        virtual void popChar(unsigned int charNum) = 0;
        virtual void putChar(unsigned int charNum) = 0;
        virtual void clear()                       = 0;

        virtual void setVisibleStateInputRequired(InputActionType type)                   = 0;
        virtual void setVisibleStateInputInvalid(InputErrorType type, unsigned int value) = 0;
        virtual void setVisibleStateBlocked()                                             = 0;

        virtual void buildLockBox(unsigned int inputSize) = 0;
        virtual ~LockBox()                                = default;
    };
} // namespace gui