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 |
11 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "ui/base/ime/composition_text.h" | 13 #include "ui/base/ime/composition_text.h" |
14 #include "ui/base/ime/text_input_mode.h" | 14 #include "ui/base/ime/text_input_mode.h" |
15 #include "ui/base/ime/text_input_type.h" | 15 #include "ui/base/ime/text_input_type.h" |
16 #include "ui/base/ime/ui_base_ime_export.h" | 16 #include "ui/base/ime/ui_base_ime_export.h" |
| 17 #include "ui/events/text_edit_commands.h" |
17 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
18 #include "ui/gfx/range/range.h" | 19 #include "ui/gfx/range/range.h" |
19 | 20 |
20 namespace gfx { | 21 namespace gfx { |
21 class Rect; | 22 class Rect; |
22 } | 23 } |
23 | 24 |
24 namespace ui { | 25 namespace ui { |
25 | 26 |
26 class KeyEvent; | 27 class KeyEvent; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 virtual void ExtendSelectionAndDelete(size_t before, size_t after) = 0; | 160 virtual void ExtendSelectionAndDelete(size_t before, size_t after) = 0; |
160 | 161 |
161 // Ensure the caret is within |rect|. |rect| is in screen coordinates and | 162 // Ensure the caret is within |rect|. |rect| is in screen coordinates and |
162 // may extend beyond the bounds of this TextInputClient. | 163 // may extend beyond the bounds of this TextInputClient. |
163 // Note: On Windows, the returned value is supposed to be DIP (Density | 164 // Note: On Windows, the returned value is supposed to be DIP (Density |
164 // Independent Pixel). | 165 // Independent Pixel). |
165 // TODO(ime): Have a clear spec whether the returned value is DIP or not. | 166 // TODO(ime): Have a clear spec whether the returned value is DIP or not. |
166 // http://crbug.com/360334 | 167 // http://crbug.com/360334 |
167 virtual void EnsureCaretInRect(const gfx::Rect& rect) = 0; | 168 virtual void EnsureCaretInRect(const gfx::Rect& rect) = 0; |
168 | 169 |
169 // Returns true if |command_id| is currently allowed to be executed. | 170 // Returns true if |command| is currently allowed to be executed. |
170 virtual bool IsEditCommandEnabled(int command_id) = 0; | 171 virtual bool IsEditCommandEnabled(TextEditCommand command) const = 0; |
171 | 172 |
172 // Execute the command specified by |command_id| on the next key event. | 173 // Execute |command| on the next key event. This allows a TextInputClient to |
173 // This allows a TextInputClient to be informed of a platform-independent edit | 174 // be informed of a platform-independent edit command that has been derived |
174 // command that has been derived from the key event currently being dispatched | 175 // from the key event currently being dispatched (but not yet sent to the |
175 // (but not yet sent to the TextInputClient). The edit command will take into | 176 // TextInputClient). The edit command will take into account any OS-specific, |
176 // account any OS-specific, or user-specified, keybindings that may be set up. | 177 // or user-specified, keybindings that may be set up. |
177 virtual void SetEditCommandForNextKeyEvent(int command_id) = 0; | 178 virtual void SetEditCommandForNextKeyEvent(TextEditCommand command) = 0; |
178 }; | 179 }; |
179 | 180 |
180 } // namespace ui | 181 } // namespace ui |
181 | 182 |
182 #endif // UI_BASE_IME_TEXT_INPUT_CLIENT_H_ | 183 #endif // UI_BASE_IME_TEXT_INPUT_CLIENT_H_ |
OLD | NEW |