Chromium Code Reviews| 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_Dev</code> interface. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 label Chrome { | 10 label Chrome { |
| 11 M16 = 0.1 | 11 M16 = 0.1, |
| 12 M19 = 0.2 | |
| 12 }; | 13 }; |
| 13 | 14 |
| 14 /** | 15 /** |
| 15 * PP_TextInput_Type is used to indicate the status of a plugin in regard to | 16 * PP_TextInput_Type is used to indicate the status of a plugin in regard to |
| 16 * text input. | 17 * text input. |
| 17 */ | 18 */ |
| 18 [assert_size(4)] | 19 [assert_size(4)] |
| 19 enum PP_TextInput_Type { | 20 enum PP_TextInput_Type { |
| 20 /** | 21 /** |
| 21 * Input caret is not in an editable mode, no input method shall be used. | 22 * Input caret is not in an editable mode, no input method shall be used. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 * the browser is to layout IME windows etc. | 60 * the browser is to layout IME windows etc. |
| 60 */ | 61 */ |
| 61 void UpdateCaretPosition([in] PP_Instance instance, | 62 void UpdateCaretPosition([in] PP_Instance instance, |
| 62 [in] PP_Rect caret, | 63 [in] PP_Rect caret, |
| 63 [in] PP_Rect bounding_box); | 64 [in] PP_Rect bounding_box); |
| 64 | 65 |
| 65 /** | 66 /** |
| 66 * Cancels the current composition in IME. | 67 * Cancels the current composition in IME. |
| 67 */ | 68 */ |
| 68 void CancelCompositionText([in] PP_Instance instance); | 69 void CancelCompositionText([in] PP_Instance instance); |
| 70 | |
| 71 /** | |
| 72 * In response to the <code>PPP_TextInput_Dev::RequestSurroundingText</code> | |
| 73 * call, informs the browser about the current text selection and surrounding | |
| 74 * text. <code>text</code> is an UTF-8 string that contains the current range | |
|
yzshen1
2012/03/07 18:22:56
nit: an -> a
kinaba
2012/03/14 04:28:53
Done.
| |
| 75 * of text selection in the plugin. <code>caret</code> is the byte-index of | |
| 76 * the caret poisition 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, | |
| 78 * it is the other edge of selection diffrent from <code>caret</code>. If | |
| 79 * there are no selection, <code>anchor</code> is equal to <code>caret</code>. | |
| 80 * | |
| 81 * Typical use of this information in the browser is to enable "reconversion" | |
| 82 * features of IME that puts back the already commited text into the | |
|
yzshen1
2012/03/07 18:22:56
nit: committed.
kinaba
2012/03/14 04:28:53
Done.
| |
| 83 * pre-commit composition state. Another use is to improve the precision | |
| 84 * of suggestion of IME by taking the context into account (e.g., if the caret | |
| 85 * looks to be on the beggining of a sentense, suggest capital letters in a | |
|
yzshen1
2012/03/07 18:22:56
beggining -> begining
kinaba
2012/03/14 04:28:53
Done.
| |
| 86 * virtual keyboard). | |
| 87 * | |
| 88 * When the focus is not on text, or when the plugin do not want to send the | |
|
yzshen1
2012/03/07 18:22:56
do -> does
kinaba
2012/03/14 04:28:53
Done.
| |
| 89 * selection to the browser (e.g., concerning security), call this function | |
| 90 * setting <code>text</code> to an empty string and <code>caret</code> and | |
| 91 * <code>anchor</code> to zero. | |
| 92 */ | |
| 93 [version=0.2] | |
| 94 void UpdateSurroundingText([in] PP_Instance instance, | |
| 95 [in] str_t text, | |
| 96 [in] uint32_t caret, | |
| 97 [in] uint32_t anchor); | |
| 98 | |
| 99 /** | |
| 100 * Informs the browser when a range of text selection is changed in a plugin. | |
| 101 * When the browser needs to know the content of the updated selection, it | |
| 102 * pings back by <code>PPP_TextInput_Dev::RequestSurroundingText</code>. The | |
| 103 * plugin then should send the information with | |
| 104 * <code>UpdateSurroundingText</code>. | |
| 105 */ | |
| 106 [version=0.2] | |
| 107 void SelectionChanged([in] PP_Instance instance); | |
| 69 }; | 108 }; |
| OLD | NEW |