15#include <AUI/Util/ACursorSelectable.h>
16#include <AUI/Enum/ATextInputActionIcon.h>
17#include <AUI/Enum/ATextInputType.h>
18#include "AUI/Common/ATimer.h"
19#include "AUI/Render/IRenderer.h"
20#include "AUI/Font/IFontView.h"
33 void setMaxTextLength(
size_t newTextLength) {
34 mMaxTextLength = newTextLength;
38 setText(
text().trim());
41 void setCopyable(
bool isCopyable) {
42 mIsCopyable = isCopyable;
45 virtual void setText(
const AString& t);
64 mTextInputActionIcon = textInputActionIcon;
73 return mTextInputActionIcon;
79 void copyToClipboard()
const;
84 void cutToClipboard();
94 void pasteFromClipboard();
110 void moveCursorLeft();
115 void moveCursorRight();
117 virtual void emitTextChanged(
const AString&
text) = 0;
118 virtual void emitTextChanging(
const AString&
text) = 0;
119 virtual void emitActionButtonPressed() = 0;
156 size_t mMaxTextLength = 0x200;
157 bool mIsMultiline =
false;
160 bool isCursorBlinkVisible()
const {
161 return mCursorBlinkVisible;
164 void updateCursorBlinking();
166 virtual void typeableErase(
size_t begin,
size_t end) = 0;
185 virtual size_t typeableFind(char16_t c,
size_t startPos = -1) = 0;
186 virtual size_t typeableReverseFind(char16_t c,
size_t startPos = -1) = 0;
187 virtual void updateSelectionOnTextSet(
const AString& t);
189 virtual void onCursorIndexChanged() = 0;
196 void enterChar(char16_t c);
198 AString getDisplayText()
override;
200 void handleKey(AInput::Key key);
209 unsigned mCursorBlinkCount = 0;
210 bool mCursorBlinkVisible =
true;
211 bool mTextChangedFlag =
false;
212 bool mIsCopyable =
true;
217 template<aui::derived_from<AView> Super>
220 virtual void typeableInvalidateFont() = 0;
221 void drawCursorImpl(
IRenderer& renderer, glm::ivec2 position,
unsigned lineHeight);
223 void fastenSelection();
Basic implementation of type shortcuts and selection for editable text fields.
Definition: AAbstractTypeableView.h:31
Base class for AAbstractTypeableView which is template class.
Definition: AAbstractTypeable.h:25
emits< Selection > selectionChanged
Definition: AAbstractTypeable.h:145
virtual bool typeableInsert(size_t at, const AString &toInsert)=0
ATextInputActionIcon textInputActionIcon() const noexcept
Definition: AAbstractTypeable.h:72
emits actionButtonPressed
Definition: AAbstractTypeable.h:153
emits< AString > textChanged
Definition: AAbstractTypeable.h:129
emits< AString > textChanging
Definition: AAbstractTypeable.h:137
virtual bool isPasswordField() const noexcept=0
virtual bool typeableInsert(size_t at, char16_t toInsert)=0
Definition: ACursorSelectable.h:27
virtual const AString & text() const =0
Represents a Unicode character string.
Definition: AString.h:37
A std::vector with AUI extensions.
Definition: AVector.h:38
Base class for rendering.
Definition: IRenderer.h:149
An std::weak_ptr with AUI extensions.
Definition: SharedPtrTypes.h:177
ATextInputType
Controls IME text input type of the text field.
Definition: ATextInputType.h:24
ATextInputActionIcon
Controls icons representing IME text input action the user is requested to perform.
Definition: ATextInputActionIcon.h:26
@ DEFAULT
There's no concrete input action. Let the OS decide which action is the most appropriate.