WebKit2.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:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class WebKit2.FindController(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Controls text search in a
WebKit2.WebView
.A
WebKit2.FindController
is used to search text in aWebKit2.WebView
. You can get aWebKit2.WebView
‘sWebKit2.FindController
withWebKit2.WebView.get_find_controller
(), and later use it to search for text usingWebKit2.FindController.search
(), or get the number of matches usingWebKit2.FindController.count_matches
(). The operations are asynchronous and trigger signals when ready, such asWebKit2.FindController
::found-text
,WebKit2.FindController
::failed-to-find-text
orWebKit2.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 theWebKit2.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
WebKit2.WebView
with the provided find_options. The number of matches will be provided by theWebKit2.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
WebKit2.FindController.search
() orWebKit2.FindController.count_matches
().
- get_options()¶
- Returns:
a bitmask containing the
WebKit2.FindOptions
associated with the current search.- Return type:
Gets the
WebKit2.FindOptions
for the current search.Gets a bitmask containing the
WebKit2.FindOptions
associated with the current search.
- get_search_text()¶
- Returns:
the text to look for in the
WebKit2.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
WebKit2.FindController.search
() orWebKit2.FindController.count_matches
().
- get_web_view()¶
- Returns:
the
WebKit2.WebView
.- Return type:
Gets the
WebKit2.WebView
this find controller is associated to.Do not dereference the returned instance as it belongs to the
WebKit2.FindController
.
- search(search_text, find_options, max_match_count)¶
- Parameters:
search_text (
str
) – the text to look forfind_options (
int
) – a bitmask with theWebKit2.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
WebKit2.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 theWebKit2.FindController
::found-text
andWebKit2.FindController
::failed-to-find-text
signals.To look for the next or previous occurrences of the same text with the same find options use
WebKit2.FindController.search_next
() and/orWebKit2.FindController.search_previous
(). TheWebKit2.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
WebKit2.FindController
::found-text
will reportGObject.G_MAXUINT
matches instead of the actual number.Callers should call
WebKit2.FindController.search_finish
() to finish the current search operation.
- search_finish()¶
Finishes a find operation.
Finishes a find operation started by
WebKit2.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
WebKit2.FindController.search
() orWebKit2.FindController.count_matches
() is a programming error.
- search_previous()¶
Looks for the previous occurrence of the search text.
Calling this method before
WebKit2.FindController.search
() orWebKit2.FindController.count_matches
() is a programming error.
Signal Details¶
- WebKit2.FindController.signals.counted_matches(find_controller, match_count)¶
- Signal Name:
counted-matches
- Flags:
- Parameters:
find_controller (
WebKit2.FindController
) – The object which received the signalmatch_count (
int
) – the number of matches of the search text
This signal is emitted when the
WebKit2.FindController
has counted the number of matches for a given text after a call toWebKit2.FindController.count_matches
().
- WebKit2.FindController.signals.failed_to_find_text(find_controller)¶
- Signal Name:
failed-to-find-text
- Flags:
- Parameters:
find_controller (
WebKit2.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
WebKit2.FindController.search
(),WebKit2.FindController.search_next
() orWebKit2.FindController.search_previous
().
- WebKit2.FindController.signals.found_text(find_controller, match_count)¶
- Signal Name:
found-text
- Flags:
- Parameters:
find_controller (
WebKit2.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
WebKit2.FindController.search
(),WebKit2.FindController.search_next
() orWebKit2.FindController.search_previous
().
Property Details¶
- WebKit2.FindController.props.max_match_count¶
-
The maximum number of matches to report for a given search.
- WebKit2.FindController.props.options¶
- Name:
options
- Type:
- Default Value:
- Flags:
The options to be used in the search operation.
- WebKit2.FindController.props.text¶
-
The current search text for this
WebKit2.FindController
.
- WebKit2.FindController.props.web_view¶
- Name:
web-view
- Type:
- Default Value:
- Flags:
The
WebKit2.WebView
this controller is associated to.