Pepper_31_C_interfaces
Public Attributes | List of all members
PPB_TextInputController_1_0 Struct Reference

#include <ppb_text_input_controller.h>

Collaboration diagram for PPB_TextInputController_1_0:
Collaboration graph

Public Attributes

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).

Definition at line 71 of file ppb_text_input_controller.h.

Member Data Documentation

void(* PPB_TextInputController_1_0::CancelCompositionText)(PP_Instance instance)

Cancels the current composition in IME.

Definition at line 90 of file ppb_text_input_controller.h.

void(* PPB_TextInputController_1_0::SetTextInputType)(PP_Instance instance, PP_TextInput_Type type)

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).

Definition at line 79 of file ppb_text_input_controller.h.

void(* PPB_TextInputController_1_0::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.

Definition at line 85 of file ppb_text_input_controller.h.

void(* PPB_TextInputController_1_0::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).

Definition at line 113 of file ppb_text_input_controller.h.


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