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 CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ |
7 | 7 |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Gets the language codes associated with the given input method IDs. | 90 // Gets the language codes associated with the given input method IDs. |
91 // The returned language codes won't have duplicates. | 91 // The returned language codes won't have duplicates. |
92 void GetLanguageCodesFromInputMethodIds( | 92 void GetLanguageCodesFromInputMethodIds( |
93 const std::vector<std::string>& input_method_ids, | 93 const std::vector<std::string>& input_method_ids, |
94 std::vector<std::string>* out_language_codes) const; | 94 std::vector<std::string>* out_language_codes) const; |
95 | 95 |
96 // Gets first input method associated with the language. | 96 // Gets first input method associated with the language. |
97 // Returns empty string on error. | 97 // Returns empty string on error. |
98 std::string GetLanguageDefaultInputMethodId(const std::string& language_code); | 98 std::string GetLanguageDefaultInputMethodId(const std::string& language_code); |
99 | 99 |
100 // Returns the input method ID of the hardware keyboard. e.g. "xkb:us::eng" | 100 // Fills the input method IDs of the hardware keyboard. e.g. "xkb:us::eng" |
101 // for the US Qwerty keyboard. | 101 // for the US Qwerty keyboard. |out| must not be NULL. |
102 std::string GetHardwareInputMethodId() const; | 102 void GetHardwareInputMethodIds(std::vector<std::string>* out) const; |
103 | 103 |
104 // Returns the login-allowed input method ID of the hardware keyboard. | 104 // Returns the login-allowed input method ID of the hardware keyboard. |
105 std::string GetHardwareLoginInputMethodId() const; | 105 void GetHardwareLoginInputMethodId(std::vector<std::string>* out) const; |
106 | 106 |
107 // Returns true if given input method can be used to input login data. | 107 // Returns true if given input method can be used to input login data. |
108 bool IsLoginKeyboard(const std::string& input_method_id) const; | 108 bool IsLoginKeyboard(const std::string& input_method_id) const; |
109 | 109 |
110 // Returns true if the given input method id is supported. | 110 // Returns true if the given input method id is supported. |
111 bool IsValidInputMethodId(const std::string& input_method_id) const; | 111 bool IsValidInputMethodId(const std::string& input_method_id) const; |
112 | 112 |
113 // Returns true if the given input method id is for a keyboard layout. | 113 // Returns true if the given input method id is for a keyboard layout. |
114 static bool IsKeyboardLayout(const std::string& input_method_id); | 114 static bool IsKeyboardLayout(const std::string& input_method_id); |
115 | 115 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 InputMethodDelegate* delegate_; | 174 InputMethodDelegate* delegate_; |
175 | 175 |
176 DISALLOW_COPY_AND_ASSIGN(InputMethodUtil); | 176 DISALLOW_COPY_AND_ASSIGN(InputMethodUtil); |
177 }; | 177 }; |
178 | 178 |
179 } // namespace input_method | 179 } // namespace input_method |
180 } // namespace chromeos | 180 } // namespace chromeos |
181 | 181 |
182 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ | 182 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ |
OLD | NEW |