OLD | NEW |
---|---|
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 /** | 6 /** |
7 * This file defines the <code>PPB_TextInput_Dev</code> interface. | 7 * This file defines the <code>PPB_TextInput</code> interface. |
8 */ | 8 */ |
9 | 9 |
10 label Chrome { | 10 label Chrome { |
11 M16 = 0.1, | 11 M30 = 1.0 |
12 M19 = 0.2 | |
13 }; | 12 }; |
14 | 13 |
15 /** | 14 /** |
16 * PP_TextInput_Type is used to indicate the status of a plugin in regard to | 15 * PP_TextInput_Type is used to indicate the status of a plugin in regard to |
17 * text input. | 16 * text input. |
18 */ | 17 */ |
19 [assert_size(4)] | 18 [assert_size(4)] |
20 enum PP_TextInput_Type { | 19 enum PP_TextInput_Type { |
21 /** | 20 /** |
22 * Input caret is not in an editable mode, no input method shall be used. | 21 * Input caret is not in an editable mode, no input method shall be used. |
23 */ | 22 */ |
24 PP_TEXTINPUT_TYPE_NONE = 0, | 23 PP_TEXTINPUT_TYPE_NONE = 0, |
25 /** | 24 /** |
26 * Input caret is in a normal editable mode, any input method can be used. | 25 * Input caret is in a normal editable mode, any input method can be used. |
27 */ | 26 */ |
28 PP_TEXTINPUT_TYPE_TEXT = 1, | 27 PP_TEXTINPUT_TYPE_TEXT = 1, |
29 /** | 28 /** |
30 * Input caret is in a password box, an input method may be used only if | 29 * Input caret is in a password box, an input method may be used only if |
31 * it's suitable for password input. | 30 * it's suitable for password input. |
32 */ | 31 */ |
33 PP_TEXTINPUT_TYPE_PASSWORD = 2, | 32 PP_TEXTINPUT_TYPE_PASSWORD = 2, |
34 PP_TEXTINPUT_TYPE_SEARCH = 3, | 33 PP_TEXTINPUT_TYPE_SEARCH = 3, |
35 PP_TEXTINPUT_TYPE_EMAIL = 4, | 34 PP_TEXTINPUT_TYPE_EMAIL = 4, |
36 PP_TEXTINPUT_TYPE_NUMBER = 5, | 35 PP_TEXTINPUT_TYPE_NUMBER = 5, |
37 PP_TEXTINPUT_TYPE_TELEPHONE = 6, | 36 PP_TEXTINPUT_TYPE_TELEPHONE = 6, |
38 PP_TEXTINPUT_TYPE_URL = 7 | 37 PP_TEXTINPUT_TYPE_URL = 7 |
39 }; | 38 }; |
40 | 39 |
41 /** | 40 /** |
42 * <code>PPB_TextInput_Dev</code> provides a set of functions for giving hints | 41 * <code>PPB_TextInput</code> provides a set of functions for giving hints |
43 * to the browser about the text input status of plugins, and functions for | 42 * to the browser about the text input status of plugins, and functions for |
44 * controlling input method editors (IMEs). | 43 * controlling input method editors (IMEs). |
45 */ | 44 */ |
46 interface PPB_TextInput_Dev { | 45 interface PPB_TextInput { |
47 /** | 46 /** |
48 * Informs the browser about the current text input mode of the plugin. | 47 * Informs the browser about the current text input mode of the plugin. |
49 * Typical use of this information in the browser is to properly | 48 * Typical use of this information in the browser is to properly |
50 * display/suppress tools for supporting text inputs (such as virtual | 49 * display/suppress tools for supporting text inputs (such as virtual |
51 * keyboards in touch screen based devices, or input method editors often | 50 * keyboards in touch screen based devices, or input method editors often |
52 * used for composing East Asian characters). | 51 * used for composing East Asian characters). |
53 */ | 52 */ |
54 void SetTextInputType([in] PP_Instance instance, | 53 void SetTextInputType([in] PP_Instance instance, |
55 [in] PP_TextInput_Type type); | 54 [in] PP_TextInput_Type type); |
56 | 55 |
57 /** | 56 /** |
58 * Informs the browser about the coordinates of the text input caret and the | 57 * Informs the browser about the coordinates of the text input caret and the |
59 * bounding box of the text input area. Typical use of this information in | 58 * bounding box of the text input area. Typical use of this information in |
60 * the browser is to layout IME windows etc. | 59 * the browser is to layout IME windows etc. |
61 */ | 60 */ |
62 void UpdateCaretPosition([in] PP_Instance instance, | 61 void UpdateCaretPosition([in] PP_Instance instance, |
63 [in] PP_Rect caret, | 62 [in] PP_Rect caret, |
64 [in] PP_Rect bounding_box); | 63 [in] PP_Rect bounding_box); |
65 | 64 |
66 /** | 65 /** |
67 * Cancels the current composition in IME. | 66 * Cancels the current composition in IME. |
68 */ | 67 */ |
69 void CancelCompositionText([in] PP_Instance instance); | 68 void CancelCompositionText([in] PP_Instance instance); |
70 | 69 |
71 /** | 70 /** |
72 * In response to the <code>PPP_TextInput_Dev::RequestSurroundingText</code> | 71 * In response to the <code>PPP_TextInput::RequestSurroundingText</code> |
73 * call, informs the browser about the current text selection and surrounding | 72 * call, informs the browser about the current text selection and surrounding |
74 * text. <code>text</code> is a UTF-8 string that contains the current range | 73 * text. <code>text</code> is a UTF-8 string that contains the current range |
75 * of text selection in the plugin. <code>caret</code> is the byte-index of | 74 * of text selection in the plugin. <code>caret</code> is the byte-index of |
76 * the caret position within <code>text</code>. <code>anchor</code> is the | 75 * the caret position within <code>text</code>. <code>anchor</code> is the |
77 * byte-index of the anchor position (i.e., if a range of text is selected, | 76 * byte-index of the anchor position (i.e., if a range of text is selected, |
78 * it is the other edge of selection different from <code>caret</code>. If | 77 * it is the other edge of selection different from <code>caret</code>. If |
79 * there are no selection, <code>anchor</code> is equal to <code>caret</code>. | 78 * there are no selection, <code>anchor</code> is equal to <code>caret</code>. |
80 * | 79 * |
81 * Typical use of this information in the browser is to enable "reconversion" | 80 * Typical use of this information in the browser is to enable "reconversion" |
82 * features of IME that puts back the already committed text into the | 81 * features of IME that puts back the already committed text into the |
(...skipping 10 matching lines...) Expand all Loading... | |
93 */ | 92 */ |
94 [version=0.2] | 93 [version=0.2] |
95 void UpdateSurroundingText([in] PP_Instance instance, | 94 void UpdateSurroundingText([in] PP_Instance instance, |
96 [in] str_t text, | 95 [in] str_t text, |
97 [in] uint32_t caret, | 96 [in] uint32_t caret, |
98 [in] uint32_t anchor); | 97 [in] uint32_t anchor); |
99 | 98 |
100 /** | 99 /** |
101 * Informs the browser when a range of text selection is changed in a plugin. | 100 * Informs the browser when a range of text selection is changed in a plugin. |
102 * When the browser needs to know the content of the updated selection, it | 101 * When the browser needs to know the content of the updated selection, it |
103 * pings back by <code>PPP_TextInput_Dev::RequestSurroundingText</code>. The | 102 * pings back by <code>PPP_TextInput::RequestSurroundingText</code>. The |
104 * plugin then should send the information with | 103 * plugin then should send the information with |
105 * <code>UpdateSurroundingText</code>. | 104 * <code>UpdateSurroundingText</code>. |
106 */ | 105 */ |
107 [version=0.2] | 106 [version=0.2] |
108 void SelectionChanged([in] PP_Instance instance); | 107 void SelectionChanged([in] PP_Instance instance); |
dmichael (off chromium)
2013/07/18 03:50:20
As Darin mentioned, it would be better to use a PP
Seigo Nonaka
2013/07/23 11:49:54
I looked into the details of this function and it
| |
109 }; | 108 }; |
OLD | NEW |