sc: filter: rtf: add method "AddFont"
[LibreOffice.git] / include / unotools / syslocale.hxx
blobae3153b7976afce4ffc1b3b13f1373aef9f52ca7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
24 #include <rtl/textenc.h>
26 #include <memory>
28 class CharClass;
29 class LanguageTag;
30 class LocaleDataWrapper;
31 class SvtSysLocale_Impl;
32 class SvtSysLocaleOptions;
34 namespace osl { class Mutex; }
36 /**
37 SvtSysLocale provides a refcounted single instance of an application wide
38 LocaleDataWrapper and <type>CharClass</type> which always
39 follow the locale as it is currently configured by the user. You may use
40 it anywhere to access the locale data elements like decimal separator and
41 simple date formatting and so on. Constructing and destructing a
42 SvtSysLocale is not expensive as long as there is at least one instance
43 left.
45 class UNOTOOLS_DLLPUBLIC SvtSysLocale
47 friend class SvtSysLocale_Impl; // access to mutex
49 std::shared_ptr<SvtSysLocale_Impl> pImpl;
51 UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetMutex();
53 public:
54 SvtSysLocale();
55 ~SvtSysLocale();
57 const LocaleDataWrapper& GetLocaleData() const;
58 const CharClass& GetCharClass() const;
60 /** It is safe to store the pointers locally and use them AS LONG AS THE
61 INSTANCE OF SvtSysLocale LIVES!
62 It is a faster access but be sure what you do!
64 SvtSysLocaleOptions& GetOptions() const;
65 const LanguageTag& GetLanguageTag() const;
66 const LanguageTag& GetUILanguageTag() const;
68 /** Get the best MIME encoding matching the system locale, or if that isn't
69 determinable one that matches the UI locale, or UTF8 if everything else
70 fails.
72 static rtl_TextEncoding GetBestMimeEncoding();
75 #endif // INCLUDED_SVTOOLS_SYSLOCALE_HXX
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */