Data Fields
PP_Resource(* | Create )(PP_Instance instance, PP_InputEvent_Type type, PP_TimeTicks time_stamp, struct PP_Var text, uint32_t segment_number, const uint32_t segment_offsets[], int32_t target_segment, uint32_t selection_start, uint32_t selection_end) |
PP_Bool(* | IsIMEInputEvent )(PP_Resource resource) |
struct PP_Var(* | GetText )(PP_Resource ime_event) |
uint32_t(* | GetSegmentNumber )(PP_Resource ime_event) |
uint32_t(* | GetSegmentOffset )(PP_Resource ime_event, uint32_t index) |
int32_t(* | GetTargetSegment )(PP_Resource ime_event) |
void(* | GetSelection )(PP_Resource ime_event, uint32_t *start, uint32_t *end) |
Field Documentation
PP_Resource(* PPB_IMEInputEvent::Create)(PP_Instance instance, PP_InputEvent_Type type, PP_TimeTicks time_stamp, struct PP_Var text, uint32_t segment_number, const uint32_t segment_offsets[], int32_t target_segment, uint32_t selection_start, uint32_t selection_end) |
Create() creates an IME input event with the given parameters.
Normally you will get an IME event passed through the HandleInputEvent
and will not need to create them, but some applications may want to create their own for internal use.
- Parameters:
[in] instance The instance for which this event occurred. [in] type A PP_InputEvent_Type
identifying the type of input event. The type must be one of the IME event types.[in] time_stamp A PP_TimeTicks
indicating the time when the event occurred.[in] text The string returned by GetText
.[in] segment_number The number returned by GetSegmentNumber
.[in] segment_offsets The array of numbers returned by GetSegmentOffset
. Ifsegment_number
is zero, the number of elements of the array should be zero. Ifsegment_number
is non-zero, the length of the array must besegment_number
+ 1.[in] target_segment The number returned by GetTargetSegment
.[in] selection_start The start index returned by GetSelection
.[in] selection_end The end index returned by GetSelection
.
- Returns:
- A
PP_Resource
containing the new IME input event.
uint32_t(* PPB_IMEInputEvent::GetSegmentNumber)(PP_Resource ime_event) |
GetSegmentNumber() returns the number of segments in the composition text.
- Parameters:
[in] ime_event A PP_Resource
corresponding to an IME event.
- Returns:
- The number of segments. For events other than COMPOSITION_UPDATE, returns 0.
uint32_t(* PPB_IMEInputEvent::GetSegmentOffset)(PP_Resource ime_event, uint32_t index) |
GetSegmentOffset() returns the position of the index-th segmentation point in the composition text.
The position is given by a byte-offset (not a character-offset) of the string returned by GetText(). It always satisfies 0=GetSegmentOffset(0) < ... < GetSegmentOffset(i) < GetSegmentOffset(i+1) < ... < GetSegmentOffset(GetSegmentNumber())=(byte-length of GetText()). Note that [GetSegmentOffset(i), GetSegmentOffset(i+1)) represents the range of the i-th segment, and hence GetSegmentNumber() can be a valid argument to this function instead of an off-by-1 error.
- Parameters:
[in] ime_event A PP_Resource
corresponding to an IME event.[in] index An integer indicating a segment.
- Returns:
- The byte-offset of the segmentation point. If the event is not COMPOSITION_UPDATE or index is out of range, returns 0.
void(* PPB_IMEInputEvent::GetSelection)(PP_Resource ime_event, uint32_t *start, uint32_t *end) |
GetSelection() returns the range selected by caret in the composition text.
- Parameters:
[in] ime_event A PP_Resource
corresponding to an IME event.[out] start The start position of the current selection. [out] end The end position of the current selection.
int32_t(* PPB_IMEInputEvent::GetTargetSegment)(PP_Resource ime_event) |
GetTargetSegment() returns the index of the current target segment of composition.
- Parameters:
[in] ime_event A PP_Resource
corresponding to an IME event.
- Returns:
- An integer indicating the index of the target segment. When there is no active target segment, or the event is not COMPOSITION_UPDATE, returns -1.
struct PP_Var(* PPB_IMEInputEvent::GetText)(PP_Resource ime_event) [read] |
GetText() returns the composition text as a UTF-8 string for the given IME event.
- Parameters:
[in] ime_event A PP_Resource
corresponding to an IME event.
- Returns:
- A string var representing the composition text. For non-IME input events the return value will be an undefined var.
PP_Bool(* PPB_IMEInputEvent::IsIMEInputEvent)(PP_Resource resource) |
IsIMEInputEvent() determines if a resource is an IME event.
- Parameters:
[in] resource A PP_Resource
corresponding to an event.
- Returns:
PP_TRUE
if the given resource is a valid input event.
The documentation for this struct was generated from the following file: