1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_UNOTOOLS_SYSLOCALE_HXX
21 #define INCLUDED_UNOTOOLS_SYSLOCALE_HXX
23 #include <unotools/unotoolsdllapi.h>
29 class LocaleDataWrapper
;
30 class SvtSysLocale_Impl
;
31 class SvtSysLocaleOptions
;
34 SvtSysLocale provides a refcounted single instance of an application wide
35 LocaleDataWrapper and <type>CharClass</type> which always
36 follow the locale as it is currently configured by the user. You may use
37 it anywhere to access the locale data elements like decimal separator and
38 simple date formatting and so on. Constructing and destructing a
39 SvtSysLocale is not expensive as long as there is at least one instance
42 class UNOTOOLS_DLLPUBLIC SvtSysLocale
44 friend class SvtSysLocale_Impl
; // access to mutex
46 std::shared_ptr
<SvtSysLocale_Impl
> pImpl
;
52 const LocaleDataWrapper
& GetLocaleData() const;
53 const CharClass
& GetCharClass() const;
55 /** It is safe to store the pointers locally and use them AS LONG AS THE
56 INSTANCE OF SvtSysLocale LIVES!
57 It is a faster access but be sure what you do!
59 SvtSysLocaleOptions
& GetOptions() const;
60 const LanguageTag
& GetLanguageTag() const;
61 const LanguageTag
& GetUILanguageTag() const;
64 #endif // INCLUDED_SVTOOLS_SYSLOCALE_HXX
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */