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

Side by Side Diff: ppapi/api/dev/ppb_ime_input_event_dev.idl

Issue 7882004: Declarations for Pepper IME API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clarified the specification of GetSegmentAt(). Created 9 years, 3 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 | « no previous file | ppapi/api/dev/ppb_text_input_dev.idl » ('j') | ppapi/api/ppb_input_event.idl » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 /**
7 * This file defines the <code>PPB_IMEInputEvent_Dev</code> interface.
8 */
9
10 label Chrome {
11 M16 = 0.1
12 };
13
14 [version=0.1, macro="PPB_IME_INPUT_EVENT_DEV_INTERFACE"]
15 interface PPB_IMEInputEvent_Dev {
James Su 2011/09/16 06:39:53 Is this event only for composition text or for bot
16 /**
17 * IsIMEInputEvent() determines if a resource is an IME event.
18 *
19 * @param[in] resource A <code>PP_Resource</code> corresponding to an event.
20 *
21 * @return <code>PP_TRUE</code> if the given resource is a valid input event.
22 */
23 PP_Bool IsIMEInputEvent([in] PP_Resource resource);
24
25 /**
26 * GetText() returns the composition text as a UTF-8 string for the given IME
27 * event.
28 *
29 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME
30 * event.
31 *
32 * @return A string var representing the composition text. For non-IME input
33 * events the return value will be an undefined var.
34 */
35 PP_Var GetText([in] PP_Resource ime_event);
36
37 /**
38 * GetSegmentNumber() returns the number of segments in the composition text.
39 *
40 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME
41 * event.
42 *
43 * @return The number of segments. For events other than COMPOSITION_UPDATE,
44 * returns 0.
45 */
46 uint32_t GetSegmentNumber([in] PP_Resource ime_event);
47
48 /**
49 * GetSegmentAt() returns the start and the end position of the index-th
50 * segment in the composition text. The positions are given by byte-offsets
51 * (not character-offsets) of the string returned by GetText(). The range of
52 * the segment extends from start (inclusive) to end (exclusive). They satisfy
53 * 0 <= start < end <= (byte-length of GetText()). When the event is not
54 * COMPOSITION_UPDATE or index >= GetSegmentNumber(), the function returns
55 * PP_FALSE and nothing else happens.
56 *
57 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME
58 * event.
59 *
60 * @param[in] index An integer indicating a segment.
61 *
62 * @param[out] start The start position of the index-th segment.
63 *
64 * @param[out] end The end position of the index-th segment.
65 *
66 * @return PP_TRUE when the start and the end position is successfully
67 * obtained, and PP_FALSE otherwise.
68 */
69 PP_Bool GetSegmentAt([in] PP_Resource ime_event,
70 [in] uint32_t index,
71 [out] uint32_t start,
72 [out] uint32_t end);
James Su 2011/09/16 06:39:53 The segmentation information should only have a se
73
74 /**
75 * GetTargetSegment() returns the index of the current target segment of
76 * composition.
77 *
78 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME
79 * event.
80 *
81 * @return An integer indicating the index of the target segment. When there
82 * is no active target segment, or the event is not COMPOSITION_UPDATE,
83 * returns -1.
84 */
85 int32_t GetTargetSegment([in] PP_Resource ime_event);
86
87 /**
88 * GetSelection() returns the range selected by caret in the composition text.
89 *
90 * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME
91 * event.
92 *
93 * @param[out] start The start position of the current selection.
94 *
95 * @param[out] end The end position of the current selection.
96 */
97 void GetSelection([in] PP_Resource ime_event,
98 [out] uint32_t start,
99 [out] uint32_t end);
100 };
OLDNEW
« no previous file with comments | « no previous file | ppapi/api/dev/ppb_text_input_dev.idl » ('j') | ppapi/api/ppb_input_event.idl » ('J')

Powered by Google App Engine
This is Rietveld 408576698