HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions
tt::editable_text Class Reference

Public Member Functions

 editable_text (tt::font_book const &font_book, text_style style)
 
 operator std::string () const noexcept
 
editable_textoperator= (std::string_view str) noexcept
 
void update_shaped_text () noexcept
 Update the shaped _text after changed to _text.
 
shaped_text shaped_text () const noexcept
 
void set_width (float width) noexcept
 
void set_current_style (text_style style) noexcept
 
void set_style_of_all (text_style style) noexcept
 Change the text style of all graphemes.
 
size_t size () const noexcept
 
decltype(auto) it (ssize_t index) noexcept
 Return the _text iterator at index.
 
decltype(auto) cit (ssize_t index) const noexcept
 Return the _text iterator at index.
 
decltype(auto) it (ssize_t index) const noexcept
 
aarectangle partial_grapheme_caret () const noexcept
 Get carets at the cursor position.
 
aarectangle left_to_right_caret () const noexcept
 Get carets at the cursor position.
 
std::vector< aarectangleselection_rectangles () const noexcept
 Get a set of rectangles for which _text is selected.
 
void delete_selection () noexcept
 Delete a selection.
 
ssize_t character_index_at_position (point2 position) const noexcept
 
void set_cursor_at_coordinate (point2 coordinate) noexcept
 
void select_word_at_coordinate (point2 coordinate) noexcept
 
void select_paragraph_at_coordinate (point2 coordinate) noexcept
 
void drag_cursor_at_coordinate (point2 coordinate) noexcept
 
void drag_word_at_coordinate (point2 coordinate) noexcept
 
void drag_paragraph_at_coordinate (point2 coordinate) noexcept
 
void cancel_partial_grapheme () noexcept
 
void insert_partial_grapheme (grapheme character) noexcept
 
void insert_grapheme (grapheme character) noexcept
 
void handle_paste (std::string str) noexcept
 
std::string handle_copy () noexcept
 
std::string handle_cut () noexcept
 
bool handle_event (command command) noexcept
 
bool is_valid () const noexcept
 

Member Function Documentation

◆ character_index_at_position()

ssize_t tt::editable_text::character_index_at_position ( point2 position) const
noexcept

Find the nearest character at position and return it's index.

◆ cit()

decltype(auto) tt::editable_text::cit ( ssize_t index) const
inlinenoexcept

Return the _text iterator at index.

◆ delete_selection()

void tt::editable_text::delete_selection ( )
inlinenoexcept

Delete a selection.

This function should be called when a selection is active while new _text is being inserted.

◆ insert_grapheme()

void tt::editable_text::insert_grapheme ( grapheme character)
inlinenoexcept

insert character at the cursor position. Selected _text will be deleted.

◆ insert_partial_grapheme()

void tt::editable_text::insert_partial_grapheme ( grapheme character)
inlinenoexcept

Insert a temporary partial character. This partial character is currently being constructed by the operating system.

Since the insertion has not been completed any selected _text should not yet be deleted.

◆ it()

decltype(auto) tt::editable_text::it ( ssize_t index)
inlinenoexcept

Return the _text iterator at index.

◆ left_to_right_caret()

aarectangle tt::editable_text::left_to_right_caret ( ) const
inlinenoexcept

Get carets at the cursor position.

◆ partial_grapheme_caret()

aarectangle tt::editable_text::partial_grapheme_caret ( ) const
inlinenoexcept

Get carets at the cursor position.

◆ selection_rectangles()

std::vector< aarectangle > tt::editable_text::selection_rectangles ( ) const
inlinenoexcept

Get a set of rectangles for which _text is selected.

◆ set_style_of_all()

void tt::editable_text::set_style_of_all ( text_style style)
inlinenoexcept

Change the text style of all graphemes.

◆ update_shaped_text()

void tt::editable_text::update_shaped_text ( )
inlinenoexcept

Update the shaped _text after changed to _text.


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