Chromium Code Reviews| 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 | |
| 9 #include "WebCompositionUnderline.h" | 10 #include "WebCompositionUnderline.h" |
| 10 #include "WebTextInputType.h" | 11 #include "WebTextInputType.h" |
| 12 #include "WebTextSuggestionInfo.h" | |
| 11 #include "WebWidget.h" | 13 #include "WebWidget.h" |
| 12 | 14 |
| 13 namespace blink { | 15 namespace blink { |
| 14 | 16 |
| 15 class WebString; | 17 class WebString; |
| 16 template <typename T> | 18 template <typename T> |
| 17 class WebVector; | 19 class WebVector; |
| 18 | 20 |
| 19 class WebInputMethodController { | 21 class WebInputMethodController { |
| 20 public: | 22 public: |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 39 // any, inserting the specified text, and moving the caret according to | 41 // any, inserting the specified text, and moving the caret according to |
| 40 // relativeCaretPosition. | 42 // relativeCaretPosition. |
| 41 virtual bool commitText(const WebString& text, | 43 virtual bool commitText(const WebString& text, |
| 42 const WebVector<WebCompositionUnderline>& underlines, | 44 const WebVector<WebCompositionUnderline>& underlines, |
| 43 int relativeCaretPosition) = 0; | 45 int relativeCaretPosition) = 0; |
| 44 | 46 |
| 45 // Called to inform the controller to confirm an ongoing composition. | 47 // Called to inform the controller to confirm an ongoing composition. |
| 46 virtual bool finishComposingText( | 48 virtual bool finishComposingText( |
| 47 ConfirmCompositionBehavior selectionBehavior) = 0; | 49 ConfirmCompositionBehavior selectionBehavior) = 0; |
| 48 | 50 |
| 51 virtual void applySuggestionReplacement(int documentMarkerID, | |
| 52 int suggestionIndex) = 0; | |
| 53 virtual void deleteSuggestionHighlight() = 0; | |
| 54 virtual void suggestionMenuClosed() = 0; | |
| 55 | |
| 49 // Returns information about the current text input of this controller. Note | 56 // Returns information about the current text input of this controller. Note |
| 50 // that this query can be expensive for long fields, as it returns the | 57 // that this query can be expensive for long fields, as it returns the |
| 51 // plain-text representation of the current editable element. Consider using | 58 // plain-text representation of the current editable element. Consider using |
| 52 // the lighter-weight textInputType() when appropriate. | 59 // the lighter-weight textInputType() when appropriate. |
| 53 virtual WebTextInputInfo textInputInfo() { return WebTextInputInfo(); } | 60 virtual WebTextInputInfo textInputInfo() { return WebTextInputInfo(); } |
| 54 | 61 |
| 55 // Returns the type of current text input of this controller. | 62 // Returns the type of current text input of this controller. |
| 56 virtual WebTextInputType textInputType() { return WebTextInputTypeNone; } | 63 virtual WebTextInputType textInputType() { return WebTextInputTypeNone; } |
| 64 | |
| 65 // Returns a list of text suggestion spans under the selection caret | |
| 66 // (if the selection is not of type caret, returns an empty vector) | |
| 67 virtual WebVector<WebTextSuggestionInfo> | |
| 68 getTextSuggestionInfosUnderCaret() = 0; | |
|
esprehn
2017/01/31 22:41:35
We shouldn't need this or prepareForTextSuggestion
rlanday
2017/01/31 23:30:10
Because everything's going to be in mojo? Ok
| |
| 69 | |
| 70 // Called to let the controller prepare for a text suggestion menu to be shown | |
| 71 // (e.g. by hiding the selection caret) | |
| 72 virtual void prepareForTextSuggestionMenuToBeShown() = 0; | |
| 57 }; | 73 }; |
| 58 | 74 |
| 59 } // namespace blink | 75 } // namespace blink |
| 60 #endif | 76 #endif |
| OLD | NEW |