~aleteoryx/muditaos

ref: 782980b261457bc9a54235bd1a0fc90a6bd1484e muditaos/module-gui/gui/widgets/TextConstants.hpp -rw-r--r-- 951 bytes
782980b2 — PrzeBrudny [EGD-4372] Text addition boundaries added with tests. Removed old bounds checking. Text blocks on newlines split issue fixed. Text widgets cleanups. (#1020) 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
47
48
49
50
51
52
53
54
55
56
// 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 <limits>

namespace gui
{
    namespace text
    {
        const unsigned int npos = std::numeric_limits<unsigned int>().max();
        const char newline      = '\n';
    }; // namespace text

    enum class TextLimitType
    {
        MAX_SIZE,
        MAX_LINES,
        MAX_SIGNS_COUNT
    };

    struct TextLimit
    {
        TextLimitType limitType;
        unsigned int limitValue;
    };

    enum class ExpandMode
    {
        EXPAND_UP,
        EXPAND_DOWN,
        EXPAND_NONE // default
    };

    enum class EditMode
    {
        BROWSE,
        EDIT,
        SCROLL,
    };

    enum class TextType
    {
        SINGLE_LINE = 1,
        MULTI_LINE
    };

    enum class InputBound
    {
        CAN_ADD,
        CAN_ADD_PART,
        HIT_BOUND
    };

} // namespace gui