AUI Framework  master
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
AAbstractTypeableView< Super > Class Template Reference

Basic implementation of type shortcuts and selection for editable text fields. More...

#include <AUI/View/AAbstractTypeableView.h>

Public Member Functions#

auto text () const
 Text property.
 
void onKeyDown (AInput::Key key) override
 
void onKeyRepeat (AInput::Key key) override
 
void onFocusLost () override
 
void onPointerPressed (const APointerPressedEvent &event) override
 
void onPointerDoubleClicked (const APointerPressedEvent &event) override
 
void onPointerMove (glm::vec2 pos, const APointerMoveEvent &event) override
 
void onPointerReleased (const APointerReleasedEvent &event) override
 
bool wantsTouchscreenKeyboard () override
 
bool handlesNonMouseNavigation () override
 
void onFocusAcquired () override
 
void invalidateAllStyles () override
 
bool isLButtonPressed () override
 
void drawCursor (IRenderer &renderer, glm::ivec2 position)
 
- Public Member Functions inherited from AAbstractTypeable
void clear ()
 
void setMaxTextLength (size_t newTextLength)
 
void trimText ()
 
void setCopyable (bool isCopyable)
 
virtual void setText (const AString &t)
 
virtual bool isPasswordField () const noexcept=0
 
virtual ATextInputType textInputType () const noexcept=0
 
void setTextInputActionIcon (ATextInputActionIcon textInputActionIcon) noexcept
 
ATextInputActionIcon textInputActionIcon () const noexcept
 
void copyToClipboard () const
 Performs copy operation (CTRL+C) to system clipboard.
 
void cutToClipboard ()
 Performs cut operation (CTRL+X) to system clipboard.
 
void pasteFromClipboard ()
 Performs paste operation (CTRL+V) from system clipboard.
 
void paste (AString content)
 Performs paste operation (CTRL+V).
 
void moveCursorLeft ()
 Performs move left operation (like AInput::LEFT)
 
void moveCursorRight ()
 Performs move right operation (like AInput::RIGHT)
 
- Public Member Functions inherited from ACursorSelectable
virtual const AStringgetText () const =0
 
virtual size_t length () const =0
 
AString selectedText () const
 
Selection selection () const
 
bool hasSelection () const
 
virtual unsigned cursorIndexByPos (glm::ivec2 pos)=0
 
virtual glm::ivec2 getPosByIndex (size_t index)=0
 
virtual glm::ivec2 getCursorPosition ()=0
 
void selectAll ()
 Select whole text in the text field.
 
void clearSelection ()
 Remove selection from the text field.
 
void setSelection (int cursorIndex)
 
void setSelection (Selection selection)
 

Protected Member Functions#

AMenuModel composeContextMenu () override
 
void commitStyle () override
 
int getVerticalAlignmentOffset () noexcept
 
void cursorSelectableRedraw () override
 
void onSelectionChanged () override
 
- Protected Member Functions inherited from AAbstractTypeable
bool isCursorBlinkVisible () const
 
void updateCursorBlinking ()
 
virtual void typeableErase (size_t begin, size_t end)=0
 
virtual bool typeableInsert (size_t at, const AString &toInsert)=0
 
virtual bool typeableInsert (size_t at, char16_t toInsert)=0
 
virtual size_t typeableFind (char16_t c, size_t startPos=-1)=0
 
virtual size_t typeableReverseFind (char16_t c, size_t startPos=-1)=0
 
virtual void updateSelectionOnTextSet (const AString &t)
 
virtual void onCursorIndexChanged ()=0
 
void enterChar (char16_t c)
 
AString getDisplayText () override
 
AMenuModel composeContextMenuImpl ()
 
void handleKey (AInput::Key key)
 
- Protected Member Functions inherited from ACursorSelectable
void handleMouseDoubleClicked (const APointerPressedEvent &event)
 
void handleMousePressed (const APointerPressedEvent &event)
 
void handleMouseReleased (const APointerReleasedEvent &event)
 
void handleMouseMove (const glm::ivec2 &pos)
 
template<aui::invocable Callback>
void drawSelectionBeforeAndAfter (IRenderer &render, std::span< ARect< int > > rects, Callback &&drawText)
 

Additional Inherited Members#

- Signals and public fields inherited from AAbstractTypeable
emits< AStringtextChanged
 The user changed text and focused another view or AAbstractTextField::updateText is called.
 
emits< AStringtextChanging
 When the user changed one or more symbols.
 
emits< SelectionselectionChanged
 Selection is changed due to user's action or code operation.
 
emits actionButtonPressed
 When action button of touchscreen keyboard or AInput::RETURN is pressed.
 
- Protected Attributes inherited from AAbstractTypeable
size_t mMaxTextLength = 0x200
 
bool mIsMultiline = false
 
- Protected Attributes inherited from ACursorSelectable
unsigned mCursorIndex = 0
 
AOptional< unsigned > mCursorSelection
 

Detailed Description#

template<aui::derived_from< AView > Super>
class AAbstractTypeableView< Super >

Used as base in ATextArea and ATextField, both of them using own way of text handling and rendering.

Member Function Documentation#

◆ cursorSelectableRedraw()#

template<aui::derived_from< AView > Super>
void AAbstractTypeableView< Super >::cursorSelectableRedraw ( )
inlineoverrideprotectedvirtual

Implements ACursorSelectable.

◆ isLButtonPressed()#

template<aui::derived_from< AView > Super>
bool AAbstractTypeableView< Super >::isLButtonPressed ( )
inlineoverridevirtual

Implements ACursorSelectable.

◆ onSelectionChanged()#

template<aui::derived_from< AView > Super>
void AAbstractTypeableView< Super >::onSelectionChanged ( )
inlineoverrideprotectedvirtual

Implements ACursorSelectable.