Top |
void | committed | Run Last |
void | delete-surrounding | Run Last |
void | preedit-changed | Run Last |
void | preedit-finished | Run Last |
void | preedit-started | Run Last |
GBoxed ╰── WebKitInputMethodUnderline GEnum ╰── WebKitInputPurpose GObject ╰── WebKitInputMethodContext
WebKitInputMethodContext defines the interface to implement WebKit input methods. The input methods are used by WebKit, when editable content is focused, to map from key events to Unicode character strings.
An input method may consume multiple key events in sequence and finally output the composed result. This is called preediting, and an input method may provide feedback about this process by displaying the intermediate composition states as preedit text.
void webkit_input_method_context_set_enable_preedit (WebKitInputMethodContext *context
,gboolean enabled
);
Set whether context
should enable preedit to display feedback.
Since: 2.28
void webkit_input_method_context_get_preedit (WebKitInputMethodContext *context
,char **text
,GList **underlines
,guint *cursor_offset
);
Get the current preedit string for the context
, and a list of WebKitInputMethodUnderline to apply to the string.
The string will be displayed inserted at cursor_offset
.
context |
||
text |
location to store the preedit string. |
[out][transfer full][nullable] |
underlines |
location to store the underlines as a GList of WebKitInputMethodUnderline. |
[out][transfer full][nullable][element-type WebKit2.InputMethodUnderline] |
cursor_offset |
location to store the position of cursor in preedit string. |
[out][nullable] |
Since: 2.28
gboolean webkit_input_method_context_filter_key_event (WebKitInputMethodContext *context
,GdkEventKey *key_event
);
Allow key_event
to be handled by the input method. If TRUE
is returned, then no further processing should be
done for the key event.
Since: 2.28
void
webkit_input_method_context_notify_focus_in
(WebKitInputMethodContext *context
);
Notify context
that input associated has gained focus.
Since: 2.28
void
webkit_input_method_context_notify_focus_out
(WebKitInputMethodContext *context
);
Notify context
that input associated has lost focus.
Since: 2.28
void webkit_input_method_context_notify_cursor_area (WebKitInputMethodContext *context
,int x
,int y
,int width
,int height
);
Notify context
that cursor area changed in input associated.
context |
||
x |
the x coordinate of cursor location |
|
y |
the y coordinate of cursor location |
|
width |
the width of cursor area |
|
height |
the height of cursor area |
Since: 2.28
void webkit_input_method_context_notify_surrounding (WebKitInputMethodContext *context
,const gchar *text
,int length
,guint cursor_index
,guint selection_index
);
Notify context
that the context surrounding the cursor has changed.
If there's no selection selection_index
is the same as cursor_index
.
context |
||
text |
text surrounding the insertion point |
|
length |
the length of |
|
cursor_index |
the byte index of the insertion cursor within |
|
selection_index |
the byte index of the selection cursor within |
Since: 2.28
void
webkit_input_method_context_reset (WebKitInputMethodContext *context
);
Reset the context
. This will typically cause the input to clear the preedit state.
Since: 2.28
WebKitInputPurpose
webkit_input_method_context_get_input_purpose
(WebKitInputMethodContext *context
);
Get the value of the “input-purpose” property.
Since: 2.28
void webkit_input_method_context_set_input_purpose (WebKitInputMethodContext *context
,WebKitInputPurpose purpose
);
Set the value of the “input-purpose” property.
Since: 2.28
WebKitInputHints
webkit_input_method_context_get_input_hints
(WebKitInputMethodContext *context
);
Get the value of the “input-hints” property.
Since: 2.28
void webkit_input_method_context_set_input_hints (WebKitInputMethodContext *context
,WebKitInputHints hints
);
WebKitInputMethodUnderline * webkit_input_method_underline_new (guint start_offset
,guint end_offset
);
Create a new WebKitInputMethodUnderline for the given range in preedit string
start_offset |
the start offset in preedit string |
|
end_offset |
the end offset in preedit string |
Since: 2.28
WebKitInputMethodUnderline *
webkit_input_method_underline_copy (WebKitInputMethodUnderline *underline
);
Make a copy of the WebKitInputMethodUnderline.
Since: 2.28
void
webkit_input_method_underline_free (WebKitInputMethodUnderline *underline
);
Free the WebKitInputMethodUnderline.
Since: 2.28
void webkit_input_method_underline_set_color (WebKitInputMethodUnderline *underline
,const GdkRGBA *rgba
);
Set the color of the underline. If rgba
is NULL
the foreground text color will be used
for the underline too.
Since: 2.28
Enum values used to describe the primary purpose of the active editable element.
Editable element expects any characters |
||
Editable element expects digits |
||
Editable element expects a number |
||
Editable element expects a telephone |
||
Editable element expects a URL |
||
Editable element expects an email |
||
Editable element expects a password |
Since: 2.28
Enum values used to describe hints that might be taken into account by input methods.
No special behavior suggested |
||
Suggest spell checking |
||
Suggest to not autocapitlize |
||
Suggest to capitalize all text |
||
Suggest to capitalize the first character of each word |
||
Suggest to capitalize the first word of each sentence |
||
Suggest to not show an onscreen keyboard |
Since: 2.28
“input-hints”
property“input-hints” WebKitInputHints
The hints of the input associated.
Owner: WebKitInputMethodContext
Flags: Read / Write
“input-purpose”
property“input-purpose” WebKitInputPurpose
The purpose of the input associated.
Owner: WebKitInputMethodContext
Flags: Read / Write
Default value: WEBKIT_INPUT_PURPOSE_FREE_FORM
“committed”
signalvoid user_function (WebKitInputMethodContext *context, char *text, gpointer user_data)
Emitted when a complete input sequence has been entered by the user. This can be a single character immediately after a key press or the final result of preediting.
context |
the WebKitInputMethodContext on which the signal is emitted |
|
text |
the string result |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.28
“delete-surrounding”
signalvoid user_function (WebKitInputMethodContext *context, int offset, guint n_chars, gpointer user_data)
Emitted when the input method wants to delete the context surrounding the cursor.
If offset
is a negative value, it means a position before the cursor.
context |
the WebKitInputMethodContext on which the signal is emitted |
|
offset |
the character offset from the cursor position of the text to be deleted. |
|
n_chars |
the number of characters to be deleted |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.28
“preedit-changed”
signalvoid user_function (WebKitInputMethodContext *context, gpointer user_data)
Emitted whenever the preedit sequence currently being entered has changed.
It is also emitted at the end of a preedit sequence, in which case
webkit_input_method_context_get_preedit()
returns the empty string.
context |
the WebKitInputMethodContext on which the signal is emitted |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.28
“preedit-finished”
signalvoid user_function (WebKitInputMethodContext *context, gpointer user_data)
Emitted when a preediting sequence has been completed or canceled.
context |
the WebKitInputMethodContext on which the signal is emitted |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.28
“preedit-started”
signalvoid user_function (WebKitInputMethodContext *context, gpointer user_data)
Emitted when a new preediting sequence starts.
context |
the WebKitInputMethodContext on which the signal is emitted |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.28