OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef WebInputMethodController_h | 5 #ifndef WebInputMethodController_h |
6 #define WebInputMethodController_h | 6 #define WebInputMethodController_h |
7 | 7 |
8 #include "../platform/WebTextInputInfo.h" | 8 #include "../platform/WebTextInputInfo.h" |
9 #include "WebCompositionUnderline.h" | 9 #include "WebCompositionUnderline.h" |
10 #include "WebTextInputType.h" | 10 #include "WebTextInputType.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // Returns true if the composition text was set successfully. | 31 // Returns true if the composition text was set successfully. |
32 virtual bool setComposition( | 32 virtual bool setComposition( |
33 const WebString& text, | 33 const WebString& text, |
34 const WebVector<WebCompositionUnderline>& underlines, | 34 const WebVector<WebCompositionUnderline>& underlines, |
35 int selectionStart, | 35 int selectionStart, |
36 int selectionEnd) = 0; | 36 int selectionEnd) = 0; |
37 | 37 |
38 // Called to inform the controller that deleting the ongoing composition if | 38 // Called to inform the controller that deleting the ongoing composition if |
39 // any, inserting the specified text, and moving the caret according to | 39 // any, inserting the specified text, and moving the caret according to |
40 // relativeCaretPosition. | 40 // relativeCaretPosition. |
41 virtual bool commitText(const WebString& text, int relativeCaretPosition) = 0; | 41 virtual bool commitText(const WebString& text, |
| 42 const WebVector<WebCompositionUnderline>& underlines, |
| 43 int relativeCaretPosition) = 0; |
42 | 44 |
43 // Called to inform the controller to confirm an ongoing composition. | 45 // Called to inform the controller to confirm an ongoing composition. |
44 virtual bool finishComposingText( | 46 virtual bool finishComposingText( |
45 ConfirmCompositionBehavior selectionBehavior) = 0; | 47 ConfirmCompositionBehavior selectionBehavior) = 0; |
46 | 48 |
47 // Returns information about the current text input of this controller. Note | 49 // Returns information about the current text input of this controller. Note |
48 // that this query can be expensive for long fields, as it returns the | 50 // that this query can be expensive for long fields, as it returns the |
49 // plain-text representation of the current editable element. Consider using | 51 // plain-text representation of the current editable element. Consider using |
50 // the lighter-weight textInputType() when appropriate. | 52 // the lighter-weight textInputType() when appropriate. |
51 virtual WebTextInputInfo textInputInfo() { return WebTextInputInfo(); } | 53 virtual WebTextInputInfo textInputInfo() { return WebTextInputInfo(); } |
52 | 54 |
53 // Returns the type of current text input of this controller. | 55 // Returns the type of current text input of this controller. |
54 virtual WebTextInputType textInputType() { return WebTextInputTypeNone; } | 56 virtual WebTextInputType textInputType() { return WebTextInputTypeNone; } |
55 }; | 57 }; |
56 | 58 |
57 } // namespace blink | 59 } // namespace blink |
58 #endif | 60 #endif |
OLD | NEW |