OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_COMMON_L10N_UTIL_WIN_H_ | 5 #ifndef APP_L10N_UTIL_WIN_H_ |
6 #define CHROME_COMMON_L10N_UTIL_WIN_H_ | 6 #define APP_L10N_UTIL_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 namespace l10n_util { | 10 namespace l10n_util { |
11 | 11 |
12 // Returns the locale-dependent extended window styles. | 12 // Returns the locale-dependent extended window styles. |
13 // This function is used for adding locale-dependent extended window styles | 13 // This function is used for adding locale-dependent extended window styles |
14 // (e.g. WS_EX_LAYOUTRTL, WS_EX_RTLREADING, etc.) when creating a window. | 14 // (e.g. WS_EX_LAYOUTRTL, WS_EX_RTLREADING, etc.) when creating a window. |
15 // Callers should OR this value into their extended style value when creating | 15 // Callers should OR this value into their extended style value when creating |
16 // a window. | 16 // a window. |
17 int GetExtendedStyles(); | 17 int GetExtendedStyles(); |
18 | 18 |
19 // TODO(xji): | 19 // TODO(xji): |
20 // This is a temporary name, it will eventually replace GetExtendedStyles | 20 // This is a temporary name, it will eventually replace GetExtendedStyles |
21 int GetExtendedTooltipStyles(); | 21 int GetExtendedTooltipStyles(); |
22 | 22 |
23 // Give an HWND, this function sets the WS_EX_LAYOUTRTL extended style for the | 23 // Give an HWND, this function sets the WS_EX_LAYOUTRTL extended style for the |
24 // underlying window. When this style is set, the UI for the window is going to | 24 // underlying window. When this style is set, the UI for the window is going to |
25 // be mirrored. This is generally done for the UI of right-to-left languages | 25 // be mirrored. This is generally done for the UI of right-to-left languages |
26 // such as Hebrew. | 26 // such as Hebrew. |
27 void HWNDSetRTLLayout(HWND hwnd); | 27 void HWNDSetRTLLayout(HWND hwnd); |
28 | 28 |
29 // See http://blogs.msdn.com/oldnewthing/archive/2005/09/15/467598.aspx | 29 // See http://blogs.msdn.com/oldnewthing/archive/2005/09/15/467598.aspx |
30 // and http://blogs.msdn.com/oldnewthing/archive/2006/06/26/647365.aspx | 30 // and http://blogs.msdn.com/oldnewthing/archive/2006/06/26/647365.aspx |
31 // as to why we need these three functions. | 31 // as to why we need these three functions. |
32 | 32 |
33 // Return true if the default font (we get from Windows) is not suitable | 33 // Return true if the default font (we get from Windows) is not suitable |
34 // to use in the UI of the current UI (e.g. Malayalam, Bengali). If | 34 // to use in the UI of the current UI (e.g. Malayalam, Bengali). If |
35 // override_font_family and font_size_scaler are not null, they'll be | 35 // override_font_family and font_size_scaler are not null, they'll be |
36 // filled with the font family name and the size scaler. | 36 // filled with the font family name and the size scaler. |
37 bool NeedOverrideDefaultUIFont(std::wstring* override_font_family, | 37 bool NeedOverrideDefaultUIFont(std::wstring* override_font_family, |
38 double* font_size_scaler); | 38 double* font_size_scaler); |
39 | 39 |
40 // If the default UI font stored in |logfont| is not suitable, its family | 40 // If the default UI font stored in |logfont| is not suitable, its family |
41 // and size are replaced with those stored in the per-locale resource. | 41 // and size are replaced with those stored in the per-locale resource. |
42 void AdjustUIFont(LOGFONT* logfont); | 42 void AdjustUIFont(LOGFONT* logfont); |
43 | 43 |
44 // If the font for a given window (pointed to by HWND) is not suitable for the | 44 // If the font for a given window (pointed to by HWND) is not suitable for the |
45 // UI in the current UI langauge, its family and size are replaced with those | 45 // UI in the current UI langauge, its family and size are replaced with those |
46 // stored in the per-locale resource. | 46 // stored in the per-locale resource. |
47 void AdjustUIFontForWindow(HWND hwnd); | 47 void AdjustUIFontForWindow(HWND hwnd); |
48 | 48 |
49 } // namespace l10n_util | 49 } // namespace l10n_util |
50 | 50 |
51 #endif // CHROME_COMMON_L10N_UTIL_WIN_H_ | 51 #endif // APP_L10N_UTIL_WIN_H_ |
OLD | NEW |