| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 virtual bool ChangeTextDirectionAndLayoutAlignment( | 155 virtual bool ChangeTextDirectionAndLayoutAlignment( |
| 156 base::i18n::TextDirection direction) = 0; | 156 base::i18n::TextDirection direction) = 0; |
| 157 | 157 |
| 158 // Deletes the current selection plus the specified number of characters | 158 // Deletes the current selection plus the specified number of characters |
| 159 // before and after the selection or caret. This function should be used | 159 // before and after the selection or caret. This function should be used |
| 160 // instead of calling DeleteRange with GetSelectionRange, because | 160 // instead of calling DeleteRange with GetSelectionRange, because |
| 161 // GetSelectionRange may not be the latest value due to asynchronous of IPC | 161 // GetSelectionRange may not be the latest value due to asynchronous of IPC |
| 162 // between browser and renderer. | 162 // between browser and renderer. |
| 163 virtual void ExtendSelectionAndDelete(size_t before, size_t after) = 0; | 163 virtual void ExtendSelectionAndDelete(size_t before, size_t after) = 0; |
| 164 | 164 |
| 165 // Ensure the caret is within |rect|. |rect| is in screen coordinates and | 165 // Ensure the caret is not in |rect|. |rect| is in screen coordinates and |
| 166 // may extend beyond the bounds of this TextInputClient. | 166 // may extend beyond the bounds of this TextInputClient. |
| 167 // Note: On Windows, the returned value is supposed to be DIP (Density | 167 // Note: On Windows, the returned value is supposed to be DIP (Density |
| 168 // Independent Pixel). | 168 // Independent Pixel). |
| 169 // TODO(ime): Have a clear spec whether the returned value is DIP or not. | 169 // TODO(ime): Have a clear spec whether the returned value is DIP or not. |
| 170 // http://crbug.com/360334 | 170 // http://crbug.com/360334 |
| 171 virtual void EnsureCaretInRect(const gfx::Rect& rect) = 0; | 171 virtual void EnsureCaretNotInRect(const gfx::Rect& rect) = 0; |
| 172 | 172 |
| 173 // Returns true if |command| is currently allowed to be executed. | 173 // Returns true if |command| is currently allowed to be executed. |
| 174 virtual bool IsTextEditCommandEnabled(TextEditCommand command) const = 0; | 174 virtual bool IsTextEditCommandEnabled(TextEditCommand command) const = 0; |
| 175 | 175 |
| 176 // Execute |command| on the next key event. This allows a TextInputClient to | 176 // Execute |command| on the next key event. This allows a TextInputClient to |
| 177 // be informed of a platform-independent edit command that has been derived | 177 // be informed of a platform-independent edit command that has been derived |
| 178 // from the key event currently being dispatched (but not yet sent to the | 178 // from the key event currently being dispatched (but not yet sent to the |
| 179 // TextInputClient). The edit command will take into account any OS-specific, | 179 // TextInputClient). The edit command will take into account any OS-specific, |
| 180 // or user-specified, keybindings that may be set up. | 180 // or user-specified, keybindings that may be set up. |
| 181 virtual void SetTextEditCommandForNextKeyEvent(TextEditCommand command) = 0; | 181 virtual void SetTextEditCommandForNextKeyEvent(TextEditCommand command) = 0; |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 } // namespace ui | 184 } // namespace ui |
| 185 | 185 |
| 186 #endif // UI_BASE_IME_TEXT_INPUT_CLIENT_H_ | 186 #endif // UI_BASE_IME_TEXT_INPUT_CLIENT_H_ |
| OLD | NEW |