RADLib
RADical C++ application framework
RADUi::TextInputModel Class Reference

Single-line text input state model. More...

#include <RADWidgets.h>

+ Inheritance diagram for RADUi::TextInputModel:
+ Collaboration diagram for RADUi::TextInputModel:

Public Member Functions

const std::string & text () const
 Returns input text. More...
 
void setText (std::string text)
 Updates input text. More...
 
const std::string & placeholder () const
 Returns placeholder text. More...
 
void setPlaceholder (std::string placeholder)
 Updates placeholder text. More...
 
bool isReadOnly () const
 Returns true when user editing should be disabled. More...
 
void setReadOnly (bool readOnly)
 Sets read-only state. More...
 
- Public Member Functions inherited from RADCore::RADObject
 RADObject ()
 Creates a RADObject bound to the current thread. More...
 
virtual ~RADObject ()
 Disconnects tracked event links and releases lifetime token. More...
 
void registerLink (const ConnectionRecord &record)
 Registers a connection for cleanup when this object is destroyed. More...
 
std::thread::id threadId () const
 Returns the thread id this object is currently associated with. More...
 
EventLoopassociatedEventLoop () const
 Returns the associated event loop, if any. More...
 
ThreadAffinity threadAffinity () const
 Returns both thread id and associated loop atomically. More...
 
std::weak_ptr< void > lifetimeToken () const
 Returns a weak token used to drop queued callbacks after destruction. More...
 
void moveToThread (std::thread::id tId, EventLoop *loop=nullptr)
 Moves the object's affinity to tId and optional loop. More...
 

Public Attributes

RADCore::Event< void() > changed
 Raised when text, placeholder, or read-only state changes. More...
 

Detailed Description

Single-line text input state model.

Member Function Documentation

◆ isReadOnly()

bool RADUi::TextInputModel::isReadOnly ( ) const

Returns true when user editing should be disabled.

◆ placeholder()

const std::string& RADUi::TextInputModel::placeholder ( ) const

Returns placeholder text.

◆ setPlaceholder()

void RADUi::TextInputModel::setPlaceholder ( std::string  placeholder)

Updates placeholder text.

◆ setReadOnly()

void RADUi::TextInputModel::setReadOnly ( bool  readOnly)

Sets read-only state.

◆ setText()

void RADUi::TextInputModel::setText ( std::string  text)

Updates input text.

◆ text()

const std::string& RADUi::TextInputModel::text ( ) const

Returns input text.

Member Data Documentation

◆ changed

RADCore::Event<void () > RADUi::TextInputModel::changed

Raised when text, placeholder, or read-only state changes.


The documentation for this class was generated from the following file: