| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // Returns the input method ID of the hardware keyboard. e.g. "xkb:us::eng" | 96 // Returns the input method ID of the hardware keyboard. e.g. "xkb:us::eng" |
| 97 // for the US Qwerty keyboard. | 97 // for the US Qwerty keyboard. |
| 98 std::string GetHardwareInputMethodId() const; | 98 std::string GetHardwareInputMethodId() const; |
| 99 | 99 |
| 100 // Returns true if the given input method id is supported. | 100 // Returns true if the given input method id is supported. |
| 101 bool IsValidInputMethodId(const std::string& input_method_id) const; | 101 bool IsValidInputMethodId(const std::string& input_method_id) const; |
| 102 | 102 |
| 103 // Returns true if the given input method id is for a keyboard layout. | 103 // Returns true if the given input method id is for a keyboard layout. |
| 104 static bool IsKeyboardLayout(const std::string& input_method_id); | 104 static bool IsKeyboardLayout(const std::string& input_method_id); |
| 105 | 105 |
| 106 // Converts a language code to a language display name, using the | |
| 107 // current application locale. MaybeRewriteLanguageName() is called | |
| 108 // internally. | |
| 109 // Examples: "fi" => "Finnish" | |
| 110 // "en-US" => "English (United States)" | |
| 111 string16 GetLanguageDisplayNameFromCode( | |
| 112 const std::string& language_code); | |
| 113 | |
| 114 // Converts a language code to a language native display name. | |
| 115 // MaybeRewriteLanguageName() is called internally. | |
| 116 // Examples: "fi" => "suomi" (rather than Finnish) | |
| 117 // "en-US" => "English (United States)" | |
| 118 static string16 GetLanguageNativeDisplayNameFromCode( | |
| 119 const std::string& language_code); | |
| 120 | |
| 121 // Returns extra language code list associated with |input_method_id|. If | 106 // Returns extra language code list associated with |input_method_id|. If |
| 122 // there is no associated langauge code, this function returns empty list. | 107 // there is no associated langauge code, this function returns empty list. |
| 123 std::vector<std::string> GetExtraLanguageCodesFromId( | 108 std::vector<std::string> GetExtraLanguageCodesFromId( |
| 124 const std::string& input_method_id) const; | 109 const std::string& input_method_id) const; |
| 125 | 110 |
| 126 // Returns all extra language code list. | 111 // Returns all extra language code list. |
| 127 std::vector<std::string> GetExtraLanguageCodeList() const; | 112 std::vector<std::string> GetExtraLanguageCodeList() const; |
| 128 | 113 |
| 129 // Sets the list of component extension IMEs. | 114 // Sets the list of component extension IMEs. |
| 130 void SetComponentExtensions(const InputMethodDescriptors& imes); | 115 void SetComponentExtensions(const InputMethodDescriptors& imes); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 166 |
| 182 InputMethodDelegate* delegate_; | 167 InputMethodDelegate* delegate_; |
| 183 | 168 |
| 184 DISALLOW_COPY_AND_ASSIGN(InputMethodUtil); | 169 DISALLOW_COPY_AND_ASSIGN(InputMethodUtil); |
| 185 }; | 170 }; |
| 186 | 171 |
| 187 } // namespace input_method | 172 } // namespace input_method |
| 188 } // namespace chromeos | 173 } // namespace chromeos |
| 189 | 174 |
| 190 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ | 175 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ |
| OLD | NEW |