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_WIN_H_ | 5 #ifndef UI_BASE_L10N_L10N_UTIL_WIN_H_ |
6 #define UI_BASE_L10N_L10N_UTIL_WIN_H_ | 6 #define UI_BASE_L10N_L10N_UTIL_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <windows.h> | 9 #include <windows.h> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
| 13 #include "ui/ui_api.h" |
| 14 |
13 namespace l10n_util { | 15 namespace l10n_util { |
14 | 16 |
15 // Returns the locale-dependent extended window styles. | 17 // Returns the locale-dependent extended window styles. |
16 // This function is used for adding locale-dependent extended window styles | 18 // This function is used for adding locale-dependent extended window styles |
17 // (e.g. WS_EX_LAYOUTRTL, WS_EX_RTLREADING, etc.) when creating a window. | 19 // (e.g. WS_EX_LAYOUTRTL, WS_EX_RTLREADING, etc.) when creating a window. |
18 // Callers should OR this value into their extended style value when creating | 20 // Callers should OR this value into their extended style value when creating |
19 // a window. | 21 // a window. |
20 int GetExtendedStyles(); | 22 UI_API int GetExtendedStyles(); |
21 | 23 |
22 // TODO(xji): | 24 // TODO(xji): |
23 // This is a temporary name, it will eventually replace GetExtendedStyles | 25 // This is a temporary name, it will eventually replace GetExtendedStyles |
24 int GetExtendedTooltipStyles(); | 26 UI_API int GetExtendedTooltipStyles(); |
25 | 27 |
26 // Give an HWND, this function sets the WS_EX_LAYOUTRTL extended style for the | 28 // Give an HWND, this function sets the WS_EX_LAYOUTRTL extended style for the |
27 // underlying window. When this style is set, the UI for the window is going to | 29 // underlying window. When this style is set, the UI for the window is going to |
28 // be mirrored. This is generally done for the UI of right-to-left languages | 30 // be mirrored. This is generally done for the UI of right-to-left languages |
29 // such as Hebrew. | 31 // such as Hebrew. |
30 void HWNDSetRTLLayout(HWND hwnd); | 32 UI_API void HWNDSetRTLLayout(HWND hwnd); |
31 | 33 |
32 // See http://blogs.msdn.com/oldnewthing/archive/2005/09/15/467598.aspx | 34 // See http://blogs.msdn.com/oldnewthing/archive/2005/09/15/467598.aspx |
33 // and http://blogs.msdn.com/oldnewthing/archive/2006/06/26/647365.aspx | 35 // and http://blogs.msdn.com/oldnewthing/archive/2006/06/26/647365.aspx |
34 // as to why we need these three functions. | 36 // as to why we need these three functions. |
35 | 37 |
36 // Return true if the default font (we get from Windows) is not suitable | 38 // Return true if the default font (we get from Windows) is not suitable |
37 // to use in the UI of the current UI (e.g. Malayalam, Bengali). If | 39 // to use in the UI of the current UI (e.g. Malayalam, Bengali). If |
38 // override_font_family and font_size_scaler are not null, they'll be | 40 // override_font_family and font_size_scaler are not null, they'll be |
39 // filled with the font family name and the size scaler. | 41 // filled with the font family name and the size scaler. |
40 bool NeedOverrideDefaultUIFont(std::wstring* override_font_family, | 42 UI_API bool NeedOverrideDefaultUIFont(std::wstring* override_font_family, |
41 double* font_size_scaler); | 43 double* font_size_scaler); |
42 | 44 |
43 // If the default UI font stored in |logfont| is not suitable, its family | 45 // If the default UI font stored in |logfont| is not suitable, its family |
44 // and size are replaced with those stored in the per-locale resource. | 46 // and size are replaced with those stored in the per-locale resource. |
45 void AdjustUIFont(LOGFONT* logfont); | 47 UI_API void AdjustUIFont(LOGFONT* logfont); |
46 | 48 |
47 // If the font for a given window (pointed to by HWND) is not suitable for the | 49 // If the font for a given window (pointed to by HWND) is not suitable for the |
48 // UI in the current UI langauge, its family and size are replaced with those | 50 // UI in the current UI langauge, its family and size are replaced with those |
49 // stored in the per-locale resource. | 51 // stored in the per-locale resource. |
50 void AdjustUIFontForWindow(HWND hwnd); | 52 UI_API void AdjustUIFontForWindow(HWND hwnd); |
51 | 53 |
52 // Allow processes to override the configured locale with the user's Windows UI | 54 // Allow processes to override the configured locale with the user's Windows UI |
53 // languages. This function should generally be called once early in | 55 // languages. This function should generally be called once early in |
54 // Application startup. | 56 // Application startup. |
55 void OverrideLocaleWithUILanguageList(); | 57 UI_API void OverrideLocaleWithUILanguageList(); |
56 | 58 |
57 // Retrieve the locale override, or an empty vector if the locale has not been | 59 // Retrieve the locale override, or an empty vector if the locale has not been |
58 // or failed to be overridden. | 60 // or failed to be overridden. |
59 const std::vector<std::string>& GetLocaleOverrides(); | 61 const std::vector<std::string>& GetLocaleOverrides(); |
60 | 62 |
61 } // namespace l10n_util | 63 } // namespace l10n_util |
62 | 64 |
63 #endif // UI_BASE_L10N_L10N_UTIL_WIN_H_ | 65 #endif // UI_BASE_L10N_L10N_UTIL_WIN_H_ |
OLD | NEW |