Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: ui/base/ime/ime_engine_observer.h

Issue 1590863002: Move the local struct definitions off ui/base/ime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/base/ime/ime_engine_handler_interface.cc ('k') | ui/base/ime/ui_base_ime.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_ENGINE_OBSERVER_H_ 5 #ifndef UI_BASE_IME_IME_ENGINE_OBSERVER_H_
6 #define UI_BASE_IME_IME_ENGINE_OBSERVER_H_ 6 #define UI_BASE_IME_IME_ENGINE_OBSERVER_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "ui/base/ime/ime_engine_handler_interface.h" 9 #include "ui/base/ime/ime_engine_handler_interface.h"
10 10
11 namespace ui { 11 namespace ui {
12 12
13 class IMEEngineObserver { 13 class IMEEngineObserver {
Shu Chen 2016/01/15 13:46:23 The whole IMEEngineObserver can be moved to InputM
14 public: 14 public:
15 virtual ~IMEEngineObserver() {} 15 virtual ~IMEEngineObserver() {}
16 16
17 // Called when the IME becomes the active IME. 17 // Called when the IME becomes the active IME.
18 virtual void OnActivate(const std::string& engine_id) = 0; 18 virtual void OnActivate(const std::string& engine_id) = 0;
19 19
20 // Called when a text field gains focus, and will be sending key events. 20 // Called when a text field gains focus, and will be sending key events.
21 virtual void OnFocus( 21 virtual void OnFocus(
22 const IMEEngineHandlerInterface::InputContext& context) = 0; 22 const IMEEngineHandlerInterface::InputContext& context) = 0;
23 23
24 // Called when a text field loses focus, and will no longer generate events. 24 // Called when a text field loses focus, and will no longer generate events.
25 virtual void OnBlur(int context_id) = 0; 25 virtual void OnBlur(int context_id) = 0;
26 26
27 // Called when the user pressed a key with a text field focused.
28 virtual void OnKeyEvent(
29 const std::string& engine_id,
30 const IMEEngineHandlerInterface::KeyboardEvent& event,
31 IMEEngineHandlerInterface::KeyEventDoneCallback& key_data) = 0;
32
33 // Called when Chrome terminates on-going text input session. 27 // Called when Chrome terminates on-going text input session.
34 virtual void OnReset(const std::string& engine_id) = 0; 28 virtual void OnReset(const std::string& engine_id) = 0;
35 29
36 // Called when the IME is no longer active. 30 // Called when the IME is no longer active.
37 virtual void OnDeactivated(const std::string& engine_id) = 0; 31 virtual void OnDeactivated(const std::string& engine_id) = 0;
38 32
39 // Called when composition bounds are changed. 33 // Called when composition bounds are changed.
40 virtual void OnCompositionBoundsChanged( 34 virtual void OnCompositionBoundsChanged(
41 const std::vector<gfx::Rect>& bounds) = 0; 35 const std::vector<gfx::Rect>& bounds) = 0;
42 36
43 // Returns whether the observer is interested in key events. 37 // Returns whether the observer is interested in key events.
44 virtual bool IsInterestedInKeyEvent() const = 0; 38 virtual bool IsInterestedInKeyEvent() const = 0;
45 39
46 // Called when a surrounding text is changed. 40 // Called when a surrounding text is changed.
47 virtual void OnSurroundingTextChanged(const std::string& engine_id, 41 virtual void OnSurroundingTextChanged(const std::string& engine_id,
48 const std::string& text, 42 const std::string& text,
49 int cursor_pos, 43 int cursor_pos,
50 int anchor_pos, 44 int anchor_pos,
51 int offset_pos) = 0; 45 int offset_pos) = 0;
52
53 // ChromeOS only APIs.
54 #if defined(OS_CHROMEOS) 46 #if defined(OS_CHROMEOS)
55
56 enum MouseButtonEvent {
57 MOUSE_BUTTON_LEFT,
58 MOUSE_BUTTON_RIGHT,
59 MOUSE_BUTTON_MIDDLE,
60 };
61
62 // Called when an InputContext's properties change while it is focused. 47 // Called when an InputContext's properties change while it is focused.
63 virtual void OnInputContextUpdate( 48 virtual void OnInputContextUpdate(
64 const IMEEngineHandlerInterface::InputContext& context) = 0; 49 const IMEEngineHandlerInterface::InputContext& context) = 0;
65 50
66
67
68 // Called when the user clicks on an item in the candidate list.
69 virtual void OnCandidateClicked(const std::string& engine_id,
70 int candidate_id,
71 MouseButtonEvent button) = 0;
72
73 // Called when a menu item for this IME is interacted with. 51 // Called when a menu item for this IME is interacted with.
74 virtual void OnMenuItemActivated(const std::string& engine_id, 52 virtual void OnMenuItemActivated(const std::string& component_id,
75 const std::string& menu_id) = 0; 53 const std::string& menu_id) = 0;
76 #endif 54 #endif // defined(OS_CHROMEOS)
77 }; 55 };
78 56
79 } // namespace ui 57 } // namespace ui
80 58
81 #endif // UI_BASE_IME_IME_ENGINE_OBSERVER_H_ 59 #endif // UI_BASE_IME_IME_ENGINE_OBSERVER_H_
OLDNEW
« no previous file with comments | « ui/base/ime/ime_engine_handler_interface.cc ('k') | ui/base/ime/ui_base_ime.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698