Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
TextComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/FontHandle.h"
7#include "mc/client/gui/FontSize.h"
8#include "mc/client/gui/TextAlignment.h"
9#include "mc/client/gui/controls/RenderableComponent.h"
10#include "mc/deps/core/math/Color.h"
11#include "mc/deps/core/utility/NonOwnerPointer.h"
12
13// auto generated forward declare list
14// clang-format off
15class FontRepository;
16class UIComponent;
17class UIControl;
19class UIRenderContext;
20// clang-format on
21
23public:
24 // member variables
25 // NOLINTBEGIN
26 ::ll::TypedStorage<8, 80, ::FontHandle> mFontHandle;
27 ::ll::TypedStorage<8, 80, ::FontHandle> mPrimaryFontHandle;
28 ::ll::TypedStorage<8, 80, ::FontHandle> mBackupFontHandle;
29 ::ll::TypedStorage<4, 4, float> mTextOffset;
30 ::ll::TypedStorage<4, 16, ::mce::Color> mColor;
31 ::ll::TypedStorage<4, 4, float> mLockedAlpha;
32 ::ll::TypedStorage<4, 16, ::mce::Color> mLockedColor;
33 ::ll::TypedStorage<4, 4, ::ui::FontSize> mFontSize;
34 ::ll::TypedStorage<4, 4, float> mFontScaleFactor;
35 ::ll::TypedStorage<4, 4, float> mLinePadding;
36 ::ll::TypedStorage<4, 4, ::ui::TextAlignment> mAlignment;
37 ::ll::TypedStorage<8, 32, ::std::string> mLabel;
38 ::ll::TypedStorage<8, 32, ::std::string> mLabelTTS;
39 ::ll::TypedStorage<4, 4, float> mCurrentTime;
40 ::ll::TypedStorage<4, 4, int> mLastNumChanges;
41 ::ll::TypedStorage<8, 8, uint64> mLastTextHash;
42 ::ll::TypedStorage<8, 8, uint64> mLastFilteredTextHash;
43 ::ll::TypedStorage<8, 32, ::std::string> mFilteredText;
44 ::ll::TypedStorage<8, 32, ::std::string> mMeasuredText;
45 ::ll::TypedStorage<8, 32, ::std::string> mRenderTextScratch;
46 ::ll::TypedStorage<8, 32, ::std::string> mCachedText;
47 ::ll::TypedStorage<8, 32, ::std::string> mLOCCachedText;
48 ::ll::TypedStorage<8, 32, ::std::string> mCachedLangCode;
49 ::ll::TypedStorage<8, 32, ::std::string> mCachedFontSources;
50 ::ll::TypedStorage<8, 32, ::std::string> mCachedTextTTS;
51 ::ll::TypedStorage<8, 24, ::std::vector<int>> mCaretOffsets;
52 ::ll::TypedStorage<4, 4, float> mCaretHeightOffset;
53 ::ll::TypedStorage<4, 4, float> mLineHeight;
54 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mNotifyControlsOnEllipses;
55 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::FontRepository const>> mFontRepository;
56 ::ll::TypedStorage<4, 12, ::std::optional<::glm::vec2>> mLastClickRelativePosition;
57 bool mShadow : 1;
58 bool mShouldRenderCaret : 1;
59 bool mLocalize : 1;
60 bool mCaretBlinkVisible : 1;
61 bool mHideHyphen : 1;
62 bool mEnableProfanityFilter : 1;
63 bool mProfanityFilterToggleState : 1;
64 bool mBackupFontHandleOverridden : 1;
65 bool mNotifyEllipsesOnSiblings : 1;
66 bool mCachedTextDirty : 1;
67 // NOLINTEND
68
69public:
70 // prevent constructor by default
71 TextComponent();
72
73public:
74 // virtual functions
75 // NOLINTBEGIN
76 virtual ~TextComponent() /*override*/ = default;
77
78 virtual ::std::unique_ptr<::UIComponent> clone(::UIControl& cloneOwner) const /*override*/;
79
80 virtual void reset() /*override*/;
81
82 virtual void render(::UIRenderContext& context);
83
84 virtual void updateUI(::UIMeasureStrategy const& uiMeasureStrategy) /*override*/;
85
86 virtual ::std::string const& getTextToSpeechComponentValue() const /*override*/;
87 // NOLINTEND
88
89public:
90 // member functions
91 // NOLINTBEGIN
92 MCNAPI TextComponent(::UIControl& owner, ::Bedrock::NotNullNonOwnerPtr<::FontRepository const> fontRepository);
93
94 MCNAPI int _getCaretPosition() const;
95
96 MCNAPI ::std::string const& _getMeasuredText(::UIRenderContext& context);
97
98 MCNAPI ::std::string calculateUpdatedText();
99
100 MCNAPI void setFontType(::std::string const& fontType);
101
102 MCNAPI void setTextTTS(::std::string const& label);
103 // NOLINTEND
104
105public:
106 // constructor thunks
107 // NOLINTBEGIN
108 MCNAPI void* $ctor(::UIControl& owner, ::Bedrock::NotNullNonOwnerPtr<::FontRepository const> fontRepository);
109 // NOLINTEND
110
111public:
112 // virtual function thunks
113 // NOLINTBEGIN
114 MCNAPI ::std::unique_ptr<::UIComponent> $clone(::UIControl& cloneOwner) const;
115
116 MCNAPI void $reset();
117
118 MCAPI void $render(::UIRenderContext& context);
119
120 MCNAPI void $updateUI(::UIMeasureStrategy const& uiMeasureStrategy);
121
122 MCNAPI ::std::string const& $getTextToSpeechComponentValue() const;
123 // NOLINTEND
124};
Definition FontRepository.h:5
Definition RenderableComponent.h:5
Definition TextComponent.h:5
MCAPI::std::string calculateUpdatedText()
MCAPI::std::string const & $getTextToSpeechComponentValue() const
MCAPI void $updateUI(::UIMeasureStrategy const &uiMeasureStrategy)
MCAPI int _getCaretPosition() const
MCAPI::std::string const & _getMeasuredText(::UIRenderContext &context)
MCAPI void * $ctor(::UIControl &owner, ::Bedrock::NotNullNonOwnerPtr<::FontRepository const > fontRepository)
MCAPI void setFontType(::std::string const &fontType)
MCAPI void $reset()
MCAPI ::std::unique_ptr<::UIComponent > $clone(::UIControl &cloneOwner) const
MCAPI void setTextTTS(::std::string const &label)
Definition UIComponent.h:5
Definition UIControl.h:5
Definition UIMeasureStrategy.h:5
Definition UIRenderContext.h:5
STL namespace.
Definition context.h:5