| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // |initial_layout| if the string is not empty. For example, if | 116 // |initial_layout| if the string is not empty. For example, if |
| 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(const std::string& language_code, | 122 virtual void EnableLoginLayouts(const std::string& language_code, |
| 126 const std::string& initial_layout) = 0; | 123 const std::string& initial_layout) = 0; |
| 127 | 124 |
| 128 // Activates the input method property specified by the |key|. | 125 // Activates the input method property specified by the |key|. |
| 129 virtual void ActivateInputMethodProperty(const std::string& key) = 0; | 126 virtual void ActivateInputMethodMenuItem(const std::string& key) = 0; |
| 130 | 127 |
| 131 // Updates the list of active input method IDs, and then starts or stops the | 128 // Updates the list of active input method IDs, and then starts or stops the |
| 132 // system input method framework as needed. | 129 // system input method framework as needed. |
| 133 virtual bool EnableInputMethods( | 130 virtual bool EnableInputMethods( |
| 134 const std::vector<std::string>& new_active_input_method_ids) = 0; | 131 const std::vector<std::string>& new_active_input_method_ids) = 0; |
| 135 | 132 |
| 136 // Adds one entry to the list of active input method IDs, and then starts or | 133 // Adds one entry to the list of active input method IDs, and then starts or |
| 137 // stops the system input method framework as needed. | 134 // stops the system input method framework as needed. |
| 138 virtual bool EnableInputMethod( | 135 virtual bool EnableInputMethod( |
| 139 const std::string& new_active_input_method_id) = 0; | 136 const std::string& new_active_input_method_id) = 0; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 152 | 149 |
| 153 // Sets the list of extension IME ids which should be enabled. | 150 // Sets the list of extension IME ids which should be enabled. |
| 154 virtual void SetEnabledExtensionImes(std::vector<std::string>* ids) = 0; | 151 virtual void SetEnabledExtensionImes(std::vector<std::string>* ids) = 0; |
| 155 | 152 |
| 156 // Sets current input method to default (first owners, then hardware). | 153 // Sets current input method to default (first owners, then hardware). |
| 157 virtual void SetInputMethodDefault() = 0; | 154 virtual void SetInputMethodDefault() = 0; |
| 158 | 155 |
| 159 // Gets the descriptor of the input method which is currently selected. | 156 // Gets the descriptor of the input method which is currently selected. |
| 160 virtual InputMethodDescriptor GetCurrentInputMethod() const = 0; | 157 virtual InputMethodDescriptor GetCurrentInputMethod() const = 0; |
| 161 | 158 |
| 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 | |
| 169 // Returns an X keyboard object which could be used to change the current XKB | 159 // Returns an X keyboard object which could be used to change the current XKB |
| 170 // layout, change the caps lock status, and set the auto repeat rate/interval. | 160 // layout, change the caps lock status, and set the auto repeat rate/interval. |
| 171 virtual XKeyboard* GetXKeyboard() = 0; | 161 virtual XKeyboard* GetXKeyboard() = 0; |
| 172 | 162 |
| 173 // Returns an InputMethodUtil object. | 163 // Returns an InputMethodUtil object. |
| 174 virtual InputMethodUtil* GetInputMethodUtil() = 0; | 164 virtual InputMethodUtil* GetInputMethodUtil() = 0; |
| 175 | 165 |
| 176 // Returns a ComponentExtentionIMEManager object. | 166 // Returns a ComponentExtentionIMEManager object. |
| 177 virtual ComponentExtensionIMEManager* GetComponentExtensionIMEManager() = 0; | 167 virtual ComponentExtensionIMEManager* GetComponentExtensionIMEManager() = 0; |
| 178 | 168 |
| 179 // Switches the current input method (or keyboard layout) to the next one. | 169 // Switches the current input method (or keyboard layout) to the next one. |
| 180 virtual bool SwitchToNextInputMethod() = 0; | 170 virtual bool SwitchToNextInputMethod() = 0; |
| 181 | 171 |
| 182 // Switches the current input method (or keyboard layout) to the previous one. | 172 // Switches the current input method (or keyboard layout) to the previous one. |
| 183 virtual bool SwitchToPreviousInputMethod( | 173 virtual bool SwitchToPreviousInputMethod( |
| 184 const ui::Accelerator& accelerator) = 0; | 174 const ui::Accelerator& accelerator) = 0; |
| 185 | 175 |
| 186 // Switches to an input method (or keyboard layout) which is associated with | 176 // Switches to an input method (or keyboard layout) which is associated with |
| 187 // the |accelerator|. | 177 // the |accelerator|. |
| 188 virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) = 0; | 178 virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) = 0; |
| 189 | 179 |
| 190 // If keyboard layout can be uset at login screen | 180 // If keyboard layout can be uset at login screen |
| 191 virtual bool IsLoginKeyboard(const std::string& layout) const = 0; | 181 virtual bool IsLoginKeyboard(const std::string& layout) const = 0; |
| 192 }; | 182 }; |
| 193 | 183 |
| 194 } // namespace input_method | 184 } // namespace input_method |
| 195 } // namespace chromeos | 185 } // namespace chromeos |
| 196 | 186 |
| 197 #endif // CHROMEOS_IME_INPUT_METHOD_MANAGER_H_ | 187 #endif // CHROMEOS_IME_INPUT_METHOD_MANAGER_H_ |
| OLD | NEW |