OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_IME_INPUT_CONTEXT_HANDLER_INTERFACE_H_ | 5 #ifndef UI_BASE_IME_IME_INPUT_CONTEXT_HANDLER_INTERFACE_H_ |
6 #define UI_BASE_IME_IME_INPUT_CONTEXT_HANDLER_INTERFACE_H_ | 6 #define UI_BASE_IME_IME_INPUT_CONTEXT_HANDLER_INTERFACE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include "ui/base/ime/composition_text.h" | 11 #include "ui/base/ime/composition_text.h" |
| 12 #include "ui/base/ime/input_method.h" |
12 #include "ui/base/ime/ui_base_ime_export.h" | 13 #include "ui/base/ime/ui_base_ime_export.h" |
13 #include "ui/events/event.h" | 14 #include "ui/events/event.h" |
14 | 15 |
15 namespace ui { | 16 namespace ui { |
16 | 17 |
17 class UI_BASE_IME_EXPORT IMEInputContextHandlerInterface { | 18 class UI_BASE_IME_EXPORT IMEInputContextHandlerInterface { |
18 public: | 19 public: |
19 // Called when the engine commit a text. | 20 // Called when the engine commit a text. |
20 virtual void CommitText(const std::string& text) = 0; | 21 virtual void CommitText(const std::string& text) = 0; |
21 | 22 |
22 // Called when the engine updates composition text. | 23 // Called when the engine updates composition text. |
23 virtual void UpdateCompositionText(const CompositionText& text, | 24 virtual void UpdateCompositionText(const CompositionText& text, |
24 uint32_t cursor_pos, | 25 uint32_t cursor_pos, |
25 bool visible) = 0; | 26 bool visible) = 0; |
26 | 27 |
27 // Called when the engine request deleting surrounding string. | 28 // Called when the engine request deleting surrounding string. |
28 virtual void DeleteSurroundingText(int32_t offset, uint32_t length) = 0; | 29 virtual void DeleteSurroundingText(int32_t offset, uint32_t length) = 0; |
29 | 30 |
30 // Called when the engine sends a key event. | 31 // Called when the engine sends a key event. |
31 virtual void SendKeyEvent(KeyEvent* event) = 0; | 32 virtual void SendKeyEvent(KeyEvent* event) = 0; |
| 33 |
| 34 // Gets the input method pointer. |
| 35 virtual InputMethod* GetInputMethod() = 0; |
32 }; | 36 }; |
33 | 37 |
34 } // namespace ui | 38 } // namespace ui |
35 | 39 |
36 #endif // UI_BASE_IME_IME_INPUT_CONTEXT_HANDLER_INTERFACE_H_ | 40 #endif // UI_BASE_IME_IME_INPUT_CONTEXT_HANDLER_INTERFACE_H_ |
OLD | NEW |