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 Oct 5 14:06:02 2011. */ | 6 /* From dev/ppb_ime_input_event_dev.idl modified Thu May 10 17:25:42 2012. */ |
7 | 7 |
8 #ifndef PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ | 8 #ifndef PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ |
9 #define PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ | 9 #define PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_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_macros.h" | 13 #include "ppapi/c/pp_macros.h" |
13 #include "ppapi/c/pp_resource.h" | 14 #include "ppapi/c/pp_resource.h" |
14 #include "ppapi/c/pp_stdint.h" | 15 #include "ppapi/c/pp_stdint.h" |
| 16 #include "ppapi/c/pp_time.h" |
15 #include "ppapi/c/pp_var.h" | 17 #include "ppapi/c/pp_var.h" |
| 18 #include "ppapi/c/ppb_input_event.h" |
16 | 19 |
17 #define PPB_IME_INPUT_EVENT_DEV_INTERFACE_0_1 "PPB_IMEInputEvent(Dev);0.1" | 20 #define PPB_IME_INPUT_EVENT_DEV_INTERFACE_0_1 "PPB_IMEInputEvent(Dev);0.1" |
18 #define PPB_IME_INPUT_EVENT_DEV_INTERFACE PPB_IME_INPUT_EVENT_DEV_INTERFACE_0_1 | 21 #define PPB_IME_INPUT_EVENT_DEV_INTERFACE_0_2 "PPB_IMEInputEvent(Dev);0.2" |
| 22 #define PPB_IME_INPUT_EVENT_DEV_INTERFACE PPB_IME_INPUT_EVENT_DEV_INTERFACE_0_2 |
19 | 23 |
20 /** | 24 /** |
21 * @file | 25 * @file |
22 * This file defines the <code>PPB_IMEInputEvent_Dev</code> interface. | 26 * This file defines the <code>PPB_IMEInputEvent_Dev</code> interface. |
23 */ | 27 */ |
24 | 28 |
25 | 29 |
26 /** | 30 /** |
27 * @addtogroup Interfaces | 31 * @addtogroup Interfaces |
28 * @{ | 32 * @{ |
29 */ | 33 */ |
30 struct PPB_IMEInputEvent_Dev_0_1 { | 34 struct PPB_IMEInputEvent_Dev_0_2 { |
31 /** | 35 /** |
32 * IsIMEInputEvent() determines if a resource is an IME event. | 36 * IsIMEInputEvent() determines if a resource is an IME event. |
33 * | 37 * |
34 * @param[in] resource A <code>PP_Resource</code> corresponding to an event. | 38 * @param[in] resource A <code>PP_Resource</code> corresponding to an event. |
35 * | 39 * |
36 * @return <code>PP_TRUE</code> if the given resource is a valid input event. | 40 * @return <code>PP_TRUE</code> if the given resource is a valid input event. |
37 */ | 41 */ |
38 PP_Bool (*IsIMEInputEvent)(PP_Resource resource); | 42 PP_Bool (*IsIMEInputEvent)(PP_Resource resource); |
39 /** | 43 /** |
| 44 * Create() creates an IME input event with the given parameters. Normally |
| 45 * you will get a mouse event passed through the |
| 46 * <code>HandleInputEvent</code> and will not need to create them, but some |
| 47 * applications may want to create their own for internal use. |
| 48 * |
| 49 * @param[in] instance The instance for which this event occurred. |
| 50 * |
| 51 * @param[in] type A <code>PP_InputEvent_Type</code> identifying the type of |
| 52 * input event. The type must be one of the ime event types. |
| 53 * |
| 54 * @param[in] time_stamp A <code>PP_TimeTicks</code> indicating the time |
| 55 * when the event occurred. |
| 56 * |
| 57 * @param[in] text The string returned by <code>GetText</code>. |
| 58 * |
| 59 * @param[in] segment_number The number returned by |
| 60 * <code>GetSegmentNumber</code>. |
| 61 * |
| 62 * @param[in] segment_offsets The array of numbers returned by |
| 63 * <code>GetSegmentOffset</code>. If <code>segment_number</code> is zero, |
| 64 * the number of elements of the array should be zero. If |
| 65 * <code>segment_number</code> is non-zero, the length of the array must be |
| 66 * <code>segment_number</code> + 1. |
| 67 * |
| 68 * @param[in] target_segment The number returned by |
| 69 * <code>GetTargetSegment</code>. |
| 70 * |
| 71 * @param[in] selection_start The start index returned by |
| 72 * <code>GetSelection</code>. |
| 73 * |
| 74 * @param[in] selection_start The end index returned by |
| 75 * <code>GetSelection</code>. |
| 76 * |
| 77 * @return A <code>PP_Resource</code> containing the new ime input event. |
| 78 */ |
| 79 PP_Resource (*Create)(PP_Instance instance, |
| 80 PP_InputEvent_Type type, |
| 81 PP_TimeTicks time_stamp, |
| 82 struct PP_Var text, |
| 83 uint32_t segment_number, |
| 84 const uint32_t segment_offsets[], |
| 85 int32_t target_segment, |
| 86 uint32_t selection_start, |
| 87 uint32_t selection_end); |
| 88 /** |
40 * GetText() returns the composition text as a UTF-8 string for the given IME | 89 * GetText() returns the composition text as a UTF-8 string for the given IME |
41 * event. | 90 * event. |
42 * | 91 * |
43 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME | 92 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME |
44 * event. | 93 * event. |
45 * | 94 * |
46 * @return A string var representing the composition text. For non-IME input | 95 * @return A string var representing the composition text. For non-IME input |
47 * events the return value will be an undefined var. | 96 * events the return value will be an undefined var. |
48 */ | 97 */ |
49 struct PP_Var (*GetText)(PP_Resource ime_event); | 98 struct PP_Var (*GetText)(PP_Resource ime_event); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME | 143 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME |
95 * event. | 144 * event. |
96 * | 145 * |
97 * @param[out] start The start position of the current selection. | 146 * @param[out] start The start position of the current selection. |
98 * | 147 * |
99 * @param[out] end The end position of the current selection. | 148 * @param[out] end The end position of the current selection. |
100 */ | 149 */ |
101 void (*GetSelection)(PP_Resource ime_event, uint32_t* start, uint32_t* end); | 150 void (*GetSelection)(PP_Resource ime_event, uint32_t* start, uint32_t* end); |
102 }; | 151 }; |
103 | 152 |
104 typedef struct PPB_IMEInputEvent_Dev_0_1 PPB_IMEInputEvent_Dev; | 153 typedef struct PPB_IMEInputEvent_Dev_0_2 PPB_IMEInputEvent_Dev; |
| 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 }; |
105 /** | 163 /** |
106 * @} | 164 * @} |
107 */ | 165 */ |
108 | 166 |
109 #endif /* PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ */ | 167 #endif /* PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ */ |
110 | 168 |
OLD | NEW |