Skip to content
LeviMC
English
AutoLightDark
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 MCNAPI TextInputHandler(::Bedrock::NotNullNonOwnerPtr<::GuiData> guiData, ::KeyboardManager& keyboardManager);
90
91 MCNAPI void _handleLostFocus();
92
94
95 MCNAPI ::std::optional<::RectangleArea> getTextInputControlArea();
96
97 MCNAPI ::std::string getTextInputText();
98
99 MCNAPI void handleNativeTextInput(::std::string_view text);
100
102
103 MCNAPI void imeConfirmComposition(::std::string const& utf8Text);
104
105 MCNAPI void imeEndComposition();
106
107 MCNAPI void imeReplaceCompositionTextRange(::std::string const& replacement, int from, int to);
108
109 MCNAPI void imeStartComposition();
110
111 MCNAPI void imeUpdateCompositionText(::std::string const& utf8Text);
112
113 MCNAPI void setText(::std::string const& text, ::std::optional<::TextBoxSelection> const& selection);
114 // NOLINTEND
115
116public:
117 // constructor thunks
118 // NOLINTBEGIN
119 MCNAPI void* $ctor(::Bedrock::NotNullNonOwnerPtr<::GuiData> guiData, ::KeyboardManager& keyboardManager);
120 // NOLINTEND
121
122public:
123 // virtual function thunks
124 // NOLINTBEGIN
126
127 MCNAPI void $OnTextChanged(
129 char const* addedChars,
130 uint addedCount,
131 char const* removedChars,
132 uint removedCount,
133 uint index
134 );
135
136 MCNAPI void $OnFocus(::cohtml::IInputProxy* proxy);
137
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
MCAPI void _sendTextChangedEvent(::OreUI::InputUtils::TextInputResult const &inputResult)
MCAPI void imeEndComposition()
MCAPI void imeStartComposition()
MCAPI void $OnTextChanged(::cohtml::IInputProxy *proxy, char const *addedChars, uint addedCount, char const *removedChars, uint removedCount, uint index)
MCAPI void imeReplaceCompositionTextRange(::std::string const &replacement, int from, int to)
MCAPI TextInputHandler(::Bedrock::NotNullNonOwnerPtr<::GuiData > guiData, ::KeyboardManager &keyboardManager)
MCAPI void $OnFocus(::cohtml::IInputProxy *proxy)
MCAPI void $OnBlur(::cohtml::IInputProxy *)
MCAPI void * $ctor(::Bedrock::NotNullNonOwnerPtr<::GuiData > guiData, ::KeyboardManager &keyboardManager)
MCAPI void $OnSelectionChanged(::cohtml::IInputProxy *proxy, ::cohtml::TextInput::Selection selection)
MCAPI void _handleLostFocus()
MCAPI void handleNativeTextInput(::std::string_view text)
MCAPI void setText(::std::string const &text, ::std::optional<::TextBoxSelection > const &selection)
MCAPI void imeConfirmComposition(::std::string const &utf8Text)
static MCAPI void ** $vftable()
MCAPI void imeConfirmComposition()
MCAPI ::std::optional<::RectangleArea > getTextInputControlArea()
MCAPI::std::string getTextInputText()
MCAPI void imeUpdateCompositionText(::std::string const &utf8Text)
Definition IInputProxy.h:7
Definition View.h:7
Definition TextInputResult.h:7
Definition TextInputHandler.h:15
Definition TextBoxSelection.h:5
Definition Selection.h:7