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

Unified Diff: ppapi/c/ppb_input_event.h

Issue 7621010: Never submit: tentative Pepper IME. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: snapshot. 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 | « ppapi/c/dev/ppb_text_input_dev.h ('k') | ppapi/cpp/dev/text_input_dev.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/c/ppb_input_event.h
diff --git a/ppapi/c/ppb_input_event.h b/ppapi/c/ppb_input_event.h
index 8a73279e4ebc51591764733afdd94b3da838d0f6..3abdc961ea02bc129cbdd7b8815f9abf37edb76f 100644
--- a/ppapi/c/ppb_input_event.h
+++ b/ppapi/c/ppb_input_event.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From ppb_input_event.idl modified Wed Aug 24 09:43:38 2011. */
+/* From ppb_input_event.idl modified Tue Sep 13 11:17:55 2011. */
#ifndef PPAPI_C_PPB_INPUT_EVENT_H_
#define PPAPI_C_PPB_INPUT_EVENT_H_
@@ -31,6 +31,13 @@
#define PPB_KEYBOARD_INPUT_EVENT_INTERFACE \
PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0
+#define PPB_COMPOSITION_INPUT_EVENT_INTERFACE_1_0 \
+ "PPB_CompositionInputEvent;1.0"
+#define PPB_COMPOSITION_INPUT_EVENT_INTERFACE_1_2 \
+ "PPB_CompositionInputEvent;1.2"
+#define PPB_COMPOSITION_INPUT_EVENT_INTERFACE \
+ PPB_COMPOSITION_INPUT_EVENT_INTERFACE_1_2
+
/**
* @file
* This file defines the Input Event interfaces.
@@ -117,7 +124,31 @@ typedef enum {
*
* Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class.
*/
- PP_INPUTEVENT_TYPE_CONTEXTMENU = 10
+ PP_INPUTEVENT_TYPE_CONTEXTMENU = 10,
+ /**
+ * Notification that an input method composition process has just started.
+ *
+ * Register for this event using the PP_INPUTEVENT_CLASS_IME class.
+ */
+ PP_INPUTEVENT_TYPE_COMPOSITION_START = 11,
+ /**
+ * Notification that the input method composition string is updated.
+ *
+ * Register for this event using the PP_INPUTEVENT_CLASS_IME class.
+ */
+ PP_INPUTEVENT_TYPE_COMPOSITION_UPDATE = 12,
+ /**
+ * Notification that an input method composition process has completed.
+ *
+ * Register for this event using the PP_INPUTEVENT_CLASS_IME class.
+ */
+ PP_INPUTEVENT_TYPE_COMPOSITION_END = 13,
+ /**
+ * Notification that an input method committed a string.
+ *
+ * Register for this event using the PP_INPUTEVENT_CLASS_IME class.
+ */
+ PP_INPUTEVENT_TYPE_IME_TEXT = 14
} PP_InputEvent_Type;
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_InputEvent_Type, 4);
@@ -674,6 +705,78 @@ struct PPB_KeyboardInputEvent {
*/
struct PP_Var (*GetCharacterText)(PP_Resource character_event);
};
+
+/**
+ * The <code>PPB_CompositionInputEvent</code> interface contains pointers to
+ * several functions related to composition input events.
+ */
+struct PPB_CompositionInputEvent {
+ /**
+ * IsCompositionInputEvent() determines if a resource is a composition 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 (*IsCompositionInputEvent)(PP_Resource resource);
+ /**
+ * GetText() returns the composition text as a UTF-8 string for the given
+ * composition event.
+ *
+ * @param[in] composition_event A <code>PP_Resource</code> corresponding to a
+ * composition event.
+ *
+ * @return A string var representing the composition text. For non-composition
+ * input events the return value will be an undefined var.
+ */
+ struct PP_Var (*GetText)(PP_Resource composition_event);
+ /**
+ * GetSegments() returns the segmentation information by a list of indices of
+ * a UTF-8 string returned by GetText. Each segment is numbered from 0 to
+ * size-1, and the ith segment begins from segments[2*i] and ends with
+ * segments[2*i+1]. For events other than COMPOSITION_UPDATE, the function
+ * returns an empty array.
+ *
+ * @param[in] composition_event A <code>PP_Resource</code> corresponding to a
+ * composition event.
+ *
+ * @param[out] segments A pointer to an array containing segment information.
+ *
+ * @param[out] size The number of segments.
+ */
+ void (*GetSegments)(PP_Resource composition_event,
+ void* segments,
+ uint32_t* size);
+ /**
+ * GetTargetSegment() returns the number of the current target segment of
+ * composition.
+ *
+ * @param[in] composition_event A <code>PP_Resource</code> corresponding to a
+ * composition 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)(PP_Resource composition_event);
+ /**
+ * GetSelection() returns the caret position in the current composition text.
+ *
+ * @param[in] composition_event A <code>PP_Resource</code> corresponding to a
+ * composition event.
+ *
+ * @param[out] start Start index.
+ *
+ * @param[out] end End index.
+ */
+ void (*GetSelection)(PP_Resource composition_event,
+ uint32_t* start,
+ uint32_t* end);
+};
+
+struct PPB_CompositionInputEvent_1_0 {
+
+};
/**
* @}
*/
« no previous file with comments | « ppapi/c/dev/ppb_text_input_dev.h ('k') | ppapi/cpp/dev/text_input_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698