PPB_IMEInputEvent Struct Reference

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]instanceThe instance for which this event occurred.
[in]typeA PP_InputEvent_Type identifying the type of input event. The type must be one of the IME event types.
[in]time_stampA PP_TimeTicks indicating the time when the event occurred.
[in]textThe string returned by GetText.
[in]segment_numberThe number returned by GetSegmentNumber.
[in]segment_offsetsThe array of numbers returned by GetSegmentOffset. If segment_number is zero, the number of elements of the array should be zero. If segment_number is non-zero, the length of the array must be segment_number + 1.
[in]target_segmentThe number returned by GetTargetSegment.
[in]selection_startThe start index returned by GetSelection.
[in]selection_endThe end index returned by GetSelection.
Returns:
A PP_Resource containing the new IME input event.

GetSegmentNumber() returns the number of segments in the composition text.

Parameters:
[in]ime_eventA 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_eventA PP_Resource corresponding to an IME event.
[in]indexAn 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_eventA PP_Resource corresponding to an IME event.
[out]startThe start position of the current selection.
[out]endThe end position of the current selection.

GetTargetSegment() returns the index of the current target segment of composition.

Parameters:
[in]ime_eventA 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_eventA 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.

IsIMEInputEvent() determines if a resource is an IME event.

Parameters:
[in]resourceA 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: