gi-gtksource-3.0.15: GtkSource bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.GtkSource.Objects.SearchContext

Contents

Description

 

Synopsis

Exported types

Methods

backward

searchContextBackward Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a) 
=> a

search: a SearchContext.

-> TextIter

iter: start of search.

-> m (Bool, TextIter, TextIter)

Returns: whether a match was found.

Deprecated: (Since version 3.22)Use searchContextBackward2 instead.

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.

Since: 3.10

backward2

searchContextBackward2 Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a) 
=> a

search: a SearchContext.

-> TextIter

iter: start of search.

-> m (Bool, TextIter, TextIter, Bool)

Returns: whether a match was found.

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.

The difference with searchContextBackward is that the hasWrappedAround out parameter has been added for convenience.

If the SearchSettings:wrap-around property is False, this function doesn't try to wrap around.

The hasWrappedAround out parameter is set independently of whether a match is found. So if this function returns False, hasWrappedAround will have the same value as the SearchSettings:wrap-around property.

Since: 3.22

backwardAsync

searchContextBackwardAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a, IsCancellable b) 
=> a

search: a SearchContext.

-> TextIter

iter: start of search.

-> Maybe b

cancellable: a Cancellable, or Nothing.

-> Maybe AsyncReadyCallback

callback: a AsyncReadyCallback to call when the operation is finished.

-> m () 

The asynchronous version of searchContextBackward2.

See the documentation of searchContextBackward2 for more details.

See the AsyncResult documentation to know how to use this function.

If the operation is cancelled, the callback will only be called if cancellable was not Nothing. searchContextBackwardAsync takes ownership of cancellable, so you can unref it after calling this function.

Since: 3.10

backwardFinish

searchContextBackwardFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a, IsAsyncResult b) 
=> a

search: a SearchContext.

-> b

result: a AsyncResult.

-> m (TextIter, TextIter)

(Can throw GError)

Deprecated: (Since version 3.22)Use searchContextBackwardFinish2 instead.

Finishes a backward search started with searchContextBackwardAsync.

Since: 3.10

backwardFinish2

searchContextBackwardFinish2 Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a, IsAsyncResult b) 
=> a

search: a SearchContext.

-> b

result: a AsyncResult.

-> m (TextIter, TextIter, Bool)

(Can throw GError)

Finishes a backward search started with searchContextBackwardAsync.

See the documentation of searchContextBackward2 for more details.

Since: 3.22

forward

searchContextForward Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a) 
=> a

search: a SearchContext.

-> TextIter

iter: start of search.

-> m (Bool, TextIter, TextIter)

Returns: whether a match was found.

Deprecated: (Since version 3.22)Use searchContextForward2 instead.

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.

Since: 3.10

forward2

searchContextForward2 Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a) 
=> a

search: a SearchContext.

-> TextIter

iter: start of search.

-> m (Bool, TextIter, TextIter, Bool)

Returns: whether a match was found.

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.

The difference with searchContextForward is that the hasWrappedAround out parameter has been added for convenience.

If the SearchSettings:wrap-around property is False, this function doesn't try to wrap around.

The hasWrappedAround out parameter is set independently of whether a match is found. So if this function returns False, hasWrappedAround will have the same value as the SearchSettings:wrap-around property.

Since: 3.22

forwardAsync

searchContextForwardAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a, IsCancellable b) 
=> a

search: a SearchContext.

-> TextIter

iter: start of search.

-> Maybe b

cancellable: a Cancellable, or Nothing.

-> Maybe AsyncReadyCallback

callback: a AsyncReadyCallback to call when the operation is finished.

-> m () 

The asynchronous version of searchContextForward2.

See the documentation of searchContextForward2 for more details.

See the AsyncResult documentation to know how to use this function.

If the operation is cancelled, the callback will only be called if cancellable was not Nothing. searchContextForwardAsync takes ownership of cancellable, so you can unref it after calling this function.

Since: 3.10

forwardFinish

searchContextForwardFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a, IsAsyncResult b) 
=> a

search: a SearchContext.

-> b

result: a AsyncResult.

-> m (TextIter, TextIter)

(Can throw GError)

Deprecated: (Since version 3.22)Use searchContextForwardFinish2 instead.

Finishes a forward search started with searchContextForwardAsync.

Since: 3.10

forwardFinish2

searchContextForwardFinish2 Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a, IsAsyncResult b) 
=> a

search: a SearchContext.

-> b

result: a AsyncResult.

-> m (TextIter, TextIter, Bool)

(Can throw GError)

Finishes a forward search started with searchContextForwardAsync.

See the documentation of searchContextForward2 for more details.

Since: 3.22

getBuffer

searchContextGetBuffer Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a) 
=> a

search: a SearchContext.

-> m Buffer

Returns: the associated buffer.

No description available in the introspection data.

Since: 3.10

getHighlight

searchContextGetHighlight Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a) 
=> a

search: a SearchContext.

-> m Bool

Returns: whether to highlight the search occurrences.

No description available in the introspection data.

Since: 3.10

getMatchStyle

searchContextGetMatchStyle Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a) 
=> a

search: a SearchContext.

-> m Style

Returns: the Style to apply on search matches.

No description available in the introspection data.

Since: 3.16

getOccurrencePosition

searchContextGetOccurrencePosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a) 
=> a

search: a SearchContext.

-> TextIter

matchStart: the start of the occurrence.

-> TextIter

matchEnd: the end of the occurrence.

-> m Int32

Returns: the position of the search occurrence. The first occurrence has the position 1 (not 0). Returns 0 if matchStart and matchEnd don't delimit an occurrence. Returns -1 if the position is not yet known.

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 matchStart and matchEnd don't delimit an occurrence.

Since: 3.10

getOccurrencesCount

searchContextGetOccurrencesCount Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a) 
=> a

search: a SearchContext.

-> m Int32

Returns: the total number of search occurrences, or -1 if unknown.

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.

Since: 3.10

getRegexError

searchContextGetRegexError Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a) 
=> a

search: a SearchContext.

-> m (Maybe GError)

Returns: the GError, or Nothing if the pattern is valid.

Regular expression patterns must follow certain rules. If SearchSettings:search-text breaks a rule, the error can be retrieved with this function. The error domain is G_REGEX_ERROR.

Free the return value with errorFree.

Since: 3.10

getSettings

searchContextGetSettings Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a) 
=> a

search: a SearchContext.

-> m SearchSettings

Returns: the search settings.

No description available in the introspection data.

Since: 3.10

new

searchContextNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsBuffer a, IsSearchSettings b) 
=> a

buffer: a Buffer.

-> Maybe b

settings: a SearchSettings, or Nothing.

-> m SearchContext

Returns: a new search context.

Creates a new search context, associated with buffer, and customized with settings. If settings is Nothing, a new SearchSettings object will be created, that you can retrieve with searchContextGetSettings.

Since: 3.10

replace

searchContextReplace Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a) 
=> a

search: a SearchContext.

-> TextIter

matchStart: the start of the match to replace.

-> TextIter

matchEnd: the end of the match to replace.

-> Text

replace: the replacement text.

-> Int32

replaceLength: the length of replace in bytes, or -1.

-> m ()

(Can throw GError)

Deprecated: (Since version 3.22)Use searchContextReplace2 instead.

Replaces a search match by another text. If matchStart and matchEnd doesn't correspond to a search match, False is returned.

For a regular expression replacement, you can check if replace is valid by calling regexCheckReplacement. The replace text can contain backreferences; read the regexReplace documentation for more details.

Since: 3.10

replace2

searchContextReplace2 Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a) 
=> a

search: a SearchContext.

-> TextIter

matchStart: the start of the match to replace.

-> TextIter

matchEnd: the end of the match to replace.

-> Text

replace: the replacement text.

-> Int32

replaceLength: the length of replace in bytes, or -1.

-> m ()

(Can throw GError)

Replaces a search match by another text. If matchStart and matchEnd doesn't correspond to a search match, False is returned.

Unlike with searchContextReplace, the matchStart and matchEnd iters are revalidated to point to the replacement text boundaries.

For a regular expression replacement, you can check if replace is valid by calling regexCheckReplacement. The replace text can contain backreferences; read the regexReplace documentation for more details.

Since: 3.22

replaceAll

searchContextReplaceAll Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a) 
=> a

search: a SearchContext.

-> Text

replace: the replacement text.

-> Int32

replaceLength: the length of replace in bytes, or -1.

-> m Word32

Returns: the number of replaced matches. (Can throw GError)

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 regexCheckReplacement. The replace text can contain backreferences; read the regexReplace documentation for more details.

Since: 3.10

setHighlight

searchContextSetHighlight Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a) 
=> a

search: a SearchContext.

-> Bool

highlight: the setting.

-> m () 

Enables or disables the search occurrences highlighting.

Since: 3.10

setMatchStyle

searchContextSetMatchStyle Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a, IsStyle b) 
=> a

search: a SearchContext.

-> Maybe b

matchStyle: a Style, or Nothing.

-> m () 

Set the style to apply on search matches. If matchStyle is Nothing, default theme's scheme 'match-style' will be used. To enable or disable the search highlighting, use searchContextSetHighlight.

Since: 3.16

setSettings

searchContextSetSettings Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchContext a, IsSearchSettings b) 
=> a

search: a SearchContext.

-> Maybe b

settings: the new SearchSettings, or Nothing.

-> m () 

Deprecated: (Since version 3.24)The SearchContext:settings property will become aconstruct-only property in a future version. Create a newSearchContext instead, or change the SearchSettingsproperties. When the SearchContext:settings property will becomeconstruct-only, it will be possible to simplify some code that needed tolisten to the notify::settings signal.

Associate a SearchSettings with the search context. If settings is Nothing, a new one will be created.

The search context holds a reference to settings.

Since: 3.10

Properties

buffer

highlight

matchStyle

occurrencesCount

regexError

settings