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
70 OnSelectionChanged(::cohtml::IInputProxy* proxy, ::cohtml::TextInput::Selection selection) /*override*/;
71
72 virtual void OnTextChanged(
73 ::cohtml::IInputProxy* proxy,
74 char const* addedChars,
75 uint addedCount,
76 char const* removedChars,
77 uint removedCount,
78 uint index
79 ) /*override*/;
80
81 virtual void OnFocus(::cohtml::IInputProxy* proxy) /*override*/;
82
83 virtual void OnBlur(::cohtml::IInputProxy*) /*override*/;
84 // NOLINTEND
85
86public:
87 // member functions
88 // NOLINTBEGIN
89 MCAPI TextInputHandler(::Bedrock::NotNullNonOwnerPtr<::GuiData> guiData, ::KeyboardManager& keyboardManager);
90
91 MCAPI void _handleLostFocus();
92
93 MCAPI void _sendTextChangedEvent(::OreUI::InputUtils::TextInputResult const& inputResult);
94
95 MCAPI ::std::optional<::RectangleArea> getTextInputControlArea();
96
97 MCAPI ::std::string getTextInputText();
98
99 MCAPI void handleNativeTextInput(::std::string_view text);
100
101 MCAPI void imeConfirmComposition();
102
103 MCAPI void imeConfirmComposition(::std::string const& utf8Text);
104
105 MCAPI void imeEndComposition();
106
107 MCAPI void imeReplaceCompositionTextRange(::std::string const& replacement, int from, int to);
108
109 MCAPI void imeStartComposition();
110
111 MCAPI void imeUpdateCompositionText(::std::string const& utf8Text);
112
113 MCAPI void setText(::std::string const& text, ::std::optional<::TextBoxSelection> const& selection);
114 // NOLINTEND
115
116public:
117 // constructor thunks
118 // NOLINTBEGIN
119 MCAPI void* $ctor(::Bedrock::NotNullNonOwnerPtr<::GuiData> guiData, ::KeyboardManager& keyboardManager);
120 // NOLINTEND
121
122public:
123 // virtual function thunks
124 // NOLINTBEGIN
125 MCAPI void $OnSelectionChanged(::cohtml::IInputProxy* proxy, ::cohtml::TextInput::Selection selection);
126
127 MCAPI void $OnTextChanged(
128 ::cohtml::IInputProxy* proxy,
129 char const* addedChars,
130 uint addedCount,
131 char const* removedChars,
132 uint removedCount,
133 uint index
134 );
135
136 MCAPI void $OnFocus(::cohtml::IInputProxy* proxy);
137
138 MCAPI void $OnBlur(::cohtml::IInputProxy*);
139 // NOLINTEND
140
141public:
142 // vftables
143 // NOLINTBEGIN
144 MCNAPI static void** $vftable();
145 // NOLINTEND
146};
147
148} // 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