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> mCachedText;
46 ::ll::TypedStorage<8, 32, ::std::string> mLOCCachedText;
47 ::ll::TypedStorage<8, 32, ::std::string> mCachedLangCode;
48 ::ll::TypedStorage<8, 32, ::std::string> mCachedFontSources;
49 ::ll::TypedStorage<8, 32, ::std::string> mCachedTextTTS;
50 ::ll::TypedStorage<8, 24, ::std::vector<int>> mCaretOffsets;
51 ::ll::TypedStorage<4, 4, float> mCaretHeightOffset;
52 ::ll::TypedStorage<4, 4, float> mLineHeight;
53 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mNotifyControlsOnEllipses;
54 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::FontRepository const>> mFontRepository;
55 ::ll::TypedStorage<4, 12, ::std::optional<::glm::vec2>> mLastClickRelativePosition;
56 bool mShadow : 1;
57 bool mShouldRenderCaret : 1;
58 bool mLocalize : 1;
59 bool mCaretBlinkVisible : 1;
60 bool mHideHyphen : 1;
61 bool mEnableProfanityFilter : 1;
62 bool mProfanityFilterToggleState : 1;
63 bool mBackupFontHandleOverridden : 1;
64 bool mNotifyEllipsesOnSiblings : 1;
65 bool mCachedTextDirty : 1;
66 // NOLINTEND
67
68public:
69 // prevent constructor by default
70 TextComponent();
71
72public:
73 // virtual functions
74 // NOLINTBEGIN
75 virtual ~TextComponent() /*override*/ = default;
76
77 virtual ::std::unique_ptr<::UIComponent> clone(::UIControl& cloneOwner) const /*override*/;
78
79 virtual void reset() /*override*/;
80
81 virtual void render(::UIRenderContext& context);
82
83 virtual void updateUI(::UIMeasureStrategy const& uiMeasureStrategy) /*override*/;
84
85 virtual ::std::string const& getTextToSpeechComponentValue() const /*override*/;
86 // NOLINTEND
87
88public:
89 // member functions
90 // NOLINTBEGIN
91 MCAPI TextComponent(::UIControl& owner, ::Bedrock::NotNullNonOwnerPtr<::FontRepository const> fontRepository);
92
93 MCAPI int _getCaretPosition() const;
94
95 MCAPI ::std::string _getMeasuredText(::UIRenderContext& context);
96
97 MCAPI ::std::string calculateUpdatedText();
98
99 MCAPI void setFontType(::std::string const& fontType);
100
101 MCAPI void setText(::std::string const& label);
102
103 MCAPI void setTextTTS(::std::string const& label);
104 // NOLINTEND
105
106public:
107 // constructor thunks
108 // NOLINTBEGIN
109 MCAPI void* $ctor(::UIControl& owner, ::Bedrock::NotNullNonOwnerPtr<::FontRepository const> fontRepository);
110 // NOLINTEND
111
112public:
113 // virtual function thunks
114 // NOLINTBEGIN
115 MCAPI ::std::unique_ptr<::UIComponent> $clone(::UIControl& cloneOwner) const;
116
117 MCAPI void $reset();
118
119 MCAPI void $render(::UIRenderContext& context);
120
121 MCAPI void $updateUI(::UIMeasureStrategy const& uiMeasureStrategy);
122
123 MCAPI ::std::string const& $getTextToSpeechComponentValue() const;
124 // NOLINTEND
125};
Definition FontRepository.h:5
Definition RenderableComponent.h:5
Definition TextComponent.h:5
Definition UIComponent.h:5
Definition UIControl.h:5
Definition UIMeasureStrategy.h:5
Definition UIRenderContext.h:5