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 #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. Since only a subset of surrounding | |
| 121 // text is cached, this value indicates the offset of the selection relative | |
| 122 // to the entire text body. | |
| 123 virtual uint32 GetSelectionOffset() const = 0; | |
|
Shu Chen
2015/08/12 07:23:16
What's the difference between "GetSelectionRange(&
rsadam
2015/08/12 21:46:52
Renamed it to GetTextOffset and updated the commen
| |
| 124 | |
| 120 // Deletes contents in the given UTF-16 based character range. Current | 125 // Deletes contents in the given UTF-16 based character range. Current |
| 121 // composition text will be confirmed before deleting the range. | 126 // composition text will be confirmed before deleting the range. |
| 122 // The input caret will be moved to the place where the range gets deleted. | 127 // 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 | 128 // ExtendSelectionAndDelete should be used instead as far as you are deleting |
| 124 // characters around current caret. This function with the range based on | 129 // characters around current caret. This function with the range based on |
| 125 // GetSelectionRange has a race condition due to asynchronous IPCs between | 130 // GetSelectionRange has a race condition due to asynchronous IPCs between |
| 126 // browser and renderer. | 131 // browser and renderer. |
| 127 // Returns false if the operation is not supported. | 132 // Returns false if the operation is not supported. |
| 128 virtual bool DeleteRange(const gfx::Range& range) = 0; | 133 virtual bool DeleteRange(const gfx::Range& range) = 0; |
| 129 | 134 |
| (...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 | 174 // 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 | 175 // 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 | 176 // (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. | 177 // account any OS-specific, or user-specified, keybindings that may be set up. |
| 173 virtual void SetEditCommandForNextKeyEvent(int command_id) = 0; | 178 virtual void SetEditCommandForNextKeyEvent(int command_id) = 0; |
| 174 }; | 179 }; |
| 175 | 180 |
| 176 } // namespace ui | 181 } // namespace ui |
| 177 | 182 |
| 178 #endif // UI_BASE_IME_TEXT_INPUT_CLIENT_H_ | 183 #endif // UI_BASE_IME_TEXT_INPUT_CLIENT_H_ |
| OLD | NEW |