76 virtual void SetSize(
float width,
float height) = 0;
83 virtual void GetSize(
float &width,
float &height)
const = 0;
145 [[nodiscard]]
virtual const std::string &
GetText()
const = 0;
151 virtual void SetText(
const std::string &text) = 0;
Abstract interface for UI text input fields.
virtual void SetFocused(bool focused)=0
Set focus state programmatically.
virtual void SetEnabled(bool enabled)=0
Enable or disable the text input.
virtual const std::string & GetText() const =0
Get the current text content.
virtual void Update()=0
Update the text input internal state (focus, cursor, input).
virtual ~ITextInput()=default
Virtual destructor.
virtual void SetAlign(Align align)=0
Set alignment mode relative to the window.
virtual void SetValidationRegex(const std::string ®exPattern)=0
Set a regex pattern to restrict allowed characters.
virtual bool IsEnabled() const =0
Check if the text input is enabled.
virtual bool IsPasswordMode() const =0
Check if password mode is enabled.
virtual bool IsFocused() const =0
Check if the text input is currently focused/active.
virtual void SetSize(float width, float height)=0
Set the text input size.
virtual void SetTextColor(unsigned int color)=0
Set the text color.
virtual void SetTextSize(int size)=0
Set the text size in pixels.
virtual void SetActiveBorderColor(unsigned int color)=0
Set the border color when the input is focused/active.
virtual void SetOnTextChanged(std::function< void(const std::string &)> callback)=0
Set callback invoked when text changes.
virtual void SetPosition(float x, float y)=0
Set the top-left position of the text input.
virtual void SetBackgroundColor(unsigned int color)=0
Set the background color of the text input box.
virtual void GetSize(float &width, float &height) const =0
Get the current size of the text input.
virtual void SetMaxLength(size_t maxLength)=0
Set the maximum number of characters allowed.
virtual void SetPlaceholder(const std::string &placeholder)=0
Set the placeholder text displayed when the input is empty.
virtual void Render()=0
Render the text input box.
virtual void GetPosition(float &x, float &y) const =0
Get the current top-left position of the text input.
virtual Align GetAlign() const =0
Get the current alignment mode.
virtual void SetText(const std::string &text)=0
Set the text content programmatically.
virtual void SetPasswordMode(bool passwordMode)=0
Enable or disable password mode (masks characters with asterisks).
virtual void ApplyAlignment()=0
Apply the current alignment mode to the position.
virtual void SetBorderColor(unsigned int color)=0
Set the border color when the input is not focused.
virtual void SetPlaceholderColor(unsigned int color)=0
Set the placeholder text color (when input is empty).
virtual void Clear()=0
Clear the text content.
virtual void SetFont(int fontHandle)=0
Set the font handle for rendering text.
Align
Alignment modes relative to the current window.