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/client/gui/oreui/input/GamefaceImeComposer.h"
7#include "mc/deps/core/utility/NonOwnerPointer.h"
8#include "mc/deps/input/RectangleArea.h"
9#include "mc/external/gameface/cohtml/ITextInputHandler.h"
10
11// auto generated forward declare list
12// clang-format off
13class GuiData;
14class KeyboardManager;
15struct TextBoxSelection;
16namespace OreUI::InputUtils { struct TextInputResult; }
17namespace cohtml { class IInputProxy; }
18namespace cohtml { class View; }
19namespace cohtml::TextInput { struct Selection; }
20// clang-format on
21
22namespace OreUI {
23
24class TextInputHandler : public ::cohtml::ITextInputHandler {
25public:
26 // TextInputHandler inner types declare
27 // clang-format off
28 struct TextInputState;
29 // clang-format on
30
31 // TextInputHandler inner types define
32 struct TextInputState {
33 public:
34 // member variables
35 // NOLINTBEGIN
36 ::ll::TypedStorage<8, 8, ::cohtml::IInputProxy&> mInputProxy;
37 ::ll::TypedStorage<8, 56, ::std::optional<::OreUI::GamefaceImeComposer>> mImeComposer;
38 ::ll::TypedStorage<4, 20, ::std::optional<::RectangleArea>> mCaretArea;
39 ::ll::TypedStorage<4, 4, int const> mMaxLength;
40 ::ll::TypedStorage<1, 1, bool const> mIsMultiline;
41 ::ll::TypedStorage<1, 1, bool> mIgnoreTextCallbacks;
42 // NOLINTEND
43
44 public:
45 // prevent constructor by default
46 TextInputState& operator=(TextInputState const&);
47 TextInputState(TextInputState const&);
48 TextInputState();
49 };
50
51public:
52 // member variables
53 // NOLINTBEGIN
54 ::ll::TypedStorage<8, 8, ::KeyboardManager&> mKeyboardManager;
55 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::GuiData>> mGuiData;
56 ::ll::TypedStorage<8, 8, ::cohtml::View*> mView;
57 ::ll::TypedStorage<8, 104, ::std::optional<::OreUI::TextInputHandler::TextInputState>> mTextInputState;
58 // NOLINTEND
59
60public:
61 // prevent constructor by default
62 TextInputHandler& operator=(TextInputHandler const&);
63 TextInputHandler(TextInputHandler const&);
64 TextInputHandler();
65
66public:
67 // virtual functions
68 // NOLINTBEGIN
69 virtual void OnSelectionChanged(::cohtml::IInputProxy*, ::cohtml::TextInput::Selection) /*override*/;
70
71 virtual void OnTextChanged(
72 ::cohtml::IInputProxy* addedChars,
73 char const* addedCount,
74 uint removedChars,
75 char const* removedCount,
76 uint index,
77 uint
78 ) /*override*/;
79
80 virtual void OnFocus(::cohtml::IInputProxy* proxy) /*override*/;
81
82 virtual void OnBlur(::cohtml::IInputProxy*) /*override*/;
83 // NOLINTEND
84
85public:
86 // member functions
87 // NOLINTBEGIN
88 MCAPI TextInputHandler(::Bedrock::NotNullNonOwnerPtr<::GuiData> guiData, ::KeyboardManager& keyboardManager);
89
90 MCAPI void _handleLostFocus();
91
92 MCAPI void _sendTextChangedEvent(::OreUI::InputUtils::TextInputResult const& inputResult);
93
94 MCAPI ::std::optional<::RectangleArea> getTextInputControlArea();
95
96 MCAPI ::std::string getTextInputText();
97
98 MCAPI void handleNativeTextInput(::std::string_view text);
99
100 MCAPI void imeConfirmComposition();
101
102 MCAPI void imeConfirmComposition(::std::string const& utf8Text);
103
104 MCAPI void imeEndComposition();
105
106 MCAPI void imeReplaceCompositionTextRange(::std::string const& replacement, int from, int to);
107
108 MCAPI void imeStartComposition();
109
110 MCAPI void imeUpdateCompositionText(::std::string const& utf8Text);
111
112 MCAPI void setText(::std::string const& text, ::std::optional<::TextBoxSelection> const& selection);
113 // NOLINTEND
114
115public:
116 // constructor thunks
117 // NOLINTBEGIN
118 MCAPI void* $ctor(::Bedrock::NotNullNonOwnerPtr<::GuiData> guiData, ::KeyboardManager& keyboardManager);
119 // NOLINTEND
120
121public:
122 // virtual function thunks
123 // NOLINTBEGIN
124 MCAPI void $OnSelectionChanged(::cohtml::IInputProxy*, ::cohtml::TextInput::Selection);
125
126 MCAPI void $OnTextChanged(
127 ::cohtml::IInputProxy* addedChars,
128 char const* addedCount,
129 uint removedChars,
130 char const* removedCount,
131 uint index,
132 uint
133 );
134
135 MCAPI void $OnFocus(::cohtml::IInputProxy* proxy);
136
137 MCAPI void $OnBlur(::cohtml::IInputProxy*);
138 // NOLINTEND
139
140public:
141 // vftables
142 // NOLINTBEGIN
143 MCNAPI static void** $vftable();
144 // NOLINTEND
145};
146
147} // namespace OreUI
Definition GuiData.h:5
Definition KeyboardManager.h:5
Definition TextInputHandler.h:7
static MCAPI void ** $vftable()
Definition IInputProxy.h:7
Definition View.h:7
Definition TextInputResult.h:7
Definition TextInputHandler.h:15
Definition TextBoxSelection.h:5
Definition Selection.h:7