LeviLamina
Loading...
Searching...
No Matches
TextInputHandler.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/NonOwnerPointer.h"
7#include "mc/deps/input/RectangleArea.h"
8#include "mc/deps/input/TextBoxSelection.h"
9#include "mc/external/gameface/cohtml/ITextInputHandler.h"
10
11// auto generated forward declare list
12// clang-format off
13class GuiData;
14class KeyboardManager;
15namespace OreUI { struct TextInputResult; }
16namespace cohtml { class IInputProxy; }
17namespace cohtml::TextInput { struct Selection; }
18// clang-format on
19
20namespace OreUI {
21
22class TextInputHandler : public ::cohtml::ITextInputHandler {
23public:
24 // TextInputHandler inner types declare
25 // clang-format off
26 struct TextInputState;
27 // clang-format on
28
29 // TextInputHandler inner types define
30 struct TextInputState {
31 public:
32 // member variables
33 // NOLINTBEGIN
34 ::ll::TypedStorage<8, 32, ::std::string> mCurrentText;
35 ::ll::TypedStorage<4, 16, ::RectangleArea> mCaretArea;
36 ::ll::TypedStorage<4, 16, ::RectangleArea> mControlArea;
37 ::ll::TypedStorage<4, 12, ::TextBoxSelection> mSelection;
38 ::ll::TypedStorage<4, 4, int const> mMaxLength;
39 ::ll::TypedStorage<1, 1, bool const> mIsMultiline;
40 // NOLINTEND
41 };
42
43 using OnTextChangedCallback = ::std::function<void(::OreUI::TextInputResult)>;
44
45public:
46 // member variables
47 // NOLINTBEGIN
48 ::ll::TypedStorage<8, 8, ::KeyboardManager&> mKeyboardManager;
49 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::GuiData>> mGuiData;
50 ::ll::TypedStorage<8, 64, ::std::function<void(::OreUI::TextInputResult)>> mOnTextChangedCallback;
51 ::ll::TypedStorage<1, 1, bool> mReportTextInputChanges;
52 ::ll::TypedStorage<8, 96, ::std::optional<::OreUI::TextInputHandler::TextInputState>> mTextInputState;
53 // NOLINTEND
54
55public:
56 // prevent constructor by default
57 TextInputHandler& operator=(TextInputHandler const&);
58 TextInputHandler(TextInputHandler const&);
59 TextInputHandler();
60
61public:
62 // virtual functions
63 // NOLINTBEGIN
64 virtual void
65 OnSelectionChanged(::cohtml::IInputProxy* proxy, ::cohtml::TextInput::Selection selection) /*override*/;
66
67 virtual void OnTextChanged(
68 ::cohtml::IInputProxy* proxy,
69 char const* addedChars,
70 uint addedCount,
71 char const* removedChars,
72 uint removedCount,
73 uint index
74 ) /*override*/;
75
76 virtual void OnFocus(::cohtml::IInputProxy* proxy) /*override*/;
77
78 virtual void OnBlur(::cohtml::IInputProxy*) /*override*/;
79
80 virtual ~TextInputHandler() /*override*/;
81 // NOLINTEND
82
83public:
84 // member functions
85 // NOLINTBEGIN
86 MCAPI void _updateFromInputProxy(::cohtml::IInputProxy& proxy);
87
88 MCAPI ::std::optional<::OreUI::TextInputResult>
89 calculateChange(::std::string const& currentInput, ::std::string const& newInput) const;
90
91 MCAPI ::std::string getTextInputText();
92 // NOLINTEND
93
94public:
95 // destructor thunk
96 // NOLINTBEGIN
97 MCAPI void $dtor();
98 // NOLINTEND
99
100public:
101 // virtual function thunks
102 // NOLINTBEGIN
103 MCAPI void $OnSelectionChanged(::cohtml::IInputProxy* proxy, ::cohtml::TextInput::Selection selection);
104
105 MCAPI void $OnTextChanged(
106 ::cohtml::IInputProxy* proxy,
107 char const* addedChars,
108 uint addedCount,
109 char const* removedChars,
110 uint removedCount,
111 uint index
112 );
113
114 MCAPI void $OnFocus(::cohtml::IInputProxy* proxy);
115
116 MCAPI void $OnBlur(::cohtml::IInputProxy*);
117 // NOLINTEND
118
119public:
120 // vftables
121 // NOLINTBEGIN
122 MCNAPI static void** $vftable();
123 // NOLINTEND
124};
125
126} // namespace OreUI
Definition GuiData.h:5
Definition KeyboardManager.h:5
Definition TextInputHandler.h:7
static MCAPI void ** $vftable()
Definition IInputProxy.h:7
Definition TextInputHandler.h:15
Definition TextInputResult.h:7
Definition Selection.h:7