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 #ifndef UI_BASE_IME_TEXT_INPUT_CLIENT_H_ | 5 #ifndef UI_BASE_IME_TEXT_INPUT_CLIENT_H_ |
6 #define UI_BASE_IME_TEXT_INPUT_CLIENT_H_ | 6 #define UI_BASE_IME_TEXT_INPUT_CLIENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // TODO(ime): Have a clear spec whether the returned value is DIP or not. | 92 // TODO(ime): Have a clear spec whether the returned value is DIP or not. |
93 // http://crbug.com/360334 | 93 // http://crbug.com/360334 |
94 virtual bool GetCompositionCharacterBounds(uint32 index, | 94 virtual bool GetCompositionCharacterBounds(uint32 index, |
95 gfx::Rect* rect) const = 0; | 95 gfx::Rect* rect) const = 0; |
96 | 96 |
97 // Returns true if there is composition text. | 97 // Returns true if there is composition text. |
98 virtual bool HasCompositionText() const = 0; | 98 virtual bool HasCompositionText() const = 0; |
99 | 99 |
100 // Document content operations ---------------------------------------------- | 100 // Document content operations ---------------------------------------------- |
101 | 101 |
102 // Retrieves the UTF-16 based character range containing accessibled text in | 102 // Retrieves the UTF-16 based character range containing accessible text in |
103 // the View. It must cover the composition and selection range. | 103 // the View. It must cover the composition and selection range. |
104 // Returns false if the information cannot be retrieved right now. | 104 // Returns false if the information cannot be retrieved right now. |
105 virtual bool GetTextRange(gfx::Range* range) const = 0; | 105 virtual bool GetTextRange(gfx::Range* range) const = 0; |
106 | 106 |
107 // Retrieves the UTF-16 based character range of current composition text. | 107 // Retrieves the UTF-16 based character range of current composition text. |
108 // Returns false if the information cannot be retrieved right now. | 108 // Returns false if the information cannot be retrieved right now. |
109 virtual bool GetCompositionTextRange(gfx::Range* range) const = 0; | 109 virtual bool GetCompositionTextRange(gfx::Range* range) const = 0; |
110 | 110 |
111 // Retrieves the UTF-16 based character range of current selection. | 111 // Retrieves the UTF-16 based character range of current selection. |
112 // Returns false if the information cannot be retrieved right now. | 112 // Returns false if the information cannot be retrieved right now. |
113 virtual bool GetSelectionRange(gfx::Range* range) const = 0; | 113 virtual bool GetSelectionRange(gfx::Range* range) const = 0; |
114 | 114 |
115 // Selects the given UTF-16 based character range. Current composition text | 115 // Selects the given UTF-16 based character range. Current composition text |
116 // will be confirmed before selecting the range. | 116 // will be confirmed before selecting the range. |
117 // Returns false if the operation is not supported. | 117 // Returns false if the operation is not supported. |
118 virtual bool SetSelectionRange(const gfx::Range& range) = 0; | 118 virtual bool SetSelectionRange(const gfx::Range& range) = 0; |
119 | 119 |
| 120 // Retrieves the text selection offset. This is equal to the number of |
| 121 // characters that have not been included |
| 122 virtual uint32 GetSelectionOffset() const = 0; |
| 123 |
120 // Deletes contents in the given UTF-16 based character range. Current | 124 // Deletes contents in the given UTF-16 based character range. Current |
121 // composition text will be confirmed before deleting the range. | 125 // composition text will be confirmed before deleting the range. |
122 // The input caret will be moved to the place where the range gets deleted. | 126 // The input caret will be moved to the place where the range gets deleted. |
123 // ExtendSelectionAndDelete should be used instead as far as you are deleting | 127 // ExtendSelectionAndDelete should be used instead as far as you are deleting |
124 // characters around current caret. This function with the range based on | 128 // characters around current caret. This function with the range based on |
125 // GetSelectionRange has a race condition due to asynchronous IPCs between | 129 // GetSelectionRange has a race condition due to asynchronous IPCs between |
126 // browser and renderer. | 130 // browser and renderer. |
127 // Returns false if the operation is not supported. | 131 // Returns false if the operation is not supported. |
128 virtual bool DeleteRange(const gfx::Range& range) = 0; | 132 virtual bool DeleteRange(const gfx::Range& range) = 0; |
129 | 133 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // This allows a TextInputClient to be informed of a platform-independent edit | 173 // This allows a TextInputClient to be informed of a platform-independent edit |
170 // command that has been derived from the key event currently being dispatched | 174 // command that has been derived from the key event currently being dispatched |
171 // (but not yet sent to the TextInputClient). The edit command will take into | 175 // (but not yet sent to the TextInputClient). The edit command will take into |
172 // account any OS-specific, or user-specified, keybindings that may be set up. | 176 // account any OS-specific, or user-specified, keybindings that may be set up. |
173 virtual void SetEditCommandForNextKeyEvent(int command_id) = 0; | 177 virtual void SetEditCommandForNextKeyEvent(int command_id) = 0; |
174 }; | 178 }; |
175 | 179 |
176 } // namespace ui | 180 } // namespace ui |
177 | 181 |
178 #endif // UI_BASE_IME_TEXT_INPUT_CLIENT_H_ | 182 #endif // UI_BASE_IME_TEXT_INPUT_CLIENT_H_ |
OLD | NEW |