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 CHROMEOS_IME_INPUT_METHOD_MANAGER_H_ | 5 #ifndef CHROMEOS_IME_INPUT_METHOD_MANAGER_H_ |
6 #define CHROMEOS_IME_INPUT_METHOD_MANAGER_H_ | 6 #define CHROMEOS_IME_INPUT_METHOD_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "chromeos/chromeos_export.h" | 13 #include "chromeos/chromeos_export.h" |
14 #include "chromeos/ime/input_method_descriptor.h" | 14 #include "chromeos/ime/input_method_descriptor.h" |
15 #include "chromeos/ime/input_method_property.h" | |
16 | 15 |
17 namespace ui { | 16 namespace ui { |
18 class Accelerator; | 17 class Accelerator; |
19 } // namespace ui | 18 } // namespace ui |
20 | 19 |
21 namespace chromeos { | 20 namespace chromeos { |
22 class ComponentExtensionIMEManager; | 21 class ComponentExtensionIMEManager; |
23 class InputMethodEngineInterface; | 22 class InputMethodEngineInterface; |
24 namespace input_method { | 23 namespace input_method { |
25 class InputMethodUtil; | 24 class InputMethodUtil; |
(...skipping 11 matching lines...) Expand all Loading... |
37 STATE_TERMINATING, | 36 STATE_TERMINATING, |
38 }; | 37 }; |
39 | 38 |
40 class Observer { | 39 class Observer { |
41 public: | 40 public: |
42 virtual ~Observer() {} | 41 virtual ~Observer() {} |
43 // Called when the current input method is changed. |show_message| | 42 // Called when the current input method is changed. |show_message| |
44 // indicates whether the user should be notified of this change. | 43 // indicates whether the user should be notified of this change. |
45 virtual void InputMethodChanged(InputMethodManager* manager, | 44 virtual void InputMethodChanged(InputMethodManager* manager, |
46 bool show_message) = 0; | 45 bool show_message) = 0; |
47 // Called when the list of properties is changed. | |
48 virtual void InputMethodPropertyChanged(InputMethodManager* manager) = 0; | |
49 }; | 46 }; |
50 | 47 |
51 // CandidateWindowObserver is notified of events related to the candidate | 48 // CandidateWindowObserver is notified of events related to the candidate |
52 // window. The "suggestion window" used by IMEs such as ibus-mozc does not | 49 // window. The "suggestion window" used by IMEs such as ibus-mozc does not |
53 // count as the candidate window (this may change if we later want suggestion | 50 // count as the candidate window (this may change if we later want suggestion |
54 // window events as well). These events also won't occur when the virtual | 51 // window events as well). These events also won't occur when the virtual |
55 // keyboard is used, since it controls its own candidate window. | 52 // keyboard is used, since it controls its own candidate window. |
56 class CandidateWindowObserver { | 53 class CandidateWindowObserver { |
57 public: | 54 public: |
58 virtual ~CandidateWindowObserver() {} | 55 virtual ~CandidateWindowObserver() {} |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // |language_code| is "en-US", US Qwerty, US International, US Extended, US | 117 // |language_code| is "en-US", US Qwerty, US International, US Extended, US |
121 // Dvorak, and US Colemak layouts would be enabled. Likewise, for Germany | 118 // Dvorak, and US Colemak layouts would be enabled. Likewise, for Germany |
122 // locale, US Qwerty which corresponds to the hardware keyboard layout and | 119 // locale, US Qwerty which corresponds to the hardware keyboard layout and |
123 // several keyboard layouts for Germany would be enabled. | 120 // several keyboard layouts for Germany would be enabled. |
124 // Only layouts suitable for login screen are enabled. | 121 // Only layouts suitable for login screen are enabled. |
125 virtual void EnableLoginLayouts( | 122 virtual void EnableLoginLayouts( |
126 const std::string& language_code, | 123 const std::string& language_code, |
127 const std::vector<std::string>& initial_layouts) = 0; | 124 const std::vector<std::string>& initial_layouts) = 0; |
128 | 125 |
129 // Activates the input method property specified by the |key|. | 126 // Activates the input method property specified by the |key|. |
130 virtual void ActivateInputMethodProperty(const std::string& key) = 0; | 127 virtual void ActivateInputMethodMenuItem(const std::string& key) = 0; |
131 | 128 |
132 // Updates the list of active input method IDs, and then starts or stops the | 129 // Updates the list of active input method IDs, and then starts or stops the |
133 // system input method framework as needed. | 130 // system input method framework as needed. |
134 virtual bool ReplaceEnabledInputMethods( | 131 virtual bool ReplaceEnabledInputMethods( |
135 const std::vector<std::string>& new_active_input_method_ids) = 0; | 132 const std::vector<std::string>& new_active_input_method_ids) = 0; |
136 | 133 |
137 // Adds one entry to the list of active input method IDs, and then starts or | 134 // Adds one entry to the list of active input method IDs, and then starts or |
138 // stops the system input method framework as needed. | 135 // stops the system input method framework as needed. |
139 virtual bool EnableInputMethod( | 136 virtual bool EnableInputMethod( |
140 const std::string& new_active_input_method_id) = 0; | 137 const std::string& new_active_input_method_id) = 0; |
(...skipping 12 matching lines...) Expand all Loading... |
153 | 150 |
154 // Sets the list of extension IME ids which should be enabled. | 151 // Sets the list of extension IME ids which should be enabled. |
155 virtual void SetEnabledExtensionImes(std::vector<std::string>* ids) = 0; | 152 virtual void SetEnabledExtensionImes(std::vector<std::string>* ids) = 0; |
156 | 153 |
157 // Sets current input method to login default (first owners, then hardware). | 154 // Sets current input method to login default (first owners, then hardware). |
158 virtual void SetInputMethodLoginDefault() = 0; | 155 virtual void SetInputMethodLoginDefault() = 0; |
159 | 156 |
160 // Gets the descriptor of the input method which is currently selected. | 157 // Gets the descriptor of the input method which is currently selected. |
161 virtual InputMethodDescriptor GetCurrentInputMethod() const = 0; | 158 virtual InputMethodDescriptor GetCurrentInputMethod() const = 0; |
162 | 159 |
163 // Gets the list of input method properties. The list could be empty(). | |
164 virtual InputMethodPropertyList GetCurrentInputMethodProperties() const = 0; | |
165 | |
166 // Sets the list of input method properties. The list could be empty(). | |
167 virtual void SetCurrentInputMethodProperties( | |
168 const InputMethodPropertyList& property_list) = 0; | |
169 | |
170 // Returns an X keyboard object which could be used to change the current XKB | 160 // Returns an X keyboard object which could be used to change the current XKB |
171 // layout, change the caps lock status, and set the auto repeat rate/interval. | 161 // layout, change the caps lock status, and set the auto repeat rate/interval. |
172 virtual XKeyboard* GetXKeyboard() = 0; | 162 virtual XKeyboard* GetXKeyboard() = 0; |
173 | 163 |
174 // Returns an InputMethodUtil object. | 164 // Returns an InputMethodUtil object. |
175 virtual InputMethodUtil* GetInputMethodUtil() = 0; | 165 virtual InputMethodUtil* GetInputMethodUtil() = 0; |
176 | 166 |
177 // Returns a ComponentExtentionIMEManager object. | 167 // Returns a ComponentExtentionIMEManager object. |
178 virtual ComponentExtensionIMEManager* GetComponentExtensionIMEManager() = 0; | 168 virtual ComponentExtensionIMEManager* GetComponentExtensionIMEManager() = 0; |
179 | 169 |
180 // Switches the current input method (or keyboard layout) to the next one. | 170 // Switches the current input method (or keyboard layout) to the next one. |
181 virtual bool SwitchToNextInputMethod() = 0; | 171 virtual bool SwitchToNextInputMethod() = 0; |
182 | 172 |
183 // Switches the current input method (or keyboard layout) to the previous one. | 173 // Switches the current input method (or keyboard layout) to the previous one. |
184 virtual bool SwitchToPreviousInputMethod( | 174 virtual bool SwitchToPreviousInputMethod( |
185 const ui::Accelerator& accelerator) = 0; | 175 const ui::Accelerator& accelerator) = 0; |
186 | 176 |
187 // Switches to an input method (or keyboard layout) which is associated with | 177 // Switches to an input method (or keyboard layout) which is associated with |
188 // the |accelerator|. | 178 // the |accelerator|. |
189 virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) = 0; | 179 virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) = 0; |
190 | 180 |
191 // If keyboard layout can be uset at login screen | 181 // If keyboard layout can be uset at login screen |
192 virtual bool IsLoginKeyboard(const std::string& layout) const = 0; | 182 virtual bool IsLoginKeyboard(const std::string& layout) const = 0; |
193 }; | 183 }; |
194 | 184 |
195 } // namespace input_method | 185 } // namespace input_method |
196 } // namespace chromeos | 186 } // namespace chromeos |
197 | 187 |
198 #endif // CHROMEOS_IME_INPUT_METHOD_MANAGER_H_ | 188 #endif // CHROMEOS_IME_INPUT_METHOD_MANAGER_H_ |
OLD | NEW |