{{+bindTo:partials.standard_nacl_api}}
<h1>PPB_IMEInputEvent Struct Reference</h1>
<div id="doxygen-ref">
{{- dummy div to appease doxygen -}}
<div>
<!-- Generated by Doxygen 1.7.6.1 -->
</div>
<!--header-->
<div class="contents">
<!-- doxytag: class="PPB_IMEInputEvent" --><h2>
Data Fields</h2><table class="memberdecls">
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#ad4bd2c64c71c9af07c110e47d64d94c4">Create</a> )(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance, <a class="el" href="group___enums.html#gaca7296cfec99fcb6646b7144d1d6a0c5">PP_InputEvent_Type</a> type, <a class="el" href="group___typedefs.html#ga71cb1042cdeb38d7881b121f3b09ce94">PP_TimeTicks</a> time_stamp, struct <a class="el" href="struct_p_p___var.html">PP_Var</a> text, uint32_t segment_number, const uint32_t segment_offsets[], int32_t target_segment, uint32_t selection_start, uint32_t selection_end)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a73a886654b174d99af7f52c13272dce0">IsIMEInputEvent</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="struct_p_p___var.html">PP_Var</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a107e031acc73b3c620b0d92245952e6e">GetText</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> ime_event)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a1b3d8e023aa9400dff5b3a32a49cc018">GetSegmentNumber</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> ime_event)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a5d469ddc9be36e60eda5ab74878da205">GetSegmentOffset</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> ime_event, uint32_t index)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#ac4891be932c004cff409df47fe4627fa">GetTargetSegment</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> ime_event)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a42150bcee1b6416ec89780343ce2b30a">GetSelection</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> ime_event, uint32_t *start, uint32_t *end)</td></tr>
</table>
<hr /><h2>Field Documentation</h2>
<a class="anchor" id="ad4bd2c64c71c9af07c110e47d64d94c4"></a><!-- doxytag: member="PPB_IMEInputEvent::Create" ref="ad4bd2c64c71c9af07c110e47d64d94c4" args=")(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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(* <a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#ad4bd2c64c71c9af07c110e47d64d94c4">PPB_IMEInputEvent::Create</a>)(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance, <a class="el" href="group___enums.html#gaca7296cfec99fcb6646b7144d1d6a0c5">PP_InputEvent_Type</a> type, <a class="el" href="group___typedefs.html#ga71cb1042cdeb38d7881b121f3b09ce94">PP_TimeTicks</a> time_stamp, struct <a class="el" href="struct_p_p___var.html">PP_Var</a> text, uint32_t segment_number, const uint32_t segment_offsets[], int32_t target_segment, uint32_t selection_start, uint32_t selection_end)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#ad4bd2c64c71c9af07c110e47d64d94c4" title="Create() creates an IME input event with the given parameters.">Create()</a> creates an IME input event with the given parameters. </p>
<p>Normally you will get an IME event passed through the <code>HandleInputEvent</code> and will not need to create them, but some applications may want to create their own for internal use.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>The instance for which this event occurred.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>A <code>PP_InputEvent_Type</code> identifying the type of input event. The type must be one of the IME event types.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">time_stamp</td><td>A <code>PP_TimeTicks</code> indicating the time when the event occurred.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">text</td><td>The string returned by <code>GetText</code>.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">segment_number</td><td>The number returned by <code>GetSegmentNumber</code>.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">segment_offsets</td><td>The array of numbers returned by <code>GetSegmentOffset</code>. If <code>segment_number</code> is zero, the number of elements of the array should be zero. If <code>segment_number</code> is non-zero, the length of the array must be <code>segment_number</code> + 1.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">target_segment</td><td>The number returned by <code>GetTargetSegment</code>.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">selection_start</td><td>The start index returned by <code>GetSelection</code>.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">selection_end</td><td>The end index returned by <code>GetSelection</code>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Resource</code> containing the new IME input event. </dd></dl>
</div>
</div>
<a class="anchor" id="a1b3d8e023aa9400dff5b3a32a49cc018"></a><!-- doxytag: member="PPB_IMEInputEvent::GetSegmentNumber" ref="a1b3d8e023aa9400dff5b3a32a49cc018" args=")(PP_Resource ime_event)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t(* <a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a1b3d8e023aa9400dff5b3a32a49cc018">PPB_IMEInputEvent::GetSegmentNumber</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> ime_event)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a1b3d8e023aa9400dff5b3a32a49cc018" title="GetSegmentNumber() returns the number of segments in the composition text.">GetSegmentNumber()</a> returns the number of segments in the composition text. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ime_event</td><td>A <code>PP_Resource</code> corresponding to an IME event.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of segments. For events other than COMPOSITION_UPDATE, returns 0. </dd></dl>
</div>
</div>
<a class="anchor" id="a5d469ddc9be36e60eda5ab74878da205"></a><!-- doxytag: member="PPB_IMEInputEvent::GetSegmentOffset" ref="a5d469ddc9be36e60eda5ab74878da205" args=")(PP_Resource ime_event, uint32_t index)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t(* <a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a5d469ddc9be36e60eda5ab74878da205">PPB_IMEInputEvent::GetSegmentOffset</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> ime_event, uint32_t index)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a5d469ddc9be36e60eda5ab74878da205" title="GetSegmentOffset() returns the position of the index-th segmentation point in the composition text...">GetSegmentOffset()</a> returns the position of the index-th segmentation point in the composition text. </p>
<p>The position is given by a byte-offset (not a character-offset) of the string returned by <a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a107e031acc73b3c620b0d92245952e6e" title="GetText() returns the composition text as a UTF-8 string for the given IME event.">GetText()</a>. It always satisfies 0=GetSegmentOffset(0) < ... < GetSegmentOffset(i) < GetSegmentOffset(i+1) < ... < GetSegmentOffset(<a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a1b3d8e023aa9400dff5b3a32a49cc018" title="GetSegmentNumber() returns the number of segments in the composition text.">GetSegmentNumber()</a>)=(byte-length of <a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a107e031acc73b3c620b0d92245952e6e" title="GetText() returns the composition text as a UTF-8 string for the given IME event.">GetText()</a>). Note that [GetSegmentOffset(i), GetSegmentOffset(i+1)) represents the range of the i-th segment, and hence <a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a1b3d8e023aa9400dff5b3a32a49cc018" title="GetSegmentNumber() returns the number of segments in the composition text.">GetSegmentNumber()</a> can be a valid argument to this function instead of an off-by-1 error.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ime_event</td><td>A <code>PP_Resource</code> corresponding to an IME event.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>An integer indicating a segment.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The byte-offset of the segmentation point. If the event is not COMPOSITION_UPDATE or index is out of range, returns 0. </dd></dl>
</div>
</div>
<a class="anchor" id="a42150bcee1b6416ec89780343ce2b30a"></a><!-- doxytag: member="PPB_IMEInputEvent::GetSelection" ref="a42150bcee1b6416ec89780343ce2b30a" args=")(PP_Resource ime_event, uint32_t *start, uint32_t *end)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void(* <a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a42150bcee1b6416ec89780343ce2b30a">PPB_IMEInputEvent::GetSelection</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> ime_event, uint32_t *start, uint32_t *end)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a42150bcee1b6416ec89780343ce2b30a" title="GetSelection() returns the range selected by caret in the composition text.">GetSelection()</a> returns the range selected by caret in the composition text. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ime_event</td><td>A <code>PP_Resource</code> corresponding to an IME event.</td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">start</td><td>The start position of the current selection.</td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">end</td><td>The end position of the current selection. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ac4891be932c004cff409df47fe4627fa"></a><!-- doxytag: member="PPB_IMEInputEvent::GetTargetSegment" ref="ac4891be932c004cff409df47fe4627fa" args=")(PP_Resource ime_event)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#ac4891be932c004cff409df47fe4627fa">PPB_IMEInputEvent::GetTargetSegment</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> ime_event)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#ac4891be932c004cff409df47fe4627fa" title="GetTargetSegment() returns the index of the current target segment of composition.">GetTargetSegment()</a> returns the index of the current target segment of composition. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ime_event</td><td>A <code>PP_Resource</code> corresponding to an IME event.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>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. </dd></dl>
</div>
</div>
<a class="anchor" id="a107e031acc73b3c620b0d92245952e6e"></a><!-- doxytag: member="PPB_IMEInputEvent::GetText" ref="a107e031acc73b3c620b0d92245952e6e" args=")(PP_Resource ime_event)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct <a class="el" href="struct_p_p___var.html">PP_Var</a>(* <a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a107e031acc73b3c620b0d92245952e6e">PPB_IMEInputEvent::GetText</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> ime_event)<code> [read]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a107e031acc73b3c620b0d92245952e6e" title="GetText() returns the composition text as a UTF-8 string for the given IME event.">GetText()</a> returns the composition text as a UTF-8 string for the given IME event. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ime_event</td><td>A <code>PP_Resource</code> corresponding to an IME event.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A string var representing the composition text. For non-IME input events the return value will be an undefined var. </dd></dl>
</div>
</div>
<a class="anchor" id="a73a886654b174d99af7f52c13272dce0"></a><!-- doxytag: member="PPB_IMEInputEvent::IsIMEInputEvent" ref="a73a886654b174d99af7f52c13272dce0" args=")(PP_Resource resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a73a886654b174d99af7f52c13272dce0">PPB_IMEInputEvent::IsIMEInputEvent</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___i_m_e_input_event__1__0.html#a73a886654b174d99af7f52c13272dce0" title="IsIMEInputEvent() determines if a resource is an IME event.">IsIMEInputEvent()</a> determines if a resource is an IME event. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A <code>PP_Resource</code> corresponding to an event.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>PP_TRUE</code> if the given resource is a valid input event. </dd></dl>
</div>
</div>
<hr />The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="ppb__input__event_8h.html">ppb_input_event.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}