1.15 <WebKitFindController>

Class: <WebKitFindController>

It derives from <GObject>.

Controls text search in a <WebKitWebView>.

A <WebKitFindController> is used to search text in a <WebKitWebView>. You can get a <WebKitWebView><!– –>’s <WebKitFindController> with web-view:get-find-controller, and later use it to search for text using find-controller:search, or get the number of matches using find-controller:count-matches. The operations are asynchronous and trigger signals when ready, such as find-controller:found-text, find-controller:failed-to-find-text or find-controller:counted-matches<!– –>.

Properties

Property: find-controller:max-match-count self

The maximum number of matches to report for a given search.

Its value is an unsigned 32-bit integer.

It is read only.

Property: find-controller:options self

The options to be used in the search operation.

Its value is a <WebKitFindOptions>.

It is read only.

Property: find-controller:text self

The current search text for this <WebKitFindController>.

Its value is a string, or #f.

It is read only.

Property: find-controller:web-view self

The <WebKitWebView> this controller is associated to.

Its value is a <WebKitWebView>, or #f.

It can only be set when the object is made, with #:web-view.

Procedures

Method: find-controller:count-matches self search-text find-options max-match-count
Method: count-matches self search-text find-options max-match-count

Counts the number of matches for search-text.

Counts the number of matches for search-text found in the <WebKitWebView> with the provided find-options. The number of matches will be provided by the find-controller:counted-matches signal.

self

Passed: a <WebKitFindController>.

the <WebKitFindController>

search-text

Passed: a string.

the text to look for

find-options

Passed: an unsigned 32-bit integer.

a bitmask with the <WebKitFindOptions> used in the search

max-match-count

Passed: an unsigned 32-bit integer.

the maximum number of matches allowed in the search

Method: find-controller:get-max-match-count self ⇒ %return
Method: get-max-match-count self ⇒ %return

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 find-controller:search or find-controller:count-matches.

self

Passed: a <WebKitFindController>.

the <WebKitFindController>

%return

Returned: an unsigned 32-bit integer.

the maximum number of matches to report.

Method: find-controller:get-options self ⇒ %return
Method: get-options self ⇒ %return

Gets the <WebKitFindOptions> for the current search.

Gets a bitmask containing the <WebKitFindOptions> associated with the current search.

self

Passed: a <WebKitFindController>.

the <WebKitFindController>

%return

Returned: an unsigned 32-bit integer.

a bitmask containing the <WebKitFindOptions> associated with the current search.

Method: find-controller:get-search-text self ⇒ %return
Method: get-search-text self ⇒ %return

Gets the text that self is searching for.

Gets the text that self is currently searching for. This text is passed to either find-controller:search or find-controller:count-matches.

self

Passed: a <WebKitFindController>.

the <WebKitFindController>

%return

Returned: a string.

the text to look for in the <WebKitWebView>.

Method: find-controller:get-web-view self ⇒ %return
Method: get-web-view self ⇒ %return

Gets the <WebKitWebView> this find controller is associated to.

Do not dereference the returned instance as it belongs to the <WebKitFindController>.

self

Passed: a <WebKitFindController>.

the <WebKitFindController>

%return

Returned: a <WebKitWebView>.

the <WebKitWebView>.

Method: find-controller:search self search-text find-options max-match-count

Looks for search-text associated with self.

Looks for search-text in the <WebKitWebView> 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 the find-controller:found-text and find-controller:failed-to-find-text signals.

To look for the next or previous occurrences of the same text with the same find options use find-controller:search-next and/or find-controller:search-previous. The <WebKitFindController> 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 find-controller:found-text will report G_MAXUINT matches instead of the actual number.

Callers should call find-controller:search-finish to finish the current search operation.

self

Passed: a <WebKitFindController>.

the <WebKitFindController>

search-text

Passed: a string.

the text to look for

find-options

Passed: an unsigned 32-bit integer.

a bitmask with the <WebKitFindOptions> used in the search

max-match-count

Passed: an unsigned 32-bit integer.

the maximum number of matches allowed in the search

Method: find-controller:search-finish self
Method: search-finish self

Finishes a find operation.

Finishes a find operation started by find-controller: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.

self

Passed: a <WebKitFindController>.

a <WebKitFindController>

Method: find-controller:search-next self
Method: search-next self

Looks for the next occurrence of the search text.

Calling this method before find-controller:search or find-controller:count-matches is a programming error.

self

Passed: a <WebKitFindController>.

the <WebKitFindController>

Method: find-controller:search-previous self
Method: search-previous self

Looks for the previous occurrence of the search text.

Calling this method before find-controller:search or find-controller:count-matches is a programming error.

self

Passed: a <WebKitFindController>.

the <WebKitFindController>

Signals

Signal: find-controller:counted-matches

Connect a handler with (connect object find-controller:counted-matches handler). It is called as (handler self match-count).

This signal is emitted when the <WebKitFindController> has counted the number of matches for a given text after a call to find-controller:count-matches.

self

Passed: a <WebKitFindController>.

match-count

Passed: an unsigned 32-bit integer.

the number of matches of the search text

Signal: find-controller:failed-to-find-text

Connect a handler with (connect object find-controller:failed-to-find-text handler). It is called as (handler self).

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 find-controller:search, find-controller:search-next or find-controller:search-previous.

self

Passed: a <WebKitFindController>.

Signal: find-controller:found-text

Connect a handler with (connect object find-controller:found-text handler). It is called as (handler self match-count).

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 find-controller:search, find-controller:search-next or find-controller:search-previous.

self

Passed: a <WebKitFindController>.

match-count

Passed: an unsigned 32-bit integer.

the number of matches found of the search text