| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.GtkSource.Objects.SearchContext
Contents
Description
No description available in the introspection data.
Synopsis
- newtype SearchContext = SearchContext (ManagedPtr SearchContext)
- class GObject o => IsSearchContext o
- toSearchContext :: (MonadIO m, IsSearchContext o) => o -> m SearchContext
- noSearchContext :: Maybe SearchContext
- searchContextBackward :: (HasCallStack, MonadIO m, IsSearchContext a) => a -> TextIter -> m (Bool, TextIter, TextIter)
- searchContextBackward2 :: (HasCallStack, MonadIO m, IsSearchContext a) => a -> TextIter -> m (Bool, TextIter, TextIter, Bool)
- searchContextBackwardAsync :: (HasCallStack, MonadIO m, IsSearchContext a, IsCancellable b) => a -> TextIter -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- searchContextBackwardFinish :: (HasCallStack, MonadIO m, IsSearchContext a, IsAsyncResult b) => a -> b -> m (TextIter, TextIter)
- searchContextBackwardFinish2 :: (HasCallStack, MonadIO m, IsSearchContext a, IsAsyncResult b) => a -> b -> m (TextIter, TextIter, Bool)
- searchContextForward :: (HasCallStack, MonadIO m, IsSearchContext a) => a -> TextIter -> m (Bool, TextIter, TextIter)
- searchContextForward2 :: (HasCallStack, MonadIO m, IsSearchContext a) => a -> TextIter -> m (Bool, TextIter, TextIter, Bool)
- searchContextForwardAsync :: (HasCallStack, MonadIO m, IsSearchContext a, IsCancellable b) => a -> TextIter -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- searchContextForwardFinish :: (HasCallStack, MonadIO m, IsSearchContext a, IsAsyncResult b) => a -> b -> m (TextIter, TextIter)
- searchContextForwardFinish2 :: (HasCallStack, MonadIO m, IsSearchContext a, IsAsyncResult b) => a -> b -> m (TextIter, TextIter, Bool)
- searchContextGetBuffer :: (HasCallStack, MonadIO m, IsSearchContext a) => a -> m Buffer
- searchContextGetHighlight :: (HasCallStack, MonadIO m, IsSearchContext a) => a -> m Bool
- searchContextGetMatchStyle :: (HasCallStack, MonadIO m, IsSearchContext a) => a -> m Style
- searchContextGetOccurrencePosition :: (HasCallStack, MonadIO m, IsSearchContext a) => a -> TextIter -> TextIter -> m Int32
- searchContextGetOccurrencesCount :: (HasCallStack, MonadIO m, IsSearchContext a) => a -> m Int32
- searchContextGetRegexError :: (HasCallStack, MonadIO m, IsSearchContext a) => a -> m (Maybe GError)
- searchContextGetSettings :: (HasCallStack, MonadIO m, IsSearchContext a) => a -> m SearchSettings
- searchContextNew :: (HasCallStack, MonadIO m, IsBuffer a, IsSearchSettings b) => a -> Maybe b -> m SearchContext
- searchContextReplace :: (HasCallStack, MonadIO m, IsSearchContext a) => a -> TextIter -> TextIter -> Text -> Int32 -> m ()
- searchContextReplace2 :: (HasCallStack, MonadIO m, IsSearchContext a) => a -> TextIter -> TextIter -> Text -> Int32 -> m ()
- searchContextReplaceAll :: (HasCallStack, MonadIO m, IsSearchContext a) => a -> Text -> Int32 -> m Word32
- searchContextSetHighlight :: (HasCallStack, MonadIO m, IsSearchContext a) => a -> Bool -> m ()
- searchContextSetMatchStyle :: (HasCallStack, MonadIO m, IsSearchContext a, IsStyle b) => a -> Maybe b -> m ()
- searchContextSetSettings :: (HasCallStack, MonadIO m, IsSearchContext a, IsSearchSettings b) => a -> Maybe b -> m ()
- constructSearchContextBuffer :: (IsSearchContext o, IsBuffer a) => a -> IO (GValueConstruct o)
- getSearchContextBuffer :: (MonadIO m, IsSearchContext o) => o -> m Buffer
- constructSearchContextHighlight :: IsSearchContext o => Bool -> IO (GValueConstruct o)
- getSearchContextHighlight :: (MonadIO m, IsSearchContext o) => o -> m Bool
- setSearchContextHighlight :: (MonadIO m, IsSearchContext o) => o -> Bool -> m ()
- clearSearchContextMatchStyle :: (MonadIO m, IsSearchContext o) => o -> m ()
- constructSearchContextMatchStyle :: (IsSearchContext o, IsStyle a) => a -> IO (GValueConstruct o)
- getSearchContextMatchStyle :: (MonadIO m, IsSearchContext o) => o -> m Style
- setSearchContextMatchStyle :: (MonadIO m, IsSearchContext o, IsStyle a) => o -> a -> m ()
- getSearchContextOccurrencesCount :: (MonadIO m, IsSearchContext o) => o -> m Int32
- getSearchContextRegexError :: (MonadIO m, IsSearchContext o) => o -> m (Ptr ())
- clearSearchContextSettings :: (MonadIO m, IsSearchContext o) => o -> m ()
- constructSearchContextSettings :: (IsSearchContext o, IsSearchSettings a) => a -> IO (GValueConstruct o)
- getSearchContextSettings :: (MonadIO m, IsSearchContext o) => o -> m SearchSettings
- setSearchContextSettings :: (MonadIO m, IsSearchContext o, IsSearchSettings a) => o -> a -> m ()
Exported types
newtype SearchContext Source #
Memory-managed wrapper type.
Constructors
| SearchContext (ManagedPtr SearchContext) |
Instances
| GObject SearchContext Source # | |
Defined in GI.GtkSource.Objects.SearchContext Methods gobjectType :: SearchContext -> IO GType # | |
| IsObject SearchContext Source # | |
Defined in GI.GtkSource.Objects.SearchContext | |
| IsSearchContext SearchContext Source # | |
Defined in GI.GtkSource.Objects.SearchContext | |
class GObject o => IsSearchContext o Source #
Type class for types which can be safely cast to SearchContext, for instance with toSearchContext.
Instances
| (GObject a, (UnknownAncestorError SearchContext a :: Constraint)) => IsSearchContext a Source # | |
Defined in GI.GtkSource.Objects.SearchContext | |
| IsSearchContext SearchContext Source # | |
Defined in GI.GtkSource.Objects.SearchContext | |
toSearchContext :: (MonadIO m, IsSearchContext o) => o -> m SearchContext Source #
Cast to SearchContext, for types for which this is known to be safe. For general casts, use castTo.
noSearchContext :: Maybe SearchContext Source #
A convenience alias for Nothing :: Maybe SearchContext.
Methods
backward
searchContextBackward Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSearchContext a) | |
| => a |
|
| -> TextIter |
|
| -> 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 |
|
| -> TextIter |
|
| -> 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 |
|
| -> TextIter |
|
| -> Maybe b |
|
| -> Maybe AsyncReadyCallback |
|
| -> 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 |
|
| -> b |
|
| -> m (TextIter, TextIter) | (Can throw |
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 |
|
| -> b |
|
| -> m (TextIter, TextIter, Bool) | (Can throw |
Finishes a backward search started with
searchContextBackwardAsync.
See the documentation of searchContextBackward2 for more
details.
Since: 3.22
forward
Arguments
| :: (HasCallStack, MonadIO m, IsSearchContext a) | |
| => a |
|
| -> TextIter |
|
| -> 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 |
|
| -> TextIter |
|
| -> 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 |
|
| -> TextIter |
|
| -> Maybe b |
|
| -> Maybe AsyncReadyCallback |
|
| -> 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 |
|
| -> b |
|
| -> m (TextIter, TextIter) | (Can throw |
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 |
|
| -> b |
|
| -> m (TextIter, TextIter, Bool) | (Can throw |
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 |
|
| -> 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 |
|
| -> 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 |
|
| -> m Style | Returns: the |
No description available in the introspection data.
Since: 3.16
getOccurrencePosition
searchContextGetOccurrencePosition Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSearchContext a) | |
| => a |
|
| -> TextIter |
|
| -> TextIter |
|
| -> m Int32 | Returns: the position of the search occurrence. The first occurrence has the
position 1 (not 0). Returns 0 if |
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 |
|
| -> 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 |
|
| -> m (Maybe GError) |
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 |
|
| -> m SearchSettings | Returns: the search settings. |
No description available in the introspection data.
Since: 3.10
new
Arguments
| :: (HasCallStack, MonadIO m, IsBuffer a, IsSearchSettings b) | |
| => a |
|
| -> Maybe b |
|
| -> 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
Arguments
| :: (HasCallStack, MonadIO m, IsSearchContext a) | |
| => a |
|
| -> TextIter |
|
| -> TextIter |
|
| -> Text |
|
| -> Int32 |
|
| -> m () | (Can throw |
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 |
|
| -> TextIter |
|
| -> TextIter |
|
| -> Text |
|
| -> Int32 |
|
| -> m () | (Can throw |
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 |
|
| -> Text |
|
| -> Int32 |
|
| -> m Word32 | Returns: the number of replaced matches. (Can throw |
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 |
|
| -> Bool |
|
| -> m () |
Enables or disables the search occurrences highlighting.
Since: 3.10
setMatchStyle
searchContextSetMatchStyle Source #
Arguments
| :: (HasCallStack, MonadIO m, IsSearchContext a, IsStyle b) | |
| => a |
|
| -> Maybe b | |
| -> 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 |
|
| -> Maybe b |
|
| -> 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
The Buffer associated to the search context.
Since: 3.10
constructSearchContextBuffer :: (IsSearchContext o, IsBuffer a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “buffer” property. This is rarely needed directly, but it is used by new.
getSearchContextBuffer :: (MonadIO m, IsSearchContext o) => o -> m Buffer Source #
Get the value of the “buffer” property.
When overloading is enabled, this is equivalent to
get searchContext #buffer
highlight
Highlight the search occurrences.
Since: 3.10
constructSearchContextHighlight :: IsSearchContext o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “highlight” property. This is rarely needed directly, but it is used by new.
getSearchContextHighlight :: (MonadIO m, IsSearchContext o) => o -> m Bool Source #
Get the value of the “highlight” property.
When overloading is enabled, this is equivalent to
get searchContext #highlight
setSearchContextHighlight :: (MonadIO m, IsSearchContext o) => o -> Bool -> m () Source #
Set the value of the “highlight” property.
When overloading is enabled, this is equivalent to
setsearchContext [ #highlight:=value ]
matchStyle
clearSearchContextMatchStyle :: (MonadIO m, IsSearchContext o) => o -> m () Source #
Set the value of the “match-style” property to Nothing.
When overloading is enabled, this is equivalent to
clear #matchStyle
constructSearchContextMatchStyle :: (IsSearchContext o, IsStyle a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “match-style” property. This is rarely needed directly, but it is used by new.
getSearchContextMatchStyle :: (MonadIO m, IsSearchContext o) => o -> m Style Source #
Get the value of the “match-style” property.
When overloading is enabled, this is equivalent to
get searchContext #matchStyle
setSearchContextMatchStyle :: (MonadIO m, IsSearchContext o, IsStyle a) => o -> a -> m () Source #
Set the value of the “match-style” property.
When overloading is enabled, this is equivalent to
setsearchContext [ #matchStyle:=value ]
occurrencesCount
The total number of search occurrences. If the search is disabled, the value is 0. If the buffer is not already fully scanned, the value is -1.
Since: 3.10
getSearchContextOccurrencesCount :: (MonadIO m, IsSearchContext o) => o -> m Int32 Source #
Get the value of the “occurrences-count” property.
When overloading is enabled, this is equivalent to
get searchContext #occurrencesCount
regexError
If the regex search pattern doesn't follow all the rules, this
property will be set. If the pattern is valid, the value is Nothing.
Free with errorFree.
Since: 3.10
getSearchContextRegexError :: (MonadIO m, IsSearchContext o) => o -> m (Ptr ()) Source #
Get the value of the “regex-error” property.
When overloading is enabled, this is equivalent to
get searchContext #regexError
settings
The SearchSettings associated to the search context.
Since: 3.10
clearSearchContextSettings :: (MonadIO m, IsSearchContext o) => o -> m () Source #
Set the value of the “settings” property to Nothing.
When overloading is enabled, this is equivalent to
clear #settings
constructSearchContextSettings :: (IsSearchContext o, IsSearchSettings a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “settings” property. This is rarely needed directly, but it is used by new.
getSearchContextSettings :: (MonadIO m, IsSearchContext o) => o -> m SearchSettings Source #
Get the value of the “settings” property.
When overloading is enabled, this is equivalent to
get searchContext #settings
setSearchContextSettings :: (MonadIO m, IsSearchContext o, IsSearchSettings a) => o -> a -> m () Source #
Set the value of the “settings” property.
When overloading is enabled, this is equivalent to
setsearchContext [ #settings:=value ]