OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 | 89 |
90 // Converts an input method ID to a display name of the IME. Returns | 90 // Converts an input method ID to a display name of the IME. Returns |
91 // "USA" (US keyboard) when |input_method_id| is unknown. | 91 // "USA" (US keyboard) when |input_method_id| is unknown. |
92 // Examples: "pinyin" => "Pinyin" | 92 // Examples: "pinyin" => "Pinyin" |
93 // "m17n:ar:kbd" => "kbd (m17n)" | 93 // "m17n:ar:kbd" => "kbd (m17n)" |
94 std::string GetInputMethodDisplayNameFromId(const std::string& input_method_id); | 94 std::string GetInputMethodDisplayNameFromId(const std::string& input_method_id); |
95 | 95 |
96 // Converts a language code to a language display name, using the | 96 // Converts a language code to a language display name, using the |
97 // current application locale. MaybeRewriteLanguageName() is called | 97 // current application locale. MaybeRewriteLanguageName() is called |
98 // internally. | 98 // internally. |
99 // Examples: "fr" => "French" | 99 // Examples: "fi" => "French" |
Yusuke Sato
2010/08/05 08:52:36
French -> Finnish
satorux1
2010/08/05 08:54:29
Done.
| |
100 // "en-US" => "English (United States)" | 100 // "en-US" => "English (United States)" |
101 std::wstring GetLanguageDisplayNameFromCode(const std::string& language_code); | 101 std::wstring GetLanguageDisplayNameFromCode(const std::string& language_code); |
102 | 102 |
103 // Converts a language code to a language native display name. | |
104 // MaybeRewriteLanguageName() is called internally. | |
105 // Examples: "fi" => "suomi" (rather than Finnish) | |
106 // "en-US" => "English (United States)" | |
107 std::wstring GetLanguageNativeDisplayNameFromCode( | |
108 const std::string& language_code); | |
109 | |
103 // Sorts the given language codes by their corresponding language names, | 110 // Sorts the given language codes by their corresponding language names, |
104 // using the unicode string comparator. Uses unstable sorting. | 111 // using the unicode string comparator. Uses unstable sorting. |
105 void SortLanguageCodesByNames(std::vector<std::string>* language_codes); | 112 void SortLanguageCodesByNames(std::vector<std::string>* language_codes); |
106 | 113 |
107 // Sorts the given input method ids by their corresponding language names, | 114 // Sorts the given input method ids by their corresponding language names, |
108 // using the unicode string comparator. Uses stable sorting. | 115 // using the unicode string comparator. Uses stable sorting. |
109 void SortInputMethodIdsByNames(std::vector<std::string>* input_method_ids); | 116 void SortInputMethodIdsByNames(std::vector<std::string>* input_method_ids); |
110 | 117 |
111 // Reorders the given input method ids for the language code. For | 118 // Reorders the given input method ids for the language code. For |
112 // example, if |language_codes| is "fr" and |input_method_ids| contains | 119 // example, if |language_codes| is "fr" and |input_method_ids| contains |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
154 bool GetInputMethodIdsFromLanguageCodeInternal( | 161 bool GetInputMethodIdsFromLanguageCodeInternal( |
155 const std::multimap<std::string, std::string>& language_code_to_ids, | 162 const std::multimap<std::string, std::string>& language_code_to_ids, |
156 const std::string& normalized_language_code, | 163 const std::string& normalized_language_code, |
157 InputMethodType type, | 164 InputMethodType type, |
158 std::vector<std::string>* out_input_method_ids); | 165 std::vector<std::string>* out_input_method_ids); |
159 | 166 |
160 } // namespace input_method | 167 } // namespace input_method |
161 } // namespace chromeos | 168 } // namespace chromeos |
162 | 169 |
163 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ | 170 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ |
OLD | NEW |