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 .
19 #ifndef INCLUDED_SVL_LANGUAGEOPTIONS_HXX
20 #define INCLUDED_SVL_LANGUAGEOPTIONS_HXX
22 #include <svl/svldllapi.h>
23 #include <sal/types.h>
24 #include <unotools/configitem.hxx>
25 #include <unotools/options.hxx>
26 #include <i18nlangtag/lang.h>
27 #include <o3tl/typed_flags_set.hxx>
29 // class SvtLanguageOptions ----------------------------------------------------
31 // these defines can be ORed
32 // note these values DO NOT match the values in css::i18n::ScriptType
33 enum class SvtScriptType
39 UNKNOWN
= 0x08 // (only used in SC) if type has not been determined yet
43 template<> struct typed_flags
<SvtScriptType
> : is_typed_flags
<SvtScriptType
, 0x0f> {};
49 class SVL_DLLPUBLIC SvtLanguageOptions
: public ::utl::detail::Options
52 SvtCJKOptions
* m_pCJKOptions
;
53 SvtCTLOptions
* m_pCTLOptions
;
71 E_CTLSEQUENCECHECKING
,
76 // bDontLoad is for referencing purposes only
77 SvtLanguageOptions( bool _bDontLoad
= false );
78 virtual ~SvtLanguageOptions() override
;
81 bool IsCJKFontEnabled() const;
82 bool IsVerticalTextEnabled() const;
83 bool IsAsianTypographyEnabled() const;
84 bool IsJapaneseFindEnabled() const;
85 void SetAll( bool _bSet
);
86 bool IsAnyEnabled() const;
89 void SetCTLFontEnabled( bool _bEnabled
);
90 bool IsCTLFontEnabled() const;
92 void SetCTLSequenceChecking( bool _bEnabled
);
94 void SetCTLSequenceCheckingRestricted( bool _bEnable
);
96 void SetCTLSequenceCheckingTypeAndReplace( bool _bEnable
);
98 bool IsReadOnly(EOption eOption
) const;
100 // returns for a language the scripttype
101 static SvtScriptType
GetScriptTypeOfLanguage( LanguageType nLang
);
103 // convert from css::i18n::ScriptType constants to SvtScriptType
104 static SvtScriptType
FromI18NToSvtScriptType( sal_Int16 nI18NType
);
106 static sal_Int16
FromSvtScriptTypeToI18N( SvtScriptType nI18NType
);
108 static sal_Int16
GetI18NScriptTypeOfLanguage( LanguageType nLang
);
112 /** #i42730# Gives access to the Windows 16bit system locale
114 class SVL_DLLPUBLIC SvtSystemLanguageOptions
: public utl::ConfigItem
117 OUString m_sWin16SystemLocale
;
119 bool isKeyboardLayoutTypeInstalled(sal_Int16 scriptType
) const;
121 virtual void ImplCommit() override
;
124 SvtSystemLanguageOptions();
125 virtual ~SvtSystemLanguageOptions() override
;
127 virtual void Notify( const css::uno::Sequence
< OUString
>& rPropertyNames
) override
;
129 LanguageType
GetWin16SystemLanguage() const;
131 bool isCJKKeyboardLayoutInstalled() const;
134 OUString SVL_DLLPUBLIC
getInstalledLocaleForLanguage(css::uno::Sequence
<OUString
> const & installed
, OUString
const & locale
);
135 OUString SVL_DLLPUBLIC
getInstalledLocaleForSystemUILanguage(css::uno::Sequence
<OUString
> const & installed
);
137 #endif // INCLUDED_SVL_LANGUAGEOPTIONS_HXX
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */