| 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> |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // Returns all input methods that are supported, including ones not active. | 91 // Returns all input methods that are supported, including ones not active. |
| 92 // This function never returns NULL. Note that input method extensions are NOT | 92 // This function never returns NULL. Note that input method extensions are NOT |
| 93 // included in the result. | 93 // included in the result. |
| 94 virtual scoped_ptr<InputMethodDescriptors> | 94 virtual scoped_ptr<InputMethodDescriptors> |
| 95 GetSupportedInputMethods() const = 0; | 95 GetSupportedInputMethods() const = 0; |
| 96 | 96 |
| 97 // Returns the list of input methods we can select (i.e. active) including | 97 // Returns the list of input methods we can select (i.e. active) including |
| 98 // extension input methods. | 98 // extension input methods. |
| 99 virtual scoped_ptr<InputMethodDescriptors> GetActiveInputMethods() const = 0; | 99 virtual scoped_ptr<InputMethodDescriptors> GetActiveInputMethods() const = 0; |
| 100 | 100 |
| 101 // Returns the list of input methods we can select (i.e. active) including |
| 102 // extension input methods. |
| 103 // The same as GetActiveInputMethods but returns reference to internal list. |
| 104 virtual const std::vector<std::string>& GetActiveInputMethodIds() const = 0; |
| 105 |
| 101 // Returns the number of active input methods including extension input | 106 // Returns the number of active input methods including extension input |
| 102 // methods. | 107 // methods. |
| 103 virtual size_t GetNumActiveInputMethods() const = 0; | 108 virtual size_t GetNumActiveInputMethods() const = 0; |
| 104 | 109 |
| 105 // Changes the current input method to |input_method_id|. If |input_method_id| | 110 // Changes the current input method to |input_method_id|. If |input_method_id| |
| 106 // is not active, switch to the first one in the active input method list. | 111 // is not active, switch to the first one in the active input method list. |
| 107 virtual void ChangeInputMethod(const std::string& input_method_id) = 0; | 112 virtual void ChangeInputMethod(const std::string& input_method_id) = 0; |
| 108 | 113 |
| 109 // Enables keyboard layouts (e.g. US Qwerty, US Dvorak, French Azerty) that | 114 // Enables keyboard layouts (e.g. US Qwerty, US Dvorak, French Azerty) that |
| 110 // are necessary for the |language_code| and then switches to |initial_layout| | 115 // are necessary for the |language_code| and then switches to |initial_layout| |
| 111 // if the string is not empty. For example, if |language_code| is "en-US", US | 116 // if the string is not empty. For example, if |language_code| is "en-US", US |
| 112 // Qwerty, US International, US Extended, US Dvorak, and US Colemak layouts | 117 // Qwerty, US International, US Extended, US Dvorak, and US Colemak layouts |
| 113 // would be enabled. Likewise, for Germany locale, US Qwerty which corresponds | 118 // would be enabled. Likewise, for Germany locale, US Qwerty which corresponds |
| 114 // to the hardware keyboard layout and several keyboard layouts for Germany | 119 // to the hardware keyboard layout and several keyboard layouts for Germany |
| 115 // would be enabled. | 120 // would be enabled. |
| 116 // This method is for setting up i18n keyboard layouts for the login screen. | 121 // This method is for setting up i18n keyboard layouts for the login screen. |
| 117 virtual void EnableLayouts(const std::string& language_code, | 122 virtual void EnableLayouts(const std::string& language_code, |
| 118 const std::string& initial_layout) = 0; | 123 const std::string& initial_layout) = 0; |
| 119 | 124 |
| 120 // Activates the input method property specified by the |key|. | 125 // Activates the input method property specified by the |key|. |
| 121 virtual void ActivateInputMethodProperty(const std::string& key) = 0; | 126 virtual void ActivateInputMethodProperty(const std::string& key) = 0; |
| 122 | 127 |
| 123 // 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 |
| 124 // system input method framework as needed. | 129 // system input method framework as needed. |
| 125 virtual bool EnableInputMethods( | 130 virtual bool EnableInputMethods( |
| 126 const std::vector<std::string>& new_active_input_method_ids) = 0; | 131 const std::vector<std::string>& new_active_input_method_ids) = 0; |
| 127 | 132 |
| 133 // Adds one entry to the list of active input method IDs, and then starts or |
| 134 // stops the system input method framework as needed. |
| 135 virtual bool EnableInputMethod( |
| 136 const std::string& new_active_input_method_id) = 0; |
| 137 |
| 128 // Remaps old input methods like "mozc" to new input methods. Return true if | 138 // Remaps old input methods like "mozc" to new input methods. Return true if |
| 129 // at least one IME is migrated. | 139 // at least one IME is migrated. |
| 130 // TODO(nona): Remove this function after few milestones are passed. | 140 // TODO(nona): Remove this function after few milestones are passed. |
| 131 // (http://crbug.com/236747) | 141 // (http://crbug.com/236747) |
| 132 virtual bool MigrateOldInputMethods( | 142 virtual bool MigrateOldInputMethods( |
| 133 std::vector<std::string>* input_method_ids) = 0; | 143 std::vector<std::string>* input_method_ids) = 0; |
| 134 virtual bool MigrateKoreanKeyboard( | 144 virtual bool MigrateKoreanKeyboard( |
| 135 const std::string& keyboard_id, | 145 const std::string& keyboard_id, |
| 136 std::vector<std::string>* input_method_ids) = 0; | 146 std::vector<std::string>* input_method_ids) = 0; |
| 137 | 147 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 188 |
| 179 // Switches the current input method (or keyboard layout) to the next one. | 189 // Switches the current input method (or keyboard layout) to the next one. |
| 180 virtual bool SwitchToNextInputMethod() = 0; | 190 virtual bool SwitchToNextInputMethod() = 0; |
| 181 | 191 |
| 182 // Switches the current input method (or keyboard layout) to the previous one. | 192 // Switches the current input method (or keyboard layout) to the previous one. |
| 183 virtual bool SwitchToPreviousInputMethod() = 0; | 193 virtual bool SwitchToPreviousInputMethod() = 0; |
| 184 | 194 |
| 185 // Switches to an input method (or keyboard layout) which is associated with | 195 // Switches to an input method (or keyboard layout) which is associated with |
| 186 // the |accelerator|. | 196 // the |accelerator|. |
| 187 virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) = 0; | 197 virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) = 0; |
| 198 |
| 199 // If all input methods of a given language can be used at login screen |
| 200 virtual bool IsLanguageFullLatinKeyboard(const std::string& lang) const = 0; |
| 188 }; | 201 }; |
| 189 | 202 |
| 190 } // namespace input_method | 203 } // namespace input_method |
| 191 } // namespace chromeos | 204 } // namespace chromeos |
| 192 | 205 |
| 193 #endif // CHROMEOS_IME_INPUT_METHOD_MANAGER_H_ | 206 #endif // CHROMEOS_IME_INPUT_METHOD_MANAGER_H_ |
| OLD | NEW |