WebKit.FindController¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
|||
r |
|||
r |
|||
r/w/co |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted when the |
|
This signal is emitted when a search operation does not find any result for the given text. |
|
This signal is emitted when a given text is found in the web page text. |
Fields¶
- Inherited:
Class Details¶
- class WebKit.FindController(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Controls text search in a
WebKit.WebView
.A
WebKit.FindController
is used to search text in aWebKit.WebView
. You can get aWebKit.WebView
‘sWebKit.FindController
withWebKit.WebView.get_find_controller
(), and later use it to search for text usingWebKit.FindController.search
(), or get the number of matches usingWebKit.FindController.count_matches
(). The operations are asynchronous and trigger signals when ready, such asWebKit.FindController
::found-text
,WebKit.FindController
::failed-to-find-text
orWebKit.FindController
::counted-matches
.- count_matches(search_text, find_options, max_match_count)¶
- Parameters:
search_text (
str
) – the text to look forfind_options (
int
) – a bitmask with theWebKit.FindOptions
used in the searchmax_match_count (
int
) – the maximum number of matches allowed in the search
Counts the number of matches for search_text.
Counts the number of matches for search_text found in the
WebKit.WebView
with the provided find_options. The number of matches will be provided by theWebKit.FindController
::counted-matches
signal.
- get_max_match_count()¶
- Returns:
the maximum number of matches to report.
- Return type:
Gets the maximum number of matches to report.
Gets the maximum number of matches to report during a text lookup. This number is passed as the last argument of
WebKit.FindController.search
() orWebKit.FindController.count_matches
().
- get_options()¶
- Returns:
a bitmask containing the
WebKit.FindOptions
associated with the current search.- Return type:
Gets the
WebKit.FindOptions
for the current search.Gets a bitmask containing the
WebKit.FindOptions
associated with the current search.
- get_search_text()¶
- Returns:
the text to look for in the
WebKit.WebView
.- Return type:
Gets the text that self is searching for.
Gets the text that self is currently searching for. This text is passed to either
WebKit.FindController.search
() orWebKit.FindController.count_matches
().
- get_web_view()¶
- Returns:
the
WebKit.WebView
.- Return type:
Gets the
WebKit.WebView
this find controller is associated to.Do not dereference the returned instance as it belongs to the
WebKit.FindController
.
- search(search_text, find_options, max_match_count)¶
- Parameters:
search_text (
str
) – the text to look forfind_options (
int
) – a bitmask with theWebKit.FindOptions
used in the searchmax_match_count (
int
) – the maximum number of matches allowed in the search
Looks for search_text associated with self.
Looks for search_text in the
WebKit.WebView
associated with self since the beginning of the document highlighting up to max_match_count matches. The outcome of the search will be asynchronously provided by theWebKit.FindController
::found-text
andWebKit.FindController
::failed-to-find-text
signals.To look for the next or previous occurrences of the same text with the same find options use
WebKit.FindController.search_next
() and/orWebKit.FindController.search_previous
(). TheWebKit.FindController
will use the same text and options for the following searches unless they are modified by another call to this method.Note that if the number of matches is higher than max_match_count then
WebKit.FindController
::found-text
will reportGObject.G_MAXUINT
matches instead of the actual number.Callers should call
WebKit.FindController.search_finish
() to finish the current search operation.
- search_finish()¶
Finishes a find operation.
Finishes a find operation started by
WebKit.FindController.search
(). It will basically unhighlight every text match found.This method will be typically called when the search UI is closed/hidden by the client application.
- search_next()¶
Looks for the next occurrence of the search text.
Calling this method before
WebKit.FindController.search
() orWebKit.FindController.count_matches
() is a programming error.
- search_previous()¶
Looks for the previous occurrence of the search text.
Calling this method before
WebKit.FindController.search
() orWebKit.FindController.count_matches
() is a programming error.
Signal Details¶
- WebKit.FindController.signals.counted_matches(find_controller, match_count)¶
- Signal Name:
counted-matches
- Flags:
- Parameters:
find_controller (
WebKit.FindController
) – The object which received the signalmatch_count (
int
) – the number of matches of the search text
This signal is emitted when the
WebKit.FindController
has counted the number of matches for a given text after a call toWebKit.FindController.count_matches
().
- WebKit.FindController.signals.failed_to_find_text(find_controller)¶
- Signal Name:
failed-to-find-text
- Flags:
- Parameters:
find_controller (
WebKit.FindController
) – The object which received the signal
This signal is emitted when a search operation does not find any result for the given text. It will be issued if the text is not found asynchronously after a call to
WebKit.FindController.search
(),WebKit.FindController.search_next
() orWebKit.FindController.search_previous
().
- WebKit.FindController.signals.found_text(find_controller, match_count)¶
- Signal Name:
found-text
- Flags:
- Parameters:
find_controller (
WebKit.FindController
) – The object which received the signalmatch_count (
int
) – the number of matches found of the search text
This signal is emitted when a given text is found in the web page text. It will be issued if the text is found asynchronously after a call to
WebKit.FindController.search
(),WebKit.FindController.search_next
() orWebKit.FindController.search_previous
().
Property Details¶
- WebKit.FindController.props.max_match_count¶
-
The maximum number of matches to report for a given search.
- WebKit.FindController.props.options¶
- Name:
options
- Type:
- Default Value:
- Flags:
The options to be used in the search operation.
- WebKit.FindController.props.text¶
-
The current search text for this
WebKit.FindController
.
- WebKit.FindController.props.web_view¶
- Name:
web-view
- Type:
- Default Value:
- Flags:
The
WebKit.WebView
this controller is associated to.