blob: 7a1dda51e649711073566531f9a7ecf0ed473da5 [file] [log] [blame]
[email protected]f88c11d2009-02-26 18:00:291// 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
3// found in the LICENSE file.
4
[email protected]a92b8642009-05-05 23:38:565#ifndef APP_L10N_UTIL_WIN_H_
6#define APP_L10N_UTIL_WIN_H_
[email protected]32b76ef2010-07-26 23:08:247#pragma once
[email protected]3cdb6cc2009-02-24 23:50:138
9#include <windows.h>
[email protected]337ca072010-11-16 15:28:4510#include <string>
11#include <vector>
[email protected]3cdb6cc2009-02-24 23:50:1312
13namespace l10n_util {
14
15// Returns the locale-dependent extended window styles.
16// 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.
18// Callers should OR this value into their extended style value when creating
19// a window.
20int GetExtendedStyles();
21
22// TODO(xji):
23// This is a temporary name, it will eventually replace GetExtendedStyles
24int GetExtendedTooltipStyles();
25
26// 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
28// be mirrored. This is generally done for the UI of right-to-left languages
29// such as Hebrew.
30void HWNDSetRTLLayout(HWND hwnd);
31
[email protected]3bd29d32009-04-15 19:16:1032// 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
[email protected]a92b8642009-05-05 23:38:5634// as to why we need these three functions.
[email protected]3bd29d32009-04-15 19:16:1035
36// 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
38// override_font_family and font_size_scaler are not null, they'll be
39// filled with the font family name and the size scaler.
40bool NeedOverrideDefaultUIFont(std::wstring* override_font_family,
41 double* font_size_scaler);
42
43// 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.
45void AdjustUIFont(LOGFONT* logfont);
46
47// 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
49// stored in the per-locale resource.
50void AdjustUIFontForWindow(HWND hwnd);
51
[email protected]337ca072010-11-16 15:28:4552// Allow processes to override the configured locale with the user's Windows UI
53// languages. This function should generally be called once early in
54// Application startup.
55void OverrideLocaleWithUILanguageList();
56
57// Retrieve the locale override, or an empty vector if the locale has not been
58// or failed to be overridden.
59const std::vector<std::string>& GetLocaleOverrides();
60
[email protected]3cdb6cc2009-02-24 23:50:1361} // namespace l10n_util
62
[email protected]a92b8642009-05-05 23:38:5663#endif // APP_L10N_UTIL_WIN_H_