GtkSourceSearchSettings: GtkSourceView 3 Reference Manual

## GtkSourceSearchSettings GtkSourceSearchSettings — Search settings |

## Functions

GtkSourceSearchSettings * | gtk_source_search_settings_new ()
const gchar * | gtk_source_search_settings_get_search_text ()
void | gtk_source_search_settings_set_search_text ()
gboolean | gtk_source_search_settings_get_case_sensitive ()
void | gtk_source_search_settings_set_case_sensitive ()
gboolean | gtk_source_search_settings_get_at_word_boundaries ()
void | gtk_source_search_settings_set_at_word_boundaries ()
gboolean | gtk_source_search_settings_get_wrap_around ()
void | gtk_source_search_settings_set_wrap_around ()
gboolean | gtk_source_search_settings_get_regex_enabled ()
void | gtk_source_search_settings_set_regex_enabled ()

## Types and Values

| GtkSourceSearchSettings

## Includes

    #include <gtksourceview/gtksource.h>

## Description

A GtkSourceSearchSettings object represents the settings of a search. The search settings can be associated with one or several GtkSourceSearchContexts.

## Functions

### gtk_source_search_settings_new ()

    GtkSourceSearchSettings *
    gtk_source_search_settings_new (void);

Creates a new search settings object.

#### Returns

a new search settings object.

Since: 3.10

### gtk_source_search_settings_get_search_text ()

    const gchar *
    gtk_source_search_settings_get_search_text
                                   (GtkSourceSearchSettings *settings);

Gets the text to search. The return value must not be freed.

You may be interested to call `gtk_source_utils_escape_search_text()` after this function.

#### Parameters

settings | a GtkSourceSearchSettings. |

#### Returns

the text to search, or `NULL` if the search is disabled.

[nullable]

Since: 3.10

### gtk_source_search_settings_set_search_text ()

    void
    gtk_source_search_settings_set_search_text
                                   (GtkSourceSearchSettings *settings,
                                    const gchar *search_text);

Sets the text to search. If `text` is `NULL` or is empty, the search will be disabled. A copy of `text` will be made, so you can safely free `text` after a call to this function.

You may be interested to call `gtk_source_utils_unescape_search_text()` before this function.

#### Parameters

settings | a GtkSourceSearchSettings. |
search_text | the nul-terminated text to search, or `NULL` to disable the search. | [allow-none]

Since: 3.10

### gtk_source_search_settings_get_case_sensitive ()

    gboolean
    gtk_source_search_settings_get_case_sensitive
                                   (GtkSourceSearchSettings *settings);

#### Parameters

settings | a GtkSourceSearchSettings. |

#### Returns

whether the search is case sensitive.

Since: 3.10

### gtk_source_search_settings_set_case_sensitive ()

    void
    gtk_source_search_settings_set_case_sensitive
                                   (GtkSourceSearchSettings *settings,
                                    gboolean case_sensitive);

Enables or disables the case sensitivity for the search.

#### Parameters

settings | a GtkSourceSearchSettings. |
case_sensitive | the setting. |

Since: 3.10

### gtk_source_search_settings_get_at_word_boundaries ()

    gboolean
    gtk_source_search_settings_get_at_word_boundaries
                                   (GtkSourceSearchSettings *settings);

#### Parameters

settings | a GtkSourceSearchSettings. |

#### Returns

whether to search at word boundaries.

Since: 3.10

### gtk_source_search_settings_set_at_word_boundaries ()

    void
    gtk_source_search_settings_set_at_word_boundaries
                                   (GtkSourceSearchSettings *settings,
                                    gboolean at_word_boundaries);

Change whether the search is done at word boundaries. If `at_word_boundaries` is `TRUE`, a search match must start and end a word. The match can span multiple words. See also `gtk_text_iter_starts_word()` and `gtk_text_iter_ends_word()`.

#### Parameters

settings | a GtkSourceSearchSettings. |
at_word_boundaries | the setting. |

Since: 3.10

### gtk_source_search_settings_get_wrap_around ()

    gboolean
    gtk_source_search_settings_get_wrap_around
                                   (GtkSourceSearchSettings *settings);

#### Parameters

settings | a GtkSourceSearchSettings. |

#### Returns

whether to wrap around the search.

Since: 3.10

### gtk_source_search_settings_set_wrap_around ()

    void
    gtk_source_search_settings_set_wrap_around
                                   (GtkSourceSearchSettings *settings,
                                    gboolean wrap_around);

Enables or disables the wrap around search. If `wrap_around` is `TRUE`, the forward search continues at the beginning of the buffer if no search occurrences are found. Similarly, the backward search continues to search at the end of the buffer.

#### Parameters

settings | a GtkSourceSearchSettings. |
wrap_around | the setting. |

Since: 3.10

### gtk_source_search_settings_get_regex_enabled ()

    gboolean
    gtk_source_search_settings_get_regex_enabled
                                   (GtkSourceSearchSettings *settings);

#### Parameters

settings | a GtkSourceSearchSettings. |

#### Returns

whether to search by regular expressions.

Since: 3.10

### gtk_source_search_settings_set_regex_enabled ()

    void
    gtk_source_search_settings_set_regex_enabled
                                   (GtkSourceSearchSettings *settings,
                                    gboolean regex_enabled);

Enables or disables whether to search by regular expressions. If enabled, the “search-text” property contains the pattern of the regular expression.

#### Parameters

settings | a GtkSourceSearchSettings. |
regex_enabled | the setting. |

Since: 3.10

## Types and Values

### GtkSourceSearchSettings

    typedef struct {
    	GObject parent;

    	GtkSourceSearchSettingsPrivate *priv;
    } GtkSourceSearchSettings;

## See Also

GtkSourceSearchContext