OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 #include "chrome/browser/chromeos/input_method/input_method_engine_interface.h" | 11 #include "chrome/browser/chromeos/input_method/input_method_engine_interface.h" |
12 #include "chromeos/ime/input_method_descriptor.h" | 12 #include "chromeos/ime/input_method_descriptor.h" |
13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
14 | 14 |
15 namespace ui { | 15 namespace ui { |
16 class CandidateWindow; | 16 class CandidateWindow; |
17 class KeyEvent; | 17 class KeyEvent; |
18 } // namespace ui | 18 } // namespace ui |
19 | 19 |
20 namespace ash { | |
21 namespace ime { | |
22 struct InputMethodMenuItem; | |
23 } // namespace ime | |
24 } // namespace ash | |
25 | |
26 namespace chromeos { | 20 namespace chromeos { |
27 | 21 |
28 class CompositionText; | 22 class CompositionText; |
29 | 23 |
30 namespace input_method { | 24 namespace input_method { |
| 25 struct InputMethodProperty; |
31 struct KeyEventHandle; | 26 struct KeyEventHandle; |
32 } // namespace input_method | 27 } // namespace input_method |
33 | 28 |
34 class InputMethodEngine : public InputMethodEngineInterface { | 29 class InputMethodEngine : public InputMethodEngineInterface { |
35 public: | 30 public: |
36 InputMethodEngine(); | 31 InputMethodEngine(); |
37 | 32 |
38 virtual ~InputMethodEngine(); | 33 virtual ~InputMethodEngine(); |
39 | 34 |
40 void Initialize( | 35 void Initialize( |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 virtual void PropertyActivate(const std::string& property_name) OVERRIDE; | 88 virtual void PropertyActivate(const std::string& property_name) OVERRIDE; |
94 virtual void Reset() OVERRIDE; | 89 virtual void Reset() OVERRIDE; |
95 virtual void ProcessKeyEvent(const ui::KeyEvent& key_event, | 90 virtual void ProcessKeyEvent(const ui::KeyEvent& key_event, |
96 const KeyEventDoneCallback& callback) OVERRIDE; | 91 const KeyEventDoneCallback& callback) OVERRIDE; |
97 virtual void CandidateClicked(uint32 index) OVERRIDE; | 92 virtual void CandidateClicked(uint32 index) OVERRIDE; |
98 virtual void SetSurroundingText(const std::string& text, uint32 cursor_pos, | 93 virtual void SetSurroundingText(const std::string& text, uint32 cursor_pos, |
99 uint32 anchor_pos) OVERRIDE; | 94 uint32 anchor_pos) OVERRIDE; |
100 virtual void HideInputView() OVERRIDE; | 95 virtual void HideInputView() OVERRIDE; |
101 | 96 |
102 private: | 97 private: |
103 // Converts MenuItem to InputMethodMenuItem. | 98 // Converts MenuItem to InputMethodProperty. |
104 void MenuItemToProperty(const MenuItem& item, | 99 void MenuItemToProperty(const MenuItem& item, |
105 ash::ime::InputMethodMenuItem* property); | 100 input_method::InputMethodProperty* property); |
106 | 101 |
107 // Descriptor of this input method. | 102 // Descriptor of this input method. |
108 input_method::InputMethodDescriptor descriptor_; | 103 input_method::InputMethodDescriptor descriptor_; |
109 | 104 |
110 // True if the current context has focus. | 105 // True if the current context has focus. |
111 bool focused_; | 106 bool focused_; |
112 | 107 |
113 // True if this engine is active. | 108 // True if this engine is active. |
114 bool active_; | 109 bool active_; |
115 | 110 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // Mapping of candidate id to index. | 142 // Mapping of candidate id to index. |
148 std::map<int, int> candidate_indexes_; | 143 std::map<int, int> candidate_indexes_; |
149 | 144 |
150 // Used for input view window. | 145 // Used for input view window. |
151 GURL input_view_url_; | 146 GURL input_view_url_; |
152 }; | 147 }; |
153 | 148 |
154 } // namespace chromeos | 149 } // namespace chromeos |
155 | 150 |
156 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ | 151 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ |
OLD | NEW |