1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: syslocaleoptions.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef INCLUDED_SVTOOLS_SYSLOCALEOPTIONS_HXX
32 #define INCLUDED_SVTOOLS_SYSLOCALEOPTIONS_HXX
34 #ifndef INCLUDED_SVTDLLAPI_H
35 #include "bf_svtools/svtdllapi.h"
39 #include <sal/types.h>
41 #ifndef _RTL_USTRING_HXX_
42 #include <rtl/ustring.hxx>
46 #include <tools/solar.h>
49 #include <tools/link.hxx>
51 #ifndef INCLUDED_I18NPOOL_LANG_H
52 #include <i18npool/lang.h>
55 #include <tools/string.hxx>
57 #ifndef INCLUDED_SVTOOLS_OPTIONS_HXX
58 #include <bf_svtools/options.hxx>
61 namespace osl
{ class Mutex
; }
66 // bits for broadcasting hints of changes in a SfxSimpleHint, may be combined
67 const ULONG SYSLOCALEOPTIONS_HINT_LOCALE
= 0x00000001;
68 const ULONG SYSLOCALEOPTIONS_HINT_CURRENCY
= 0x00000002;
70 class SvtSysLocaleOptions_Impl
;
74 class SvtSysLocaleOptions
: public Options
76 static SvtSysLocaleOptions_Impl
* pOptions
;
77 static sal_Int32 nRefCount
;
79 static ::osl::Mutex
& GetMutex();
88 SvtSysLocaleOptions();
89 virtual ~SvtSysLocaleOptions();
93 /** Add a listener to react on config changes
94 which are broadcasted in a SfxSimpleHint
99 BOOL
AddListener( SvtListener
& );
100 BOOL
RemoveListener( SvtListener
& );
102 // config value access methods
104 /// The config string may be empty to denote the default currency of the locale
105 const ::rtl::OUString
& GetCurrencyConfigString() const;
107 // convenience methods
109 /// Get currency abbreviation and locale from an USD-en-US or EUR-de-DE string
110 static void GetCurrencyAbbrevAndLanguage(
113 const ::rtl::OUString
& rConfigString
);
115 void GetCurrencyAbbrevAndLanguage(
117 LanguageType
& eLang
) const
119 GetCurrencyAbbrevAndLanguage( rAbbrev
,
120 eLang
, GetCurrencyConfigString() );
123 /** Set a link to a method to be called whenever the default currency
124 changes. This can be only one method, and normally it is the static
125 link method which calls SvNumberFormatter::SetDefaultSystemCurrency().
126 This is needed because the number formatter isn't part of the svl light
127 library, otherwise we could call SetDefaultSystemCurrency() directly.
129 static void SetCurrencyChangeLink( const Link
& rLink
);
130 static const Link
& GetCurrencyChangeLink();
135 #endif // INCLUDED_SVTOOLS_SYSLOCALEOPTIONS_HXX