| OLD | NEW |
| (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 /* From dev/ppb_text_input_dev.idl modified Tue Sep 13 10:29:19 2011. */ |
| 7 |
| 8 #ifndef PPAPI_C_DEV_PPB_TEXT_INPUT_DEV_H_ |
| 9 #define PPAPI_C_DEV_PPB_TEXT_INPUT_DEV_H_ |
| 10 |
| 11 #include "ppapi/c/pp_instance.h" |
| 12 #include "ppapi/c/pp_macros.h" |
| 13 #include "ppapi/c/pp_point.h" |
| 14 #include "ppapi/c/pp_rect.h" |
| 15 #include "ppapi/c/pp_size.h" |
| 16 #include "ppapi/c/pp_stdint.h" |
| 17 |
| 18 #define PPB_TEXTINPUT_DEV_INTERFACE_0_1 "PPB_TextInput(Dev);0.1" |
| 19 #define PPB_TEXTINPUT_DEV_INTERFACE PPB_TEXTINPUT_DEV_INTERFACE_0_1 |
| 20 |
| 21 /** |
| 22 * @file |
| 23 * Implementation of the TextInput interface. |
| 24 */ |
| 25 |
| 26 |
| 27 /** |
| 28 * @addtogroup Enums |
| 29 * @{ |
| 30 */ |
| 31 /** |
| 32 * PP_TextInput_Type is used to indicate the status of a plugin in regard to |
| 33 * text input. Intentionally kept sync with WebKit::WebTextInputType defined in: |
| 34 * third_party/WebKit/Source/WebKit/chromium/public/WebTextInputType.h |
| 35 */ |
| 36 typedef enum { |
| 37 /** |
| 38 * Input caret is not in an editable node, no input method shall be used. |
| 39 */ |
| 40 PP_TEXTINPUT_TYPE_NONE = 0, |
| 41 /** |
| 42 * Input caret is in a normal editable node, any input method can be used. |
| 43 */ |
| 44 PP_TEXTINPUT_TYPE_TEXT = 1, |
| 45 /** |
| 46 * Input caret is in a password box, an input method may be used only if |
| 47 * it's suitable for password input. |
| 48 */ |
| 49 PP_TEXTINPUT_TYPE_PASSWORD = 2, |
| 50 PP_TEXTINPUT_TYPE_SEARCH = 3, |
| 51 PP_TEXTINPUT_TYPE_EMAIL = 4, |
| 52 PP_TEXTINPUT_TYPE_NUMBER = 5, |
| 53 PP_TEXTINPUT_TYPE_TELEPHONE = 6, |
| 54 PP_TEXTINPUT_TYPE_URL = 7 |
| 55 } PP_TextInput_Type; |
| 56 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TextInput_Type, 4); |
| 57 /** |
| 58 * @} |
| 59 */ |
| 60 |
| 61 /** |
| 62 * @addtogroup Interfaces |
| 63 * @{ |
| 64 */ |
| 65 struct PPB_TextInput_Dev { |
| 66 /** |
| 67 * Informs the browser about the current text input mode of the plugin. |
| 68 */ |
| 69 void (*SetTextInputType)(PP_Instance instance, PP_TextInput_Type type); |
| 70 /** |
| 71 * Informs the browser about the coordinates of the text input caret, and the |
| 72 * bounding box of the text input area. The browser uses the information to |
| 73 * locate the composition candidate window, etc. |
| 74 */ |
| 75 void (*UpdateCaretPosition)(PP_Instance instance, |
| 76 const struct PP_Rect* caret, |
| 77 const struct PP_Rect* boundingBox); |
| 78 /** |
| 79 * Force to commit the current composition text (if any). |
| 80 */ |
| 81 void (*ConfirmCompositionText)(PP_Instance instance); |
| 82 /** |
| 83 * Cancel the current composition (if any). |
| 84 */ |
| 85 void (*CancelCompositionText)(PP_Instance instance); |
| 86 }; |
| 87 /** |
| 88 * @} |
| 89 */ |
| 90 |
| 91 #endif /* PPAPI_C_DEV_PPB_TEXT_INPUT_DEV_H_ */ |
| 92 |
| OLD | NEW |