OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 VIEWS_IME_TEXT_INPUT_CLIENT_H_ | 5 #ifndef VIEWS_IME_TEXT_INPUT_CLIENT_H_ |
6 #define VIEWS_IME_TEXT_INPUT_CLIENT_H_ | 6 #define VIEWS_IME_TEXT_INPUT_CLIENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // Returns false if the operation is not supported. | 91 // Returns false if the operation is not supported. |
92 virtual bool SetSelectionRange(const ui::Range& range) = 0; | 92 virtual bool SetSelectionRange(const ui::Range& range) = 0; |
93 | 93 |
94 // Deletes contents in the given UTF-16 based character range. Current | 94 // Deletes contents in the given UTF-16 based character range. Current |
95 // composition text will be confirmed before deleting the range. | 95 // composition text will be confirmed before deleting the range. |
96 // The input caret will be moved to the place where the range gets deleted. | 96 // The input caret will be moved to the place where the range gets deleted. |
97 // Returns false if the oepration is not supported. | 97 // Returns false if the oepration is not supported. |
98 virtual bool DeleteRange(const ui::Range& range) = 0; | 98 virtual bool DeleteRange(const ui::Range& range) = 0; |
99 | 99 |
100 // Retrieves the text content in a given UTF-16 based character range. | 100 // Retrieves the text content in a given UTF-16 based character range. |
101 // The result will be send back to the input method by calling the given | 101 // The result will be write in text and actual_range. |
102 // callback, which may happen asynchronously. | |
103 // Returns false if the operation is not supported. | 102 // Returns false if the operation is not supported. |
104 virtual bool GetTextFromRange( | 103 virtual bool GetTextFromRange( |
105 const ui::Range& range, | 104 const ui::Range& range, |
106 const base::Callback<void(const string16&)>& callback) = 0; | 105 string16* text, |
| 106 ui::Range* actual_range) = 0; |
107 | 107 |
108 // Miscellaneous ------------------------------------------------------------ | 108 // Miscellaneous ------------------------------------------------------------ |
109 | 109 |
110 // Called whenever current keyboard layout or input method is changed, | 110 // Called whenever current keyboard layout or input method is changed, |
111 // especially the change of input locale and text direction. | 111 // especially the change of input locale and text direction. |
112 virtual void OnInputMethodChanged() = 0; | 112 virtual void OnInputMethodChanged() = 0; |
113 | 113 |
114 // Called whenever the user requests to change the text direction and layout | 114 // Called whenever the user requests to change the text direction and layout |
115 // alignment of the current text box. It’s for supporting ctrl-shift on | 115 // alignment of the current text box. It’s for supporting ctrl-shift on |
116 // Windows. | 116 // Windows. |
117 // Returns false if the operation is not supported. | 117 // Returns false if the operation is not supported. |
118 virtual bool ChangeTextDirectionAndLayoutAlignment( | 118 virtual bool ChangeTextDirectionAndLayoutAlignment( |
119 base::i18n::TextDirection direction) = 0; | 119 base::i18n::TextDirection direction) = 0; |
120 | 120 |
121 // Gets the View object who owns this TextInputClient instance. | 121 // Gets the View object who owns this TextInputClient instance. |
122 virtual View* GetOwnerViewOfTextInputClient() = 0; | 122 virtual View* GetOwnerViewOfTextInputClient() = 0; |
123 }; | 123 }; |
124 | 124 |
125 } // namespace views | 125 } // namespace views |
126 | 126 |
127 #endif // VIEWS_IME_TEXT_INPUT_CLIENT_H_ | 127 #endif // VIEWS_IME_TEXT_INPUT_CLIENT_H_ |
OLD | NEW |