PPB_TextInputController Struct Reference

Data Fields

void(* SetTextInputType )(PP_Instance instance, PP_TextInput_Type type)
void(* UpdateCaretPosition )(PP_Instance instance, const struct PP_Rect *caret)
void(* CancelCompositionText )(PP_Instance instance)
void(* UpdateSurroundingText )(PP_Instance instance, struct PP_Var text, uint32_t caret, uint32_t anchor)

Detailed Description

PPB_TextInputController provides a set of functions for giving hints to the browser about the text input status of plugins, and functions for controlling input method editors (IMEs).


Field Documentation

Cancels the current composition in IME.

Informs the browser about the current text input mode of the plugin.

Typical use of this information in the browser is to properly display/suppress tools for supporting text inputs (such as virtual keyboards in touch screen based devices, or input method editors often used for composing East Asian characters).

void(* PPB_TextInputController::UpdateCaretPosition)(PP_Instance instance, const struct PP_Rect *caret)

Informs the browser about the coordinates of the text input caret area.

Typical use of this information in the browser is to layout IME windows etc.

void(* PPB_TextInputController::UpdateSurroundingText)(PP_Instance instance, struct PP_Var text, uint32_t caret, uint32_t anchor)

Informs the browser about the current text selection and surrounding text.

text is a UTF-8 string that contains the current range of text selection in the plugin. caret is the byte-index of the caret position within text. anchor is the byte-index of the anchor position (i.e., if a range of text is selected, it is the other edge of selection different from caret. If there are no selection, anchor is equal to caret.

Typical use of this information in the browser is to enable "reconversion" features of IME that puts back the already committed text into the pre-commit composition state. Another use is to improve the precision of suggestion of IME by taking the context into account (e.g., if the caret looks to be on the beginning of a sentence, suggest capital letters in a virtual keyboard).

When the focus is not on text, call this function setting text to an empty string and caret and anchor to zero. Also, the plugin should send the empty text when it does not want to reveal the selection to IME (e.g., when the surrounding text is containing password text).


The documentation for this struct was generated from the following file: