OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /* From dev/ppb_ime_input_event_dev.idl modified Wed May 16 17:08:03 2012. */ | 6 /* From ppb_ime_input_event.idl modified Wed Jul 17 13:59:01 2013. */ |
7 | 7 |
8 #ifndef PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ | 8 #ifndef PPAPI_C_PPB_IME_INPUT_EVENT_H_ |
9 #define PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ | 9 #define PPAPI_C_PPB_IME_INPUT_EVENT_H_ |
10 | 10 |
11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
13 #include "ppapi/c/pp_macros.h" | 13 #include "ppapi/c/pp_macros.h" |
14 #include "ppapi/c/pp_resource.h" | 14 #include "ppapi/c/pp_resource.h" |
15 #include "ppapi/c/pp_stdint.h" | 15 #include "ppapi/c/pp_stdint.h" |
16 #include "ppapi/c/pp_time.h" | 16 #include "ppapi/c/pp_time.h" |
17 #include "ppapi/c/pp_var.h" | 17 #include "ppapi/c/pp_var.h" |
18 #include "ppapi/c/ppb_input_event.h" | 18 #include "ppapi/c/ppb_input_event.h" |
19 | 19 |
20 #define PPB_IME_INPUT_EVENT_DEV_INTERFACE_0_1 "PPB_IMEInputEvent(Dev);0.1" | 20 #define PPB_IME_INPUT_EVENT_INTERFACE_1_0 "PPB_IMEInputEvent;1.0" |
21 #define PPB_IME_INPUT_EVENT_DEV_INTERFACE_0_2 "PPB_IMEInputEvent(Dev);0.2" | 21 #define PPB_IME_INPUT_EVENT_INTERFACE PPB_IME_INPUT_EVENT_INTERFACE_1_0 |
22 #define PPB_IME_INPUT_EVENT_DEV_INTERFACE PPB_IME_INPUT_EVENT_DEV_INTERFACE_0_2 | |
23 | 22 |
24 /** | 23 /** |
25 * @file | 24 * @file |
26 * This file defines the <code>PPB_IMEInputEvent_Dev</code> interface. | 25 * This file defines the <code>PPB_IMEInputEvent</code> interface. |
27 */ | 26 */ |
28 | 27 |
29 | 28 |
30 /** | 29 /** |
31 * @addtogroup Interfaces | 30 * @addtogroup Interfaces |
32 * @{ | 31 * @{ |
33 */ | 32 */ |
34 struct PPB_IMEInputEvent_Dev_0_2 { | 33 struct PPB_IMEInputEvent_1_0 { |
35 /** | 34 /** |
36 * Create() creates an IME input event with the given parameters. Normally | 35 * Create() creates an IME input event with the given parameters. Normally |
37 * you will get an IME event passed through the <code>HandleInputEvent</code> | 36 * you will get an IME event passed through the <code>HandleInputEvent</code> |
38 * and will not need to create them, but some applications may want to create | 37 * and will not need to create them, but some applications may want to create |
39 * their own for internal use. | 38 * their own for internal use. |
40 * | 39 * |
41 * @param[in] instance The instance for which this event occurred. | 40 * @param[in] instance The instance for which this event occurred. |
42 * | 41 * |
43 * @param[in] type A <code>PP_InputEvent_Type</code> identifying the type of | 42 * @param[in] type A <code>PP_InputEvent_Type</code> identifying the type of |
44 * input event. The type must be one of the IME event types. | 43 * input event. The type must be one of the IME event types. |
45 * | 44 * |
46 * @param[in] time_stamp A <code>PP_TimeTicks</code> indicating the time | 45 * @param[in] time_stamp A <code>PP_TimeTicks</code> indicating the time |
47 * when the event occurred. | 46 * when the event occurred. |
48 * | 47 * |
49 * @param[in] text The string returned by <code>GetText</code>. | 48 * @param[in] text The string returned by <code>GetText</code>. |
50 * | 49 * |
51 * @param[in] segment_number The number returned by | 50 * @param[in] segment_number The number returned by |
52 * <code>GetSegmentNumber</code>. | 51 * <code>GetSegmentCount</code>. |
53 * | 52 * |
54 * @param[in] segment_offsets The array of numbers returned by | 53 * @param[in] segment_offsets The array of numbers returned by |
55 * <code>GetSegmentOffset</code>. If <code>segment_number</code> is zero, | 54 * <code>GetSegmentOffset</code>. If <code>segment_number</code> is zero, |
56 * the number of elements of the array should be zero. If | 55 * the number of elements of the array should be zero. If |
57 * <code>segment_number</code> is non-zero, the length of the array must be | 56 * <code>segment_number</code> is non-zero, the length of the array must be |
58 * <code>segment_number</code> + 1. | 57 * <code>segment_number</code> + 1. |
59 * | 58 * |
60 * @param[in] target_segment The number returned by | 59 * @param[in] target_segment The number returned by |
61 * <code>GetTargetSegment</code>. | 60 * <code>GetTargetSegment</code>. |
62 * | 61 * |
(...skipping 27 matching lines...) Expand all Loading... |
90 * event. | 89 * event. |
91 * | 90 * |
92 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME | 91 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME |
93 * event. | 92 * event. |
94 * | 93 * |
95 * @return A string var representing the composition text. For non-IME input | 94 * @return A string var representing the composition text. For non-IME input |
96 * events the return value will be an undefined var. | 95 * events the return value will be an undefined var. |
97 */ | 96 */ |
98 struct PP_Var (*GetText)(PP_Resource ime_event); | 97 struct PP_Var (*GetText)(PP_Resource ime_event); |
99 /** | 98 /** |
100 * GetSegmentNumber() returns the number of segments in the composition text. | 99 * GetSegmentCount() returns the number of segments in the composition text. |
101 * | 100 * |
102 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME | 101 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME |
103 * event. | 102 * event. |
104 * | 103 * |
105 * @return The number of segments. For events other than COMPOSITION_UPDATE, | 104 * @return The number of segments. For events other than COMPOSITION_UPDATE, |
106 * returns 0. | 105 * returns 0. |
107 */ | 106 */ |
108 uint32_t (*GetSegmentNumber)(PP_Resource ime_event); | 107 uint32_t (*GetSegmentCount)(PP_Resource ime_event); |
109 /** | 108 /** |
110 * GetSegmentOffset() returns the position of the index-th segmentation point | 109 * GetSegmentOffset() returns the position of the index-th segmentation point |
111 * in the composition text. The position is given by a byte-offset (not a | 110 * in the composition text. The position is given by a byte-offset (not a |
112 * character-offset) of the string returned by GetText(). It always satisfies | 111 * character-offset) of the string returned by GetText(). It always satisfies |
113 * 0=GetSegmentOffset(0) < ... < GetSegmentOffset(i) < GetSegmentOffset(i+1) | 112 * 0=GetSegmentOffset(0) < ... < GetSegmentOffset(i) < GetSegmentOffset(i+1) |
114 * < ... < GetSegmentOffset(GetSegmentNumber())=(byte-length of GetText()). | 113 * < ... < GetSegmentOffset(GetSegmentCount())=(byte-length of GetText()). |
115 * Note that [GetSegmentOffset(i), GetSegmentOffset(i+1)) represents the range | 114 * Note that [GetSegmentOffset(i), GetSegmentOffset(i+1)) represents the range |
116 * of the i-th segment, and hence GetSegmentNumber() can be a valid argument | 115 * of the i-th segment, and hence GetSegmentCount() can be a valid argument |
117 * to this function instead of an off-by-1 error. | 116 * to this function instead of an off-by-1 error. |
118 * | 117 * |
119 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME | 118 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME |
120 * event. | 119 * event. |
121 * | 120 * |
122 * @param[in] index An integer indicating a segment. | 121 * @param[in] index An integer indicating a segment. |
123 * | 122 * |
124 * @return The byte-offset of the segmentation point. If the event is not | 123 * @return The byte-offset of the segmentation point. If the event is not |
125 * COMPOSITION_UPDATE or index is out of range, returns 0. | 124 * COMPOSITION_UPDATE or index is out of range, returns 0. |
126 */ | 125 */ |
(...skipping 16 matching lines...) Expand all Loading... |
143 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME | 142 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME |
144 * event. | 143 * event. |
145 * | 144 * |
146 * @param[out] start The start position of the current selection. | 145 * @param[out] start The start position of the current selection. |
147 * | 146 * |
148 * @param[out] end The end position of the current selection. | 147 * @param[out] end The end position of the current selection. |
149 */ | 148 */ |
150 void (*GetSelection)(PP_Resource ime_event, uint32_t* start, uint32_t* end); | 149 void (*GetSelection)(PP_Resource ime_event, uint32_t* start, uint32_t* end); |
151 }; | 150 }; |
152 | 151 |
153 typedef struct PPB_IMEInputEvent_Dev_0_2 PPB_IMEInputEvent_Dev; | 152 typedef struct PPB_IMEInputEvent_1_0 PPB_IMEInputEvent; |
154 | |
155 struct PPB_IMEInputEvent_Dev_0_1 { | |
156 PP_Bool (*IsIMEInputEvent)(PP_Resource resource); | |
157 struct PP_Var (*GetText)(PP_Resource ime_event); | |
158 uint32_t (*GetSegmentNumber)(PP_Resource ime_event); | |
159 uint32_t (*GetSegmentOffset)(PP_Resource ime_event, uint32_t index); | |
160 int32_t (*GetTargetSegment)(PP_Resource ime_event); | |
161 void (*GetSelection)(PP_Resource ime_event, uint32_t* start, uint32_t* end); | |
162 }; | |
163 /** | 153 /** |
164 * @} | 154 * @} |
165 */ | 155 */ |
166 | 156 |
167 #endif /* PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ */ | 157 #endif /* PPAPI_C_PPB_IME_INPUT_EVENT_H_ */ |
168 | 158 |
OLD | NEW |