Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: ppapi/c/dev/ppb_ime_input_event_dev.h

Issue 10391101: Test for Pepper IME events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments from kochi & merge master. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/api/dev/ppb_ime_input_event_dev.idl ('k') | ppapi/cpp/dev/ime_input_event_dev.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 Wed May 16 17:08:03 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 {
35 /**
36 * Create() creates an IME input event with the given parameters. Normally
37 * 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
39 * their own for internal use.
40 *
41 * @param[in] instance The instance for which this event occurred.
42 *
43 * @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.
45 *
46 * @param[in] time_stamp A <code>PP_TimeTicks</code> indicating the time
47 * when the event occurred.
48 *
49 * @param[in] text The string returned by <code>GetText</code>.
50 *
51 * @param[in] segment_number The number returned by
52 * <code>GetSegmentNumber</code>.
53 *
54 * @param[in] segment_offsets The array of numbers returned by
55 * <code>GetSegmentOffset</code>. If <code>segment_number</code> is zero,
56 * 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
58 * <code>segment_number</code> + 1.
59 *
60 * @param[in] target_segment The number returned by
61 * <code>GetTargetSegment</code>.
62 *
63 * @param[in] selection_start The start index returned by
64 * <code>GetSelection</code>.
65 *
66 * @param[in] selection_end The end index returned by
67 * <code>GetSelection</code>.
68 *
69 * @return A <code>PP_Resource</code> containing the new IME input event.
70 */
71 PP_Resource (*Create)(PP_Instance instance,
72 PP_InputEvent_Type type,
73 PP_TimeTicks time_stamp,
74 struct PP_Var text,
75 uint32_t segment_number,
76 const uint32_t segment_offsets[],
77 int32_t target_segment,
78 uint32_t selection_start,
79 uint32_t selection_end);
31 /** 80 /**
32 * IsIMEInputEvent() determines if a resource is an IME event. 81 * IsIMEInputEvent() determines if a resource is an IME event.
33 * 82 *
34 * @param[in] resource A <code>PP_Resource</code> corresponding to an event. 83 * @param[in] resource A <code>PP_Resource</code> corresponding to an event.
35 * 84 *
36 * @return <code>PP_TRUE</code> if the given resource is a valid input event. 85 * @return <code>PP_TRUE</code> if the given resource is a valid input event.
37 */ 86 */
38 PP_Bool (*IsIMEInputEvent)(PP_Resource resource); 87 PP_Bool (*IsIMEInputEvent)(PP_Resource resource);
39 /** 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
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « ppapi/api/dev/ppb_ime_input_event_dev.idl ('k') | ppapi/cpp/dev/ime_input_event_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698