SourceSearchContext
Object Hierarchy:
Description:
[ CCode ( type_id = "gtk_source_search_context_get_type ()" ) ]
[ GIR ( name = "SearchContext" ) ]
public class SourceSearchContext : Object
[ GIR ( name = "SearchContext" ) ]
public class SourceSearchContext : Object
Namespace: Gtk
Package: gtksourceview-4
Content:
Properties:
- public SourceBuffer buffer { get; construct; }
The SourceBuffer associated to the search context.
- public bool highlight { get; set construct; }
Highlight the search occurrences.
- public SourceStyle match_style { get; set construct; }
A SourceStyle , or null for theme's scheme default style.
- public int occurrences_count { get; }
The total number of search occurrences.
- public Error? regex_error { owned get; }
If the regex search pattern doesn't follow all the rules, this Error property will be set.
- public SourceSearchSettings settings { get; construct; }
The SourceSearchSettings associated to the search context.
Creation methods:
- public SourceSearchContext (SourceBuffer buffer, SourceSearchSettings? settings)
Creates a new search context, associated with
buffer
, and customized withsettings
.
Methods:
- public bool backward (TextIter iter, out TextIter match_start, out TextIter match_end, out bool has_wrapped_around)
Synchronous backward search.
- public async bool backward_async (TextIter iter, Cancellable? cancellable, out TextIter match_start, out TextIter match_end, out bool has_wrapped_around) throws Error
The asynchronous version of backward.
- public bool forward (TextIter iter, out TextIter match_start, out TextIter match_end, out bool has_wrapped_around)
Synchronous forward search.
- public async bool forward_async (TextIter iter, Cancellable? cancellable, out TextIter match_start, out TextIter match_end, out bool has_wrapped_around) throws Error
The asynchronous version of forward.
- public unowned SourceBuffer get_buffer ()
- public bool get_highlight ()
- public unowned SourceStyle get_match_style ()
- public int get_occurrence_position (TextIter match_start, TextIter match_end)
Gets the position of a search occurrence.
- public int get_occurrences_count ()
Gets the total number of search occurrences.
- public Error? get_regex_error ()
Regular expression patterns must follow certain rules.
- public unowned SourceSearchSettings get_settings ()
- public bool replace (TextIter match_start, TextIter match_end, string replace, int replace_length) throws Error
Replaces a search match by another text.
- public uint replace_all (string replace, int replace_length) throws Error
Replaces all search matches by another text.
- public void set_highlight (bool highlight)
Enables or disables the search occurrences highlighting.
- public void set_match_style (SourceStyle? match_style)
Set the style to apply on search matches.
Inherited Members:
All known members inherited from class GLib.Object