LeviLamina
Loading...
Searching...
No Matches
TextEditContext.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/input/TextRange.h"
7
8// auto generated forward declare list
9// clang-format off
10class IKeyboardProxy;
11// clang-format on
12
13class TextEditContext {
14public:
15 // TextEditContext inner types define
16 enum class CaretUpdate : uchar {
17 Left = 0,
18 Right = 1,
19 Up = 2,
20 Down = 3,
21 Begin = 4,
22 End = 5,
23 };
24
25 enum class TextEditAction : uchar {
26 Backspace = 0,
27 Copy = 1,
28 Cut = 2,
29 Delete = 3,
30 Newline = 4,
31 Paste = 5,
32 SelectAll = 6,
33 };
34
35public:
36 // member variables
37 // NOLINTBEGIN
38 ::ll::TypedStorage<1, 1, bool> mIsEnabled;
39 ::ll::TypedStorage<1, 1, bool> mCtrlDown;
40 ::ll::TypedStorage<8, 32, ::std::string> mCurrentUtf8Text;
41 ::ll::TypedStorage<4, 4, int> mCaret;
42 ::ll::TypedStorage<1, 1, bool> mHighlightSelection;
43 ::ll::TypedStorage<4, 4, int> mMaxLength;
44 ::ll::TypedStorage<4, 8, ::TextRange> mSelection;
45 ::ll::TypedStorage<8, 8, ::IKeyboardProxy*> mKeyboard;
46 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IKeyboardProxy>> mKeyboardProxy;
47 // NOLINTEND
48
49public:
50 // member functions
51 // NOLINTBEGIN
52 MCAPI void _feedDiff(::std::string_view oldText, ::std::string_view newText) const;
53
54 MCAPI void _feedInsert(::std::string_view text) const;
55
56 MCAPI void _onCopy();
57
58 MCAPI void _onPaste(::std::wstring const& cbText);
59
60 MCAPI void _replaceSelection(::std::string_view replacementUtf8Text);
61
62 MCAPI void enable(::std::string_view newUtf8Text, int maxLength);
63
64 MCAPI void feedAction(::TextEditContext::TextEditAction action);
65
66 MCAPI void feedCaretUpdate(::TextEditContext::CaretUpdate caretMovement);
67
68 MCAPI void feedText(::std::string_view utf8Text);
69
70 MCAPI void setCaretLocation(int location);
71
72 MCAPI void setText(::std::string_view newUtf8Text);
73
74 MCAPI ~TextEditContext();
75 // NOLINTEND
76
77public:
78 // destructor thunk
79 // NOLINTBEGIN
80 MCAPI void $dtor();
81 // NOLINTEND
82};
Definition IKeyboardProxy.h:5
Definition TextEditContext.h:5