Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 * Use of this source code is governed by a BSD-style license that can be | |
| 3 * found in the LICENSE file. | |
| 4 */ | |
| 5 | |
| 6 /* From dev/ppb_ime_input_event_dev.idl modified Wed Sep 14 12:53:12 2011. */ | |
| 7 | |
| 8 #ifndef PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ | |
| 9 #define PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ | |
| 10 | |
| 11 #include "ppapi/c/pp_bool.h" | |
| 12 #include "ppapi/c/pp_macros.h" | |
| 13 #include "ppapi/c/pp_resource.h" | |
| 14 #include "ppapi/c/pp_stdint.h" | |
| 15 #include "ppapi/c/pp_var.h" | |
| 16 | |
| 17 #define PPB_IME_INPUT_EVENT_INTERFACE_0_1 "PPB_IMEInputEvent(Dev);0.1" | |
|
yzshen1
2011/09/14 17:32:56
You should have 'DEV' in the definition:
PPB_IME_I
kinaba
2011/09/15 08:53:50
Done.
| |
| 18 #define PPB_IME_INPUT_EVENT_INTERFACE PPB_IME_INPUT_EVENT_INTERFACE_0_1 | |
| 19 | |
| 20 /** | |
| 21 * @file | |
| 22 * This file defines the <code>PPB_IMEInputEvent_Dev</code> interface. | |
| 23 */ | |
| 24 | |
| 25 | |
| 26 /** | |
| 27 * @addtogroup Interfaces | |
| 28 * @{ | |
| 29 */ | |
| 30 struct PPB_IMEInputEvent_Dev { | |
| 31 /** | |
| 32 * IsIMEInputEvent() determines if a resource is an IME event. | |
| 33 * | |
| 34 * @param[in] resource A <code>PP_Resource</code> corresponding to an event. | |
| 35 * | |
| 36 * @return <code>PP_TRUE</code> if the given resource is a valid input event. | |
| 37 */ | |
| 38 PP_Bool (*IsIMEInputEvent)(PP_Resource resource); | |
| 39 /** | |
| 40 * GetText() returns the composition text as a UTF-8 string for the given IME | |
| 41 * event. | |
| 42 * | |
| 43 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME | |
| 44 * event. | |
| 45 * | |
| 46 * @return A string var representing the composition text. For non-IME input | |
| 47 * events the return value will be an undefined var. | |
| 48 */ | |
| 49 struct PP_Var (*GetText)(PP_Resource ime_event); | |
| 50 /** | |
| 51 * GetSegmentNumber() returns the number of segments in the composition text. | |
| 52 * | |
| 53 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME | |
| 54 * event. | |
| 55 * | |
| 56 * @return The number of segments. For events other than COMPOSITION_UPDATE, | |
| 57 * returns 0. | |
| 58 */ | |
| 59 uint32_t (*GetSegmentNumber)(PP_Resource ime_event); | |
| 60 /** | |
| 61 * GetSegmentAt() returns the start and the end position of the index-th | |
| 62 * segment in the composition text. The positions are given by byte-indices of | |
| 63 * the string GetText(). They always satisfy 0 <= start < end <= (Length of | |
| 64 * GetText()) and start[index] < start[index+1]. When the event is not | |
| 65 * COMPOSITION_UPDATE or index >= GetSegmentNumber(), nothing happens. | |
| 66 * | |
| 67 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME | |
| 68 * event. | |
| 69 * | |
| 70 * @param[in] index An integer indicating a segment. | |
| 71 * | |
| 72 * @param[out] start The start position of the index-th segment. | |
| 73 * | |
| 74 * @param[out] end The end position of the index-th segment. | |
| 75 */ | |
| 76 void (*GetSegmentAt)(PP_Resource ime_event, | |
| 77 uint32_t index, | |
| 78 uint32_t* start, | |
| 79 uint32_t* end); | |
| 80 /** | |
| 81 * GetTargetSegment() returns the index of the current target segment of | |
| 82 * composition. | |
| 83 * | |
| 84 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME | |
| 85 * event. | |
| 86 * | |
| 87 * @return An integer indicating the index of the target segment. When there | |
| 88 * is no active target segment, or the event is not COMPOSITION_UPDATE, | |
| 89 * returns -1. | |
| 90 */ | |
| 91 int32_t (*GetTargetSegment)(PP_Resource ime_event); | |
| 92 /** | |
| 93 * GetSelection() returns the range selected by caret in the composition text. | |
| 94 * | |
| 95 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME | |
| 96 * event. | |
| 97 * | |
| 98 * @param[out] start The start position of the current selection. | |
| 99 * | |
| 100 * @param[out] end The end position of the current selection. | |
| 101 */ | |
| 102 void (*GetSelection)(PP_Resource ime_event, uint32_t* start, uint32_t* end); | |
| 103 }; | |
| 104 /** | |
| 105 * @} | |
| 106 */ | |
| 107 | |
| 108 #endif /* PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ */ | |
| 109 | |
| OLD | NEW |