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