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

Unified 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: CompositionInputEvent --> IMEInputEvent_Dev 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ppapi/api/dev/ppb_text_input_dev.idl » ('j') | ppapi/api/dev/ppb_text_input_dev.idl » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/api/dev/ppb_ime_input_event_dev.idl
diff --git a/ppapi/api/dev/ppb_ime_input_event_dev.idl b/ppapi/api/dev/ppb_ime_input_event_dev.idl
new file mode 100644
index 0000000000000000000000000000000000000000..f32d08113954b709ad596fdb42b7534dd446a3b1
--- /dev/null
+++ b/ppapi/api/dev/ppb_ime_input_event_dev.idl
@@ -0,0 +1,95 @@
+/* Copyright (c) 2011 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/**
+ * This file defines the <code>PPB_IMEInputEvent_Dev</code> interface.
+ */
+
+label Chrome {
+ M16 = 0.1
+};
+
+[version=0.1, macro="PPB_IME_INPUT_EVENT_INTERFACE"]
+interface PPB_IMEInputEvent_Dev {
+ /**
+ * IsIMEInputEvent() determines if a resource is an IME event.
+ *
+ * @param[in] resource A <code>PP_Resource</code> corresponding to an event.
+ *
+ * @return <code>PP_TRUE</code> if the given resource is a valid input event.
+ */
+ PP_Bool IsIMEInputEvent([in] PP_Resource resource);
+
+ /**
+ * GetText() returns the composition text as a UTF-8 string for the given IME
+ * event.
+ *
+ * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME
+ * event.
+ *
+ * @return A string var representing the composition text. For non-IME input
+ * events the return value will be an undefined var.
+ */
+ PP_Var GetText([in] PP_Resource ime_event);
+
+ /**
+ * GetSegmentNumber() returns the number of segments in the composition text.
+ *
+ * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME
+ * event.
+ *
+ * @return The number of segments. For events other than COMPOSITION_UPDATE,
+ * returns 0.
+ */
+ uint32_t GetSegmentNumber([in] PP_Resource ime_event);
+
+ /**
+ * GetSegmentAt() returns the start and the end position of the index-th
+ * segment in the composition text. The positions are given by byte-indices of
yzshen1 2011/09/14 17:32:56 byte -> char?
brettw 2011/09/14 23:00:06 We should be careful how this is defined. Is it Un
kinaba 2011/09/15 08:53:50 It is bytes, not Unicode characters. Improved the
+ * the string GetText(). They always satisfy 0 <= start < end <= (Length of
yzshen1 2011/09/14 17:32:56 Just to double check: according to "end <= (Length
kochi 2011/09/15 07:27:19 I just discussed this with Kazuhiro and removed th
kinaba 2011/09/15 08:53:50 Added a comment saying that [start, end) is the on
+ * GetText()) and start[index] < start[index+1]. When the event is not
+ * COMPOSITION_UPDATE or index >= GetSegmentNumber(), nothing happens.
yzshen1 2011/09/14 17:32:56 Is it better to return a PP_Bool?
kinaba 2011/09/15 08:53:50 Done.
+ *
+ * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME
+ * event.
+ *
+ * @param[in] index An integer indicating a segment.
+ *
+ * @param[out] start The start position of the index-th segment.
+ *
+ * @param[out] end The end position of the index-th segment.
+ */
+ void GetSegmentAt([in] PP_Resource ime_event,
+ [in] uint32_t index,
+ [out] uint32_t start,
+ [out] uint32_t end);
+
+ /**
+ * GetTargetSegment() returns the index of the current target segment of
+ * composition.
+ *
+ * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME
+ * event.
+ *
+ * @return An integer indicating the index of the target segment. When there
+ * is no active target segment, or the event is not COMPOSITION_UPDATE,
+ * returns -1.
+ */
+ int32_t GetTargetSegment([in] PP_Resource ime_event);
+
+ /**
+ * GetSelection() returns the range selected by caret in the composition text.
+ *
+ * @param[in] ime_event A <code>PP_Resource</code> corresponding to an IME
+ * event.
+ *
+ * @param[out] start The start position of the current selection.
+ *
+ * @param[out] end The end position of the current selection.
+ */
+ void GetSelection([in] PP_Resource ime_event,
+ [out] uint32_t start,
+ [out] uint32_t end);
+};
« no previous file with comments | « no previous file | ppapi/api/dev/ppb_text_input_dev.idl » ('j') | ppapi/api/dev/ppb_text_input_dev.idl » ('J')

Powered by Google App Engine
This is Rietveld 408576698