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

Side by Side Diff: ppapi/c/ppb_input_event.h

Issue 7882004: Declarations for Pepper IME API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
OLDNEW
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 ppb_input_event.idl modified Wed Aug 24 09:43:38 2011. */ 6 /* From ppb_input_event.idl modified Tue Sep 13 11:17:55 2011. */
7 7
8 #ifndef PPAPI_C_PPB_INPUT_EVENT_H_ 8 #ifndef PPAPI_C_PPB_INPUT_EVENT_H_
9 #define PPAPI_C_PPB_INPUT_EVENT_H_ 9 #define PPAPI_C_PPB_INPUT_EVENT_H_
10 10
11 #include "ppapi/c/pp_bool.h" 11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_instance.h" 12 #include "ppapi/c/pp_instance.h"
13 #include "ppapi/c/pp_macros.h" 13 #include "ppapi/c/pp_macros.h"
14 #include "ppapi/c/pp_point.h" 14 #include "ppapi/c/pp_point.h"
15 #include "ppapi/c/pp_resource.h" 15 #include "ppapi/c/pp_resource.h"
16 #include "ppapi/c/pp_stdint.h" 16 #include "ppapi/c/pp_stdint.h"
17 #include "ppapi/c/pp_time.h" 17 #include "ppapi/c/pp_time.h"
18 #include "ppapi/c/pp_var.h" 18 #include "ppapi/c/pp_var.h"
19 19
20 #define PPB_INPUT_EVENT_INTERFACE_1_0 "PPB_InputEvent;1.0" 20 #define PPB_INPUT_EVENT_INTERFACE_1_0 "PPB_InputEvent;1.0"
21 #define PPB_INPUT_EVENT_INTERFACE PPB_INPUT_EVENT_INTERFACE_1_0 21 #define PPB_INPUT_EVENT_INTERFACE PPB_INPUT_EVENT_INTERFACE_1_0
22 22
23 #define PPB_MOUSE_INPUT_EVENT_INTERFACE_1_0 "PPB_MouseInputEvent;1.0" 23 #define PPB_MOUSE_INPUT_EVENT_INTERFACE_1_0 "PPB_MouseInputEvent;1.0"
24 #define PPB_MOUSE_INPUT_EVENT_INTERFACE_1_1 "PPB_MouseInputEvent;1.1" 24 #define PPB_MOUSE_INPUT_EVENT_INTERFACE_1_1 "PPB_MouseInputEvent;1.1"
25 #define PPB_MOUSE_INPUT_EVENT_INTERFACE PPB_MOUSE_INPUT_EVENT_INTERFACE_1_1 25 #define PPB_MOUSE_INPUT_EVENT_INTERFACE PPB_MOUSE_INPUT_EVENT_INTERFACE_1_1
26 26
27 #define PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0 "PPB_WheelInputEvent;1.0" 27 #define PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0 "PPB_WheelInputEvent;1.0"
28 #define PPB_WHEEL_INPUT_EVENT_INTERFACE PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0 28 #define PPB_WHEEL_INPUT_EVENT_INTERFACE PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0
29 29
30 #define PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0 "PPB_KeyboardInputEvent;1.0" 30 #define PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0 "PPB_KeyboardInputEvent;1.0"
31 #define PPB_KEYBOARD_INPUT_EVENT_INTERFACE \ 31 #define PPB_KEYBOARD_INPUT_EVENT_INTERFACE \
32 PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0 32 PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0
33 33
34 #define PPB_COMPOSITION_INPUT_EVENT_INTERFACE_1_0 \
35 "PPB_CompositionInputEvent;1.0"
36 #define PPB_COMPOSITION_INPUT_EVENT_INTERFACE_1_2 \
37 "PPB_CompositionInputEvent;1.2"
38 #define PPB_COMPOSITION_INPUT_EVENT_INTERFACE \
39 PPB_COMPOSITION_INPUT_EVENT_INTERFACE_1_2
40
34 /** 41 /**
35 * @file 42 * @file
36 * This file defines the Input Event interfaces. 43 * This file defines the Input Event interfaces.
37 */ 44 */
38 45
39 46
40 /** 47 /**
41 * @addtogroup Enums 48 * @addtogroup Enums
42 * @{ 49 * @{
43 */ 50 */
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 * on the key, locale, and operating system. 117 * on the key, locale, and operating system.
111 * 118 *
112 * Register for this event using the PP_INPUTEVENT_CLASS_KEYBOARD class. 119 * Register for this event using the PP_INPUTEVENT_CLASS_KEYBOARD class.
113 */ 120 */
114 PP_INPUTEVENT_TYPE_CHAR = 9, 121 PP_INPUTEVENT_TYPE_CHAR = 9,
115 /** 122 /**
116 * TODO(brettw) when is this used? 123 * TODO(brettw) when is this used?
117 * 124 *
118 * Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class. 125 * Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class.
119 */ 126 */
120 PP_INPUTEVENT_TYPE_CONTEXTMENU = 10 127 PP_INPUTEVENT_TYPE_CONTEXTMENU = 10,
128 /**
129 * Notification that an input method composition process has just started.
130 *
131 * Register for this event using the PP_INPUTEVENT_CLASS_IME class.
132 */
133 PP_INPUTEVENT_TYPE_COMPOSITION_START = 11,
134 /**
135 * Notification that the input method composition string is updated.
136 *
137 * Register for this event using the PP_INPUTEVENT_CLASS_IME class.
138 */
139 PP_INPUTEVENT_TYPE_COMPOSITION_UPDATE = 12,
140 /**
141 * Notification that an input method composition process has completed.
142 *
143 * Register for this event using the PP_INPUTEVENT_CLASS_IME class.
144 */
145 PP_INPUTEVENT_TYPE_COMPOSITION_END = 13,
146 /**
147 * Notification that an input method committed a string.
148 *
149 * Register for this event using the PP_INPUTEVENT_CLASS_IME class.
150 */
151 PP_INPUTEVENT_TYPE_IME_TEXT = 14
121 } PP_InputEvent_Type; 152 } PP_InputEvent_Type;
122 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_InputEvent_Type, 4); 153 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_InputEvent_Type, 4);
123 154
124 /** 155 /**
125 * This enumeration contains event modifier constants. Each modifier is one 156 * This enumeration contains event modifier constants. Each modifier is one
126 * bit. Retrieve the modifiers from an input event using the GetEventModifiers 157 * bit. Retrieve the modifiers from an input event using the GetEventModifiers
127 * function on PPB_InputEvent. 158 * function on PPB_InputEvent.
128 */ 159 */
129 typedef enum { 160 typedef enum {
130 PP_INPUTEVENT_MODIFIER_SHIFTKEY = 1 << 0, 161 PP_INPUTEVENT_MODIFIER_SHIFTKEY = 1 << 0,
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 * 698 *
668 * @param[in] character_event A <code>PP_Resource</code> corresponding to a 699 * @param[in] character_event A <code>PP_Resource</code> corresponding to a
669 * keyboard event. 700 * keyboard event.
670 * 701 *
671 * @return A string var representing a single typed character for character 702 * @return A string var representing a single typed character for character
672 * input events. For non-character input events the return value will be an 703 * input events. For non-character input events the return value will be an
673 * undefined var. 704 * undefined var.
674 */ 705 */
675 struct PP_Var (*GetCharacterText)(PP_Resource character_event); 706 struct PP_Var (*GetCharacterText)(PP_Resource character_event);
676 }; 707 };
708
709 /**
710 * The <code>PPB_CompositionInputEvent</code> interface contains pointers to
711 * several functions related to composition input events.
712 */
713 struct PPB_CompositionInputEvent {
714 /**
715 * IsCompositionInputEvent() determines if a resource is a composition event.
716 *
717 * @param[in] resource A <code>PP_Resource</code> corresponding to an event.
718 *
719 * @return <code>PP_TRUE</code> if the given resource is a valid input event.
720 */
721 PP_Bool (*IsCompositionInputEvent)(PP_Resource resource);
722 /**
723 * GetText() returns the composition text as a UTF-8 string for the given
724 * composition event.
725 *
726 * @param[in] composition_event A <code>PP_Resource</code> corresponding to a
727 * composition event.
728 *
729 * @return A string var representing the composition text. For non-composition
730 * input events the return value will be an undefined var.
731 */
732 struct PP_Var (*GetText)(PP_Resource composition_event);
733 /**
734 * GetSegments() returns the segmentation information by a list of indices of
735 * a UTF-8 string returned by GetText. Each segment is numbered from 0 to
736 * size-1, and the ith segment begins from segments[2*i] and ends with
737 * segments[2*i+1]. For events other than COMPOSITION_UPDATE, the function
738 * returns an empty array.
739 *
740 * @param[in] composition_event A <code>PP_Resource</code> corresponding to a
741 * composition event.
742 *
743 * @param[out] segments A pointer to an array containing segment information.
744 *
745 * @param[out] size The number of segments.
746 */
747 void (*GetSegments)(PP_Resource composition_event,
748 void* segments,
749 uint32_t* size);
750 /**
751 * GetTargetSegment() returns the number of the current target segment of
752 * composition.
753 *
754 * @param[in] composition_event A <code>PP_Resource</code> corresponding to a
755 * composition event.
756 *
757 * @return An integer indicating the index of the target segment. When there
758 * is no active target segment, or the event is not COMPOSITION_UPDATE,
759 * returns -1.
760 */
761 int32_t (*GetTargetSegment)(PP_Resource composition_event);
762 /**
763 * GetSelection() returns the caret position in the current composition text.
764 *
765 * @param[in] composition_event A <code>PP_Resource</code> corresponding to a
766 * composition event.
767 *
768 * @param[out] start Start index.
769 *
770 * @param[out] end End index.
771 */
772 void (*GetSelection)(PP_Resource composition_event,
773 uint32_t* start,
774 uint32_t* end);
775 };
776
777 struct PPB_CompositionInputEvent_1_0 {
778
779 };
677 /** 780 /**
678 * @} 781 * @}
679 */ 782 */
680 783
681 #endif /* PPAPI_C_PPB_INPUT_EVENT_H_ */ 784 #endif /* PPAPI_C_PPB_INPUT_EVENT_H_ */
682 785
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698