Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1422)

Unified Diff: ui/base/l10n/l10n_util.h

Issue 7328011: Introduce ui.dll / libui.so for the component build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/base/l10n/l10n_util.h
===================================================================
--- ui/base/l10n/l10n_util.h (revision 92815)
+++ ui/base/l10n/l10n_util.h (working copy)
@@ -14,6 +14,7 @@
#include "base/string16.h"
#include "base/string_util.h"
+#include "ui/ui_api.h"
#if defined(OS_MACOSX)
#include "ui/base/l10n/l10n_util_mac.h"
@@ -30,7 +31,7 @@
// as |pref_locale|), finally, we fall back on the system locale. We only return
// a value if there's a corresponding resource DLL for the locale. Otherwise,
// we fall back to en-us.
-std::string GetApplicationLocale(const std::string& pref_locale);
+UI_API std::string GetApplicationLocale(const std::string& pref_locale);
// Given a locale code, return true if the OS is capable of supporting it.
// For instance, Oriya is not well supported on Windows XP and we return
@@ -46,18 +47,18 @@
// in the UI thread.
// If |is_for_ui| is true, U+200F is appended so that it can be
// rendered properly in a RTL Chrome.
-string16 GetDisplayNameForLocale(const std::string& locale,
- const std::string& display_locale,
- bool is_for_ui);
+UI_API string16 GetDisplayNameForLocale(const std::string& locale,
+ const std::string& display_locale,
+ bool is_for_ui);
// Converts all - into _, to be consistent with ICU and file system names.
-std::string NormalizeLocale(const std::string& locale);
+UI_API std::string NormalizeLocale(const std::string& locale);
// Produce a vector of parent locales for given locale.
// It includes the current locale in the result.
// sr_Cyrl_RS generates sr_Cyrl_RS, sr_Cyrl and sr.
-void GetParentLocales(const std::string& current_locale,
- std::vector<std::string>* parent_locales);
+UI_API void GetParentLocales(const std::string& current_locale,
+ std::vector<std::string>* parent_locales);
// Checks if a string is plausibly a syntactically-valid locale string,
// for cases where we want the valid input to be a locale string such as
@@ -67,67 +68,67 @@
// accepted, but 'z', 'German', 'en-$1', or 'abcd-1234' should not.
// Case-insensitive. Based on BCP 47, see:
// http://unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers
-bool IsValidLocaleSyntax(const std::string& locale);
+UI_API bool IsValidLocaleSyntax(const std::string& locale);
//
// Mac Note: See l10n_util_mac.h for some NSString versions and other support.
//
// Pulls resource string from the string bundle and returns it.
-std::string GetStringUTF8(int message_id);
-string16 GetStringUTF16(int message_id);
+UI_API std::string GetStringUTF8(int message_id);
+UI_API string16 GetStringUTF16(int message_id);
// Get a resource string and replace $1-$2-$3 with |a| and |b|
// respectively. Additionally, $$ is replaced by $.
-string16 GetStringFUTF16(int message_id,
- const string16& a);
-string16 GetStringFUTF16(int message_id,
- const string16& a,
- const string16& b);
-string16 GetStringFUTF16(int message_id,
- const string16& a,
- const string16& b,
- const string16& c);
-string16 GetStringFUTF16(int message_id,
- const string16& a,
- const string16& b,
- const string16& c,
- const string16& d);
-string16 GetStringFUTF16(int message_id,
- const string16& a,
- const string16& b,
- const string16& c,
- const string16& d,
- const string16& e);
-std::string GetStringFUTF8(int message_id,
- const string16& a);
-std::string GetStringFUTF8(int message_id,
- const string16& a,
- const string16& b);
-std::string GetStringFUTF8(int message_id,
- const string16& a,
- const string16& b,
- const string16& c);
-std::string GetStringFUTF8(int message_id,
- const string16& a,
- const string16& b,
- const string16& c,
- const string16& d);
+UI_API string16 GetStringFUTF16(int message_id,
+ const string16& a);
+UI_API string16 GetStringFUTF16(int message_id,
+ const string16& a,
+ const string16& b);
+UI_API string16 GetStringFUTF16(int message_id,
+ const string16& a,
+ const string16& b,
+ const string16& c);
+UI_API string16 GetStringFUTF16(int message_id,
+ const string16& a,
+ const string16& b,
+ const string16& c,
+ const string16& d);
+UI_API string16 GetStringFUTF16(int message_id,
+ const string16& a,
+ const string16& b,
+ const string16& c,
+ const string16& d,
+ const string16& e);
+UI_API std::string GetStringFUTF8(int message_id,
+ const string16& a);
+UI_API std::string GetStringFUTF8(int message_id,
+ const string16& a,
+ const string16& b);
+UI_API std::string GetStringFUTF8(int message_id,
+ const string16& a,
+ const string16& b,
+ const string16& c);
+UI_API std::string GetStringFUTF8(int message_id,
+ const string16& a,
+ const string16& b,
+ const string16& c,
+ const string16& d);
// Variants that return the offset(s) of the replaced parameters. The
// vector based version returns offsets ordered by parameter. For example if
// invoked with a and b offsets[0] gives the offset for a and offsets[1] the
// offset of b regardless of where the parameters end up in the string.
-string16 GetStringFUTF16(int message_id,
- const string16& a,
- size_t* offset);
-string16 GetStringFUTF16(int message_id,
- const string16& a,
- const string16& b,
- std::vector<size_t>* offsets);
+UI_API string16 GetStringFUTF16(int message_id,
+ const string16& a,
+ size_t* offset);
+UI_API string16 GetStringFUTF16(int message_id,
+ const string16& a,
+ const string16& b,
+ std::vector<size_t>* offsets);
// Convenience functions to get a string with a single number as a parameter.
-string16 GetStringFUTF16Int(int message_id, int a);
+UI_API string16 GetStringFUTF16Int(int message_id, int a);
string16 GetStringFUTF16Int(int message_id, int64 a);
// Truncates the string to length characters. This breaks the string at
@@ -135,19 +136,20 @@
// character (unicode character 0x2026) to render ...
// The supplied string is returned if the string has length characters or
// less.
-string16 TruncateString(const string16& string, size_t length);
+UI_API string16 TruncateString(const string16& string, size_t length);
// In place sorting of string16 strings using collation rules for |locale|.
-void SortStrings16(const std::string& locale,
- std::vector<string16>* strings);
+UI_API void SortStrings16(const std::string& locale,
+ std::vector<string16>* strings);
// Returns a vector of available locale codes. E.g., a vector containing
// en-US, es, fr, fi, pt-PT, pt-BR, etc.
-const std::vector<std::string>& GetAvailableLocales();
+UI_API const std::vector<std::string>& GetAvailableLocales();
// Returns a vector of locale codes usable for accept-languages.
-void GetAcceptLanguagesForLocale(const std::string& display_locale,
- std::vector<std::string>* locale_codes);
+UI_API void GetAcceptLanguagesForLocale(
+ const std::string& display_locale,
+ std::vector<std::string>* locale_codes);
} // namespace l10n_util
« no previous file with comments | « ui/base/l10n/l10n_font_util.h ('k') | ui/base/l10n/l10n_util_collator.h » ('j') | ui/ui.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698