OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_BASE_L10N_L10N_UTIL_MAC_H_ | 5 #ifndef UI_BASE_L10N_L10N_UTIL_MAC_H_ |
6 #define UI_BASE_L10N_L10N_UTIL_MAC_H_ | 6 #define UI_BASE_L10N_L10N_UTIL_MAC_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 #include "ui/ui_api.h" | 14 #include "ui/base/ui_export.h" |
15 | 15 |
16 #ifdef __OBJC__ | 16 #ifdef __OBJC__ |
17 @class NSString; | 17 @class NSString; |
18 #else | 18 #else |
19 class NSString; | 19 class NSString; |
20 #endif | 20 #endif |
21 | 21 |
22 namespace l10n_util { | 22 namespace l10n_util { |
23 | 23 |
24 // Remove the Windows-style accelerator marker (for labels, menuitems, etc.) | 24 // Remove the Windows-style accelerator marker (for labels, menuitems, etc.) |
25 // and change "..." into an ellipsis. | 25 // and change "..." into an ellipsis. |
26 // Returns the result in an autoreleased NSString. | 26 // Returns the result in an autoreleased NSString. |
27 UI_API NSString* FixUpWindowsStyleLabel(const string16& label); | 27 UI_EXPORT NSString* FixUpWindowsStyleLabel(const string16& label); |
28 | 28 |
29 // Pulls resource string from the string bundle and returns it. | 29 // Pulls resource string from the string bundle and returns it. |
30 UI_API NSString* GetNSString(int message_id); | 30 UI_EXPORT NSString* GetNSString(int message_id); |
31 | 31 |
32 // Get a resource string and replace $1-$2-$3 with |a| and |b| | 32 // Get a resource string and replace $1-$2-$3 with |a| and |b| |
33 // respectively. Additionally, $$ is replaced by $. | 33 // respectively. Additionally, $$ is replaced by $. |
34 UI_API NSString* GetNSStringF(int message_id, | 34 UI_EXPORT NSString* GetNSStringF(int message_id, |
35 const string16& a); | 35 const string16& a); |
36 UI_API NSString* GetNSStringF(int message_id, | 36 UI_EXPORT NSString* GetNSStringF(int message_id, |
37 const string16& a, | 37 const string16& a, |
38 const string16& b); | 38 const string16& b); |
39 UI_API NSString* GetNSStringF(int message_id, | 39 UI_EXPORT NSString* GetNSStringF(int message_id, |
40 const string16& a, | 40 const string16& a, |
41 const string16& b, | 41 const string16& b, |
42 const string16& c); | 42 const string16& c); |
43 UI_API NSString* GetNSStringF(int message_id, | 43 UI_EXPORT NSString* GetNSStringF(int message_id, |
44 const string16& a, | 44 const string16& a, |
45 const string16& b, | 45 const string16& b, |
46 const string16& c, | 46 const string16& c, |
47 const string16& d); | 47 const string16& d); |
48 | 48 |
49 // Variants that return the offset(s) of the replaced parameters. (See | 49 // Variants that return the offset(s) of the replaced parameters. (See |
50 // app/l10n_util.h for more details.) | 50 // app/l10n_util.h for more details.) |
51 UI_API NSString* GetNSStringF(int message_id, | 51 UI_EXPORT NSString* GetNSStringF(int message_id, |
52 const string16& a, | 52 const string16& a, |
53 const string16& b, | 53 const string16& b, |
54 std::vector<size_t>* offsets); | 54 std::vector<size_t>* offsets); |
55 | 55 |
56 // Same as GetNSString, but runs the result through FixUpWindowsStyleLabel | 56 // Same as GetNSString, but runs the result through FixUpWindowsStyleLabel |
57 // before returning it. | 57 // before returning it. |
58 UI_API NSString* GetNSStringWithFixup(int message_id); | 58 UI_EXPORT NSString* GetNSStringWithFixup(int message_id); |
59 | 59 |
60 // Same as GetNSStringF, but runs the result through FixUpWindowsStyleLabel | 60 // Same as GetNSStringF, but runs the result through FixUpWindowsStyleLabel |
61 // before returning it. | 61 // before returning it. |
62 UI_API NSString* GetNSStringFWithFixup(int message_id, | 62 UI_EXPORT NSString* GetNSStringFWithFixup(int message_id, |
63 const string16& a); | 63 const string16& a); |
64 UI_API NSString* GetNSStringFWithFixup(int message_id, | 64 UI_EXPORT NSString* GetNSStringFWithFixup(int message_id, |
65 const string16& a, | 65 const string16& a, |
66 const string16& b); | 66 const string16& b); |
67 UI_API NSString* GetNSStringFWithFixup(int message_id, | 67 UI_EXPORT NSString* GetNSStringFWithFixup(int message_id, |
68 const string16& a, | 68 const string16& a, |
69 const string16& b, | 69 const string16& b, |
70 const string16& c); | 70 const string16& c); |
71 UI_API NSString* GetNSStringFWithFixup(int message_id, | 71 UI_EXPORT NSString* GetNSStringFWithFixup(int message_id, |
72 const string16& a, | 72 const string16& a, |
73 const string16& b, | 73 const string16& b, |
74 const string16& c, | 74 const string16& c, |
75 const string16& d); | 75 const string16& d); |
76 | 76 |
77 // Support the override of the locale with the value from Cocoa. | 77 // Support the override of the locale with the value from Cocoa. |
78 UI_API void OverrideLocaleWithCocoaLocale(); | 78 UI_EXPORT void OverrideLocaleWithCocoaLocale(); |
79 UI_API const std::string& GetLocaleOverride(); | 79 UI_EXPORT const std::string& GetLocaleOverride(); |
80 | 80 |
81 } // namespace l10n_util | 81 } // namespace l10n_util |
82 | 82 |
83 #endif // UI_BASE_L10N_L10N_UTIL_MAC_H_ | 83 #endif // UI_BASE_L10N_L10N_UTIL_MAC_H_ |
OLD | NEW |