gtksourceviewmm
3.91.1
|
Compose a Buffer for printing. More...
#include <gtksourceviewmm/searchcontext.h>
Public Member Functions | |
SearchContext (SearchContext&& src) noexcept | |
SearchContext& | operator= (SearchContext&& src) noexcept |
~SearchContext () noexcept override | |
GtkSourceSearchContext* | gobj () |
Provides access to the underlying C GObject. More... | |
const GtkSourceSearchContext* | gobj () const |
Provides access to the underlying C GObject. More... | |
GtkSourceSearchContext* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More... | |
Glib::RefPtr< Buffer > | get_buffer () |
Glib::RefPtr< const Buffer > | get_buffer () const |
Glib::RefPtr< SearchSettings > | get_settings () |
Glib::RefPtr< const SearchSettings > | get_settings () const |
bool | get_highlight () const |
void | set_highlight (bool highlight=true) |
Enables or disables the search occurrences highlighting. More... | |
Glib::RefPtr< Style > | get_match_style () |
Glib::RefPtr< const Style > | get_match_style () const |
void | set_match_style (const Glib::RefPtr< Style >& match_style) |
Set the style to apply on search matches. More... | |
int | get_occurrences_count () const |
Gets the total number of search occurrences. More... | |
int | get_occurrence_position (const TextBuffer::iterator& match_start, const TextBuffer::iterator& match_end) const |
Gets the position of a search occurrence. More... | |
bool | forward (const TextBuffer::iterator& iter, TextBuffer::iterator& match_start, TextBuffer::iterator& match_end, bool& has_wrapped_around) |
Synchronous forward search. More... | |
void | forward_async (const TextBuffer::iterator& iter, const Glib::RefPtr< Gio::Cancellable >& cancellable, GAsyncReadyCallback callback, gpointer user_data) |
Asynchronous forward search. More... | |
bool | backward (const TextBuffer::iterator& iter, TextBuffer::iterator& match_start, TextBuffer::iterator& match_end, bool& has_wrapped_around) |
Synchronous backward search. More... | |
void | backward_async (const TextBuffer::iterator& iter, const Glib::RefPtr< Gio::Cancellable >& cancellable, GAsyncReadyCallback callback, gpointer user_data) |
Asynchronous backward search. More... | |
unsigned int | replace_all (const Glib::ustring&replace, int replace_length) |
Replaces all search matches by another text. More... | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Buffer > > | property_buffer () const |
The associated GtkSourceBuffer. More... | |
Glib::PropertyProxy< bool > | property_highlight () |
Highlight search occurrences. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_highlight () const |
Highlight search occurrences. More... | |
Glib::PropertyProxy< Glib::RefPtr< Style > > | property_match_style () |
The text style for matches. More... | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Style > > | property_match_style () const |
The text style for matches. More... | |
Glib::PropertyProxy_ReadOnly< int > | property_occurrences_count () const |
Total number of search occurrences. More... | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< SearchSettings > > | property_settings () const |
The associated GtkSourceSearchSettings. More... | |
![]() | |
Object (const Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&src) noexcept | |
Object & | operator= (Object &&src) noexcept |
void * | get_data (const QueryQuark &key) |
void | set_data (const Quark &key, void *data) |
void | set_data (const Quark &key, void *data, DestroyNotify notify) |
void | remove_data (const QueryQuark &quark) |
void * | steal_data (const QueryQuark &quark) |
Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false) |
![]() | |
ObjectBase (const ObjectBase &)=delete | |
ObjectBase & | operator= (const ObjectBase &)=delete |
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value) |
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const |
void | set_property (const Glib::ustring &property_name, const PropertyType &value) |
void | get_property (const Glib::ustring &property_name, PropertyType &value) const |
void | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void > &slot) |
void | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void > &&slot) |
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, const sigc::slot< void > &slot) |
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, sigc::slot< void > &&slot) |
void | freeze_notify () |
void | thaw_notify () |
virtual void | reference () const |
virtual void | unreference () const |
GObject * | gobj () |
const GObject * | gobj () const |
GObject * | gobj_copy () const |
![]() | |
trackable () noexcept | |
trackable (const trackable &src) noexcept | |
trackable (trackable &&src) | |
~trackable () | |
void | add_destroy_notify_callback (void *data, func_destroy_notify func) const |
void | notify_callbacks () |
trackable & | operator= (const trackable &src) |
trackable & | operator= (trackable &&src) |
void | remove_destroy_notify_callback (void *data) const |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
static Glib::RefPtr< SearchContext > | create (const Glib::RefPtr< Buffer >& buffer, const Glib::RefPtr< SearchSettings >& settings) |
Protected Member Functions | |
SearchContext (const Glib::RefPtr< Buffer >& buffer, const Glib::RefPtr< SearchSettings >& settings) | |
Creates a new search context, associated with buffer , and customized with settings . More... | |
![]() | |
Object () | |
Object (const Glib::ConstructParams &construct_params) | |
Object (GObject *castitem) | |
~Object () noexcept override | |
![]() | |
ObjectBase () | |
ObjectBase (const char *custom_type_name) | |
ObjectBase (const std::type_info &custom_type_info) | |
ObjectBase (ObjectBase &&src) noexcept | |
ObjectBase & | operator= (ObjectBase &&src) noexcept |
virtual | ~ObjectBase () noexcept=0 |
void | initialize (GObject *castitem) |
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper) |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Gsv::SearchContext > | wrap (GtkSourceSearchContext* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
Additional Inherited Members | |
![]() | |
typedef void(*)(gpointer data | DestroyNotify) |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
Compose a Buffer for printing.
|
noexcept |
|
overridenoexcept |
|
explicitprotected |
Creates a new search context, associated with buffer , and customized with settings .
If settings is NULL, a new GtkSourceSearchSettings object will be created, that you can retrieve with gtk_source_search_context_get_settings().
buffer | a GtkSourceBuffer. |
settings | a GtkSourceSearchSettings, or NULL. |
bool Gsv::SearchContext::backward | ( | const TextBuffer::iterator & | iter, |
TextBuffer::iterator & | match_start, | ||
TextBuffer::iterator & | match_end, | ||
bool & | has_wrapped_around | ||
) |
Synchronous backward search.
It is recommended to use the asynchronous functions instead, to not block the user interface. However, if you are sure that the buffer is small, this function is more convenient to use.
iter | start of search. |
match_start | return location for start of match, or NULL. |
match_end | return location for end of match, or NULL. |
void Gsv::SearchContext::backward_async | ( | const TextBuffer::iterator & | iter, |
const Glib::RefPtr< Gio::Cancellable > & | cancellable, | ||
GAsyncReadyCallback | callback, | ||
gpointer | user_data | ||
) |
Asynchronous backward search.
See the GAsyncResult documentation to know how to use this function. If the operation is cancelled, the callback will only be called if cancellable was not NULL. gtk_source_search_context_backward_async() takes ownership of cancellable , so you can unref it after calling this function.
iter | start of search. |
cancellable | a GCancellable, or NULL. |
callback | a GAsyncReadyCallback to call when the operation is finished. |
user_data | the data to pass to the callback function. |
|
static |
bool Gsv::SearchContext::forward | ( | const TextBuffer::iterator & | iter, |
TextBuffer::iterator & | match_start, | ||
TextBuffer::iterator & | match_end, | ||
bool & | has_wrapped_around | ||
) |
Synchronous forward search.
It is recommended to use the asynchronous functions instead, to not block the user interface. However, if you are sure that the buffer is small, this function is more convenient to use.
iter | start of search. |
match_start | return location for start of match, or NULL. |
match_end | return location for end of match, or NULL. |
void Gsv::SearchContext::forward_async | ( | const TextBuffer::iterator & | iter, |
const Glib::RefPtr< Gio::Cancellable > & | cancellable, | ||
GAsyncReadyCallback | callback, | ||
gpointer | user_data | ||
) |
Asynchronous forward search.
See the GAsyncResult documentation to know how to use this function. If the operation is cancelled, the callback will only be called if cancellable was not NULL. gtk_source_search_context_forward_async() takes ownership of cancellable, so you can unref it after calling this function.
iter | start of search. |
cancellable | a GCancellable, or NULL. |
callback | a GAsyncReadyCallback to call when the operation is finished. |
user_data | the data to pass to the callback function. |
Glib::RefPtr<Buffer> Gsv::SearchContext::get_buffer | ( | ) |
Glib::RefPtr<const Buffer> Gsv::SearchContext::get_buffer | ( | ) | const |
bool Gsv::SearchContext::get_highlight | ( | ) | const |
Glib::RefPtr<Style> Gsv::SearchContext::get_match_style | ( | ) |
Glib::RefPtr<const Style> Gsv::SearchContext::get_match_style | ( | ) | const |
int Gsv::SearchContext::get_occurrence_position | ( | const TextBuffer::iterator & | match_start, |
const TextBuffer::iterator & | match_end | ||
) | const |
Gets the position of a search occurrence.
If the buffer is not already fully scanned, the position may be unknown, and -1 is returned. If 0 is returned, it means that this part of the buffer has already been scanned, and that match_start and match_end don't delimit an occurrence.
match_start | the start of the occurrence. |
match_end | the end of the occurrence. |
int Gsv::SearchContext::get_occurrences_count | ( | ) | const |
Gets the total number of search occurrences.
If the buffer is not already fully scanned, the total number of occurrences is unknown, and -1 is returned.
Glib::RefPtr<SearchSettings> Gsv::SearchContext::get_settings | ( | ) |
Glib::RefPtr<const SearchSettings> Gsv::SearchContext::get_settings | ( | ) | const |
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GtkSourceSearchContext* Gsv::SearchContext::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
|
noexcept |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Buffer> > Gsv::SearchContext::property_buffer | ( | ) | const |
The associated GtkSourceBuffer.
Glib::PropertyProxy< bool > Gsv::SearchContext::property_highlight | ( | ) |
Highlight search occurrences.
Default value: true
Glib::PropertyProxy_ReadOnly< bool > Gsv::SearchContext::property_highlight | ( | ) | const |
Highlight search occurrences.
Default value: true
Glib::PropertyProxy< Glib::RefPtr<Style> > Gsv::SearchContext::property_match_style | ( | ) |
The text style for matches.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Style> > Gsv::SearchContext::property_match_style | ( | ) | const |
The text style for matches.
Glib::PropertyProxy_ReadOnly< int > Gsv::SearchContext::property_occurrences_count | ( | ) | const |
Total number of search occurrences.
Default value: 0
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<SearchSettings> > Gsv::SearchContext::property_settings | ( | ) | const |
The associated GtkSourceSearchSettings.
unsigned int Gsv::SearchContext::replace_all | ( | const Glib::ustring & | replace, |
int | replace_length | ||
) |
Replaces all search matches by another text.
It is a synchronous function, so it can block the user interface. For a regular expression replacement, you can check if replace is valid by calling g_regex_check_replacement(). The replace text can contain backreferences; read the g_regex_replace() documentation for more details.
replace | the replacement text. |
replace_length | the length of replace in bytes, or -1. |
void Gsv::SearchContext::set_highlight | ( | bool | highlight = true | ) |
Enables or disables the search occurrences highlighting.
highlight | the setting. |
void Gsv::SearchContext::set_match_style | ( | const Glib::RefPtr< Style >& | match_style | ) |
Set the style to apply on search matches.
If match_style is NULL, default theme's scheme 'match-style' will be used. To enable or disable the search highlighting, use gtk_source_search_context_set_highlight().
match_style | a GtkSourceStyle. |
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |