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"
28 ~AAbstractTypeable()
override;
33 void setMaxTextLength(
size_t newTextLength) {
34 mMaxTextLength = newTextLength;
41 void setCopyable(
bool isCopyable) {
42 mIsCopyable = isCopyable;
45 virtual void setText(
const AString& t);
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;
143 size_t mMaxTextLength = 0x200;
144 bool mIsMultiline =
false;
147 bool isCursorBlinkVisible()
const {
148 return mCursorBlinkVisible;
151 void updateCursorBlinking();
153 virtual void typeableErase(
size_t begin,
size_t end) = 0;
172 virtual size_t typeableFind(
char16_t c,
size_t startPos = -1) = 0;
173 virtual size_t typeableReverseFind(
char16_t c,
size_t startPos = -1) = 0;
174 virtual void updateSelectionOnTextSet(
const AString& t);
176 virtual void onCursorIndexChanged() = 0;
185 AString getDisplayText()
override;
186 AMenuModel composeContextMenuImpl();
187 void handleKey(AInput::Key key);
196 unsigned mCursorBlinkCount = 0;
197 bool mCursorBlinkVisible =
true;
198 bool mTextChangedFlag =
false;
199 bool mIsCopyable =
true;
204 template<aui::derived_from<AView> Super>
205 friend class AAbstractTypeableView;
207 virtual void typeableInvalidateFont() = 0;
208 void drawCursorImpl(
IRenderer& renderer, glm::ivec2 position,
unsigned lineHeight);
210 void fastenSelection();
virtual ATextInputType textInputType() const noexcept=0
void enterChar(char16_t c)
Definition AAbstractTypeable.cpp:209
emits< Selection > selectionChanged
Selection is changed due to user's action or code operation.
Definition AAbstractTypeable.h:135
virtual bool typeableInsert(size_t at, const AString &toInsert)=0
void setTextInputActionIcon(ATextInputActionIcon textInputActionIcon) noexcept
Definition AAbstractTypeable.h:63
ATextInputActionIcon textInputActionIcon() const noexcept
Definition AAbstractTypeable.h:72
emits actionButtonPressed
When action button of touchscreen keyboard or AInput::RETURN is pressed.
Definition AAbstractTypeable.h:140
emits< AString > textChanged
The user changed text and focused another view or AAbstractTextField::updateText is called.
Definition AAbstractTypeable.h:125
emits< AString > textChanging
When the user changed one or more symbols.
Definition AAbstractTypeable.h:130
virtual bool isPasswordField() const noexcept=0
virtual bool typeableInsert(size_t at, char16_t toInsert)=0
Definition ACursorSelectable.h:27
virtual const AString & getText() const =0
Represents a Unicode character string.
Definition AString.h:37
Base class for rendering.
Definition IRenderer.h:149
An std::weak_ptr with AUI extensions.
Definition SharedPtrTypes.h:178
ASignal< Args... > emits
A signal declaration.
Definition ASignal.h:348
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.
Definition ATextInputActionIcon.h:39