| OLD | NEW |
| 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 Thu Sep 15 17:06:09 2011. */ | 6 /* From dev/ppb_ime_input_event_dev.idl modified Wed Sep 21 11:35:08 2011. */ |
| 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_macros.h" | 12 #include "ppapi/c/pp_macros.h" |
| 13 #include "ppapi/c/pp_resource.h" | 13 #include "ppapi/c/pp_resource.h" |
| 14 #include "ppapi/c/pp_stdint.h" | 14 #include "ppapi/c/pp_stdint.h" |
| 15 #include "ppapi/c/pp_var.h" | 15 #include "ppapi/c/pp_var.h" |
| 16 | 16 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 * GetSegmentNumber() returns the number of segments in the composition text. | 51 * GetSegmentNumber() returns the number of segments in the composition text. |
| 52 * | 52 * |
| 53 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME | 53 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME |
| 54 * event. | 54 * event. |
| 55 * | 55 * |
| 56 * @return The number of segments. For events other than COMPOSITION_UPDATE, | 56 * @return The number of segments. For events other than COMPOSITION_UPDATE, |
| 57 * returns 0. | 57 * returns 0. |
| 58 */ | 58 */ |
| 59 uint32_t (*GetSegmentNumber)(PP_Resource ime_event); | 59 uint32_t (*GetSegmentNumber)(PP_Resource ime_event); |
| 60 /** | 60 /** |
| 61 * GetSegmentAt() returns the start and the end position of the index-th | 61 * GetSegmentOffset() returns the position of the index-th segmentation point |
| 62 * segment in the composition text. The positions are given by byte-offsets | 62 * in the composition text. The position is given by a byte-offset (not a |
| 63 * (not character-offsets) of the string returned by GetText(). The range of | 63 * character-offset) of the string returned by GetText(). It always satisfies |
| 64 * the segment extends from start (inclusive) to end (exclusive). They satisfy | 64 * 0=GetSegmentOffset(0) < ... < GetSegmentOffset(i) < GetSegmentOffset(i+1) |
| 65 * 0 <= start < end <= (byte-length of GetText()). When the event is not | 65 * < ... < GetSegmentOffset(GetSegmentNumber())=(byte-length of GetText()). |
| 66 * COMPOSITION_UPDATE or index >= GetSegmentNumber(), the function returns | 66 * Note that [GetSegmentOffset(i), GetSegmentOffset(i+1)) represents the range |
| 67 * PP_FALSE and nothing else happens. | 67 * of the i-th segment, and hence GetSegmentNumber() can be a valid argument |
| 68 * to this function instead of an off-by-1 error. |
| 68 * | 69 * |
| 69 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME | 70 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME |
| 70 * event. | 71 * event. |
| 71 * | 72 * |
| 72 * @param[in] index An integer indicating a segment. | 73 * @param[in] index An integer indicating a segment. |
| 73 * | 74 * |
| 74 * @param[out] start The start position of the index-th segment. | 75 * @return The byte-offset of the segmentation point. If the event is not |
| 75 * | 76 * COMPOSITION_UPDATE or index is out of range, returns 0. |
| 76 * @param[out] end The end position of the index-th segment. | |
| 77 * | |
| 78 * @return PP_TRUE when the start and the end position is successfully | |
| 79 * obtained, and PP_FALSE otherwise. | |
| 80 */ | 77 */ |
| 81 PP_Bool (*GetSegmentAt)(PP_Resource ime_event, | 78 uint32_t (*GetSegmentOffset)(PP_Resource ime_event, uint32_t index); |
| 82 uint32_t index, | |
| 83 uint32_t* start, | |
| 84 uint32_t* end); | |
| 85 /** | 79 /** |
| 86 * GetTargetSegment() returns the index of the current target segment of | 80 * GetTargetSegment() returns the index of the current target segment of |
| 87 * composition. | 81 * composition. |
| 88 * | 82 * |
| 89 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME | 83 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME |
| 90 * event. | 84 * event. |
| 91 * | 85 * |
| 92 * @return An integer indicating the index of the target segment. When there | 86 * @return An integer indicating the index of the target segment. When there |
| 93 * is no active target segment, or the event is not COMPOSITION_UPDATE, | 87 * is no active target segment, or the event is not COMPOSITION_UPDATE, |
| 94 * returns -1. | 88 * returns -1. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 105 * @param[out] end The end position of the current selection. | 99 * @param[out] end The end position of the current selection. |
| 106 */ | 100 */ |
| 107 void (*GetSelection)(PP_Resource ime_event, uint32_t* start, uint32_t* end); | 101 void (*GetSelection)(PP_Resource ime_event, uint32_t* start, uint32_t* end); |
| 108 }; | 102 }; |
| 109 /** | 103 /** |
| 110 * @} | 104 * @} |
| 111 */ | 105 */ |
| 112 | 106 |
| 113 #endif /* PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ */ | 107 #endif /* PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ */ |
| 114 | 108 |
| OLD | NEW |