![]() |
![]() |
![]() |
WebKit2GTK+ Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
WebKitFindController; enum WebKitFindOptions; void webkit_find_controller_search (WebKitFindController *find_controller
,const gchar *search_text
,guint32 find_options
,guint max_match_count
); void webkit_find_controller_search_finish (WebKitFindController *find_controller
); void webkit_find_controller_search_next (WebKitFindController *find_controller
); void webkit_find_controller_search_previous (WebKitFindController *find_controller
); const gchar * webkit_find_controller_get_search_text (WebKitFindController *find_controller
); void webkit_find_controller_count_matches (WebKitFindController *find_controller
,const gchar *search_text
,guint32 find_options
,guint max_match_count
); guint32 webkit_find_controller_get_options (WebKitFindController *find_controller
); guint webkit_find_controller_get_max_match_count (WebKitFindController *find_controller
); WebKitWebView * webkit_find_controller_get_web_view (WebKitFindController *find_controller
);
"max-match-count" guint : Read "options" WebKitFindOptions : Read "text" gchar* : Read "web-view" WebKitWebView* : Read / Write / Construct Only
typedef enum { WEBKIT_FIND_OPTIONS_NONE, WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE = 1 << 0, WEBKIT_FIND_OPTIONS_AT_WORD_STARTS = 1 << 1, WEBKIT_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START = 1 << 2, WEBKIT_FIND_OPTIONS_BACKWARDS = 1 << 3, WEBKIT_FIND_OPTIONS_WRAP_AROUND = 1 << 4, } WebKitFindOptions;
Enum values used to specify search options.
no search flags, this means a case sensitive, no wrap, forward only search. | |
case insensitive search. | |
search text only at the begining of the words. | |
treat capital letters in the middle of words as word start. | |
search backwards. | |
if not present search will stop at the end of the document. |
void webkit_find_controller_search (WebKitFindController *find_controller
,const gchar *search_text
,guint32 find_options
,guint max_match_count
);
Looks for search_text
in the WebKitWebView associated with
find_controller
since the beginning of the document highlighting
up to max_match_count
matches. The outcome of the search will be
asynchronously provided by the "found-text"
and "failed-to-find-text" signals.
To look for the next or previous occurrences of the same text
with the same find options use webkit_find_controller_search_next()
and/or webkit_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 "found-text" will report G_MAXUINT
matches
instead of the actual number.
Callers should call webkit_find_controller_search_finish()
to
finish the current search operation.
|
the WebKitFindController |
|
the text to look for |
|
a bitmask with the WebKitFindOptions used in the search |
|
the maximum number of matches allowed in the search |
void webkit_find_controller_search_finish
(WebKitFindController *find_controller
);
Finishes a find operation started by
webkit_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.
|
a WebKitFindController |
void webkit_find_controller_search_next (WebKitFindController *find_controller
);
Looks for the next occurrence of the search text.
Calling this method before webkit_find_controller_search()
or
webkit_find_controller_count_matches()
is a programming error.
|
the WebKitFindController |
void webkit_find_controller_search_previous
(WebKitFindController *find_controller
);
Looks for the previous occurrence of the search text.
Calling this method before webkit_find_controller_search()
or
webkit_find_controller_count_matches()
is a programming error.
|
the WebKitFindController |
const gchar * webkit_find_controller_get_search_text
(WebKitFindController *find_controller
);
Gets the text that find_controller
is currently searching
for. This text is passed to either
webkit_find_controller_search()
or
webkit_find_controller_count_matches()
.
|
the WebKitFindController |
Returns : |
the text to look for in the WebKitWebView. |
void webkit_find_controller_count_matches (WebKitFindController *find_controller
,const gchar *search_text
,guint32 find_options
,guint max_match_count
);
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
"counted-matches" signal.
|
the WebKitFindController |
|
the text to look for |
|
a bitmask with the WebKitFindOptions used in the search |
|
the maximum number of matches allowed in the search |
guint32 webkit_find_controller_get_options (WebKitFindController *find_controller
);
Gets a bitmask containing the WebKitFindOptions associated with the current search.
|
the WebKitFindController |
Returns : |
a bitmask containing the WebKitFindOptions associated with the current search. |
guint webkit_find_controller_get_max_match_count
(WebKitFindController *find_controller
);
Gets the maximum number of matches to report during a text
lookup. This number is passed as the last argument of
webkit_find_controller_search()
or
webkit_find_controller_count_matches()
.
|
the WebKitFindController |
Returns : |
the maximum number of matches to report. |
WebKitWebView * webkit_find_controller_get_web_view (WebKitFindController *find_controller
);
Gets the WebKitWebView this find controller is associated to. Do not unref the returned instance as it belongs to the WebKitFindController.
|
the WebKitFindController |
Returns : |
the WebKitWebView. [transfer none] |
"max-match-count"
property"max-match-count" guint : Read
The maximum number of matches to report for a given search.
Default value: 0
"options"
property"options" WebKitFindOptions : Read
The options to be used in the search operation.
"text"
property"text" gchar* : Read
The current search text for this WebKitFindController.
Default value: NULL
"web-view"
property"web-view" WebKitWebView* : Read / Write / Construct Only
The WebKitWebView this controller is associated to.
"counted-matches"
signalvoid user_function (WebKitFindController *find_controller,
guint match_count,
gpointer user_data) : Run Last
This signal is emitted when the WebKitFindController has
counted the number of matches for a given text after a call
to webkit_find_controller_count_matches()
.
|
the WebKitFindController |
|
the number of matches of the search text |
|
user data set when the signal handler was connected. |
"failed-to-find-text"
signalvoid user_function (WebKitFindController *find_controller,
gpointer user_data) : Run Last
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_find_controller_search()
, webkit_find_controller_search_next()
or webkit_find_controller_search_previous()
.
|
the WebKitFindController |
|
user data set when the signal handler was connected. |
"found-text"
signalvoid user_function (WebKitFindController *find_controller,
guint match_count,
gpointer user_data) : Run Last
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_find_controller_search()
,
webkit_find_controller_search_next()
or
webkit_find_controller_search_previous()
.
|
the WebKitFindController |
|
the number of matches found of the search text |
|
user data set when the signal handler was connected. |