14#include <AUI/View/AAbstractTypeableView.h>
15#include "AUI/Enum/ATextInputType.h"
17#include "AUI/Common/ATimer.h"
18#include <AUI/Common/IStringable.h>
19#include <AUI/Render/IRenderer.h>
26class API_AUI_VIEWS AAbstractTextField :
public AAbstractTypeableView<AView>,
public IStringable {
30 ~AAbstractTextField()
override;
32 int getContentMinimumHeight()
override;
34 void setText(
const AString& t)
override;
36 void setSuffix(
const AString& s);
48 return mTextInputType;
51 void setPasswordMode(
bool isPasswordField) {
52 mIsPasswordTextField = isPasswordField;
53 setCopyable(!isPasswordField);
58 return mIsPasswordTextField;
61 bool handlesNonMouseNavigation()
override;
65 void onCharEntered(
char16_t c)
override;
67 void setSize(glm::ivec2 size)
override;
76 virtual bool isValidText(
const AString& text);
78 void prerenderStringIfNeeded(
IRenderer& render);
80 void typeableErase(
size_t begin,
size_t end)
override;
84 size_t typeableFind(
char16_t c,
size_t startPos)
override;
86 size_t typeableReverseFind(
char16_t c,
size_t startPos)
override;
88 size_t length()
const override;
92 AString getDisplayText()
override;
94 void cursorSelectableRedraw()
override;
97 glm::ivec2 getPosByIndex(
size_t index)
override;
101 void onCursorIndexChanged()
override;
102 void commitStyle()
override;
106 bool mIsPasswordTextField =
false;
107 int mTextAlignOffset = 0;
108 int mHorizontalScroll = 0;
109 unsigned mAbsoluteCursorPos = 0;
112 void invalidateFont()
override;
114 void updateTextAlignOffset();
116 int getPosByIndexAbsolute(
size_t index);
bool isPasswordField() const noexcept override
Definition AAbstractTextField.h:57
ATextInputType textInputType() const noexcept override
Definition AAbstractTextField.h:47
virtual bool typeableInsert(size_t at, const AString &toInsert)=0
virtual size_t length() const =0
virtual unsigned cursorIndexByPos(glm::ivec2 pos)=0
virtual glm::ivec2 getCursorPosition()=0
virtual const AString & getText() const =0
Represents a Unicode character string.
Definition AString.h:37
Helps mapping prerendered string with positions.
Definition ATextLayoutHelper.h:25
Base class for rendering.
Definition IRenderer.h:149
Object that can be converted to string.
Definition IStringable.h:29
virtual AString toString() const =0
An std::weak_ptr with AUI extensions.
Definition SharedPtrTypes.h:178
ATextInputType
Controls IME text input type of the text field.
Definition ATextInputType.h:24
@ DEFAULT
Optimize for textual information.
Definition ATextInputType.h:28
Render context passed to AView::render.
Definition ARenderContext.h:43