libt3widget
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules
List of all members | Classes | Public Member Functions | Public Attributes | Protected Member Functions | Friends
t3_widget::text_buffer_t Class Reference

Public Member Functions

void adjust_position (int adjust)
 
bool append_text (const char *text)
 
bool append_text (const char *text, size_t _size)
 
bool append_text (const std::string *text)
 
int apply_redo (void)
 
int apply_undo (void)
 
bool backspace_char (void)
 
bool break_line (const std::string *indent=NULL)
 
int calculate_line_pos (int line, int pos, int tabsize) const
 
int calculate_screen_pos (const text_coordinate_t *where, int tabsize) const
 
std::string * convert_block (text_coordinate_t start, text_coordinate_t end)
 
void delete_block (text_coordinate_t start, text_coordinate_t end)
 
bool delete_char (void)
 
void end_undo_block (void)
 
bool find (finder_t *finder, find_result_t *result, bool reverse=false) const
 Find a substring in the text. More...
 
bool find_limited (finder_t *finder, text_coordinate_t start, text_coordinate_t end, find_result_t *result) const
 
const text_line_tget_line_data (int idx) const
 
int get_line_max (int line) const
 
text_coordinate_t get_selection_end (void) const
 
selection_mode_t get_selection_mode (void) const
 
text_coordinate_t get_selection_start (void) const
 
void goto_next_word (void)
 
void goto_next_word_boundary (void)
 
void goto_previous_word (void)
 
void goto_previous_word_boundary (void)
 
bool indent_block (text_coordinate_t &start, text_coordinate_t &end, int tabsize, bool tab_spaces)
 
bool indent_selection (int tabsize, bool tab_spaces)
 
bool insert_block (const std::string *block)
 
bool insert_char (key_t c)
 
bool is_modified (void) const
 
bool merge (bool backspace)
 
bool overwrite_char (key_t c)
 
void paint_line (t3_window_t *win, int line, const text_line_t::paint_info_t *info)
 
void replace (finder_t *finder, find_result_t *result)
 
bool replace_block (text_coordinate_t start, text_coordinate_t end, const std::string *block)
 
bool selection_empty (void) const
 
void set_selection_end (bool update_primary=true)
 
void set_selection_from_find (find_result_t *result)
 
void set_selection_mode (selection_mode_t mode)
 
int size (void) const
 
void start_undo_block (void)
 
 T3_WIDGET_SIGNAL (rewrap_required, void, rewrap_type_t, int, int)
 
 text_buffer_t (text_line_factory_t *_line_factory=NULL)
 
bool unindent_block (text_coordinate_t &start, text_coordinate_t &end, int tabsize)
 
bool unindent_line (int tabsize)
 
bool unindent_selection (int tabsize)
 
int width_at_cursor (void) const
 

Public Attributes

text_coordinate_t cursor
 

Protected Member Functions

int apply_undo_redo (undo_type_t type, undo_t *current)
 
bool break_line_internal (const std::string *indent=NULL)
 
void delete_block_internal (text_coordinate_t start, text_coordinate_t end, undo_t *undo)
 
text_line_tget_line_data_nonconst (int idx)
 
text_line_factory_tget_line_factory (void)
 
undo_tget_undo (undo_type_t type)
 
undo_tget_undo (undo_type_t type, text_coordinate_t coord)
 
undo_tget_undo (undo_type_t type, text_coordinate_t start, text_coordinate_t end)
 
bool insert_block_internal (text_coordinate_t insert_at, text_line_t *block)
 
void locate_pos (void)
 
void locate_pos (text_coordinate_t *coord) const
 
bool merge_internal (int line)
 
virtual void prepare_paint_line (int line)
 
void set_undo_mark (void)
 
bool undo_indent_selection (undo_t *undo, undo_type_t type)
 

Friends

class wrap_info_t
 

Member Function Documentation

bool t3_widget::text_buffer_t::find ( finder_t finder,
find_result_t result,
bool  reverse = false 
) const

Find a substring in the text.

Parameters
finderThe ::finder_t used to locate the substring.
resultThe previous find result and the location in which the result will be returned.
reverseReverse the direction of the find action.

The result parameter is both an input and an output parameter. On input it should contain in its start member the location of the start of the previously found string, or cursor if no previous string was (yet) found.