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 <o3tl/typed_flags_set.hxx>
25 #include <unotools/configitem.hxx>
26 #include <unotools/options.hxx>
27 #include <i18nlangtag/lang.h>
30 // class SvtLanguageOptions ----------------------------------------------------
32 // these defines can be ORed
33 // note these values DO NOT match the values in css::i18n::ScriptType
34 enum class SvtScriptType
40 UNKNOWN
= 0x08 // (only used in SC) if type has not been determined yet
44 template<> struct typed_flags
<SvtScriptType
> : is_typed_flags
<SvtScriptType
, 0x0f> {};
50 class SVL_DLLPUBLIC SvtLanguageOptions final
: public ::utl::detail::Options
53 std::unique_ptr
<SvtCJKOptions
> m_pCJKOptions
;
54 std::unique_ptr
<SvtCTLOptions
> m_pCTLOptions
;
72 E_CTLSEQUENCECHECKING
,
77 // bDontLoad is for referencing purposes only
78 SvtLanguageOptions( bool _bDontLoad
= false );
79 virtual ~SvtLanguageOptions() override
;
82 bool IsCJKFontEnabled() const;
83 bool IsVerticalTextEnabled() const;
84 bool IsAsianTypographyEnabled() const;
85 bool IsJapaneseFindEnabled() const;
86 void SetAll( bool _bSet
);
87 bool IsAnyEnabled() const;
90 void SetCTLFontEnabled( bool _bEnabled
);
91 bool IsCTLFontEnabled() const;
93 void SetCTLSequenceChecking( bool _bEnabled
);
95 void SetCTLSequenceCheckingRestricted( bool _bEnable
);
97 void SetCTLSequenceCheckingTypeAndReplace( bool _bEnable
);
99 bool IsReadOnly(EOption eOption
) const;
101 // returns for a language the scripttype
102 static SvtScriptType
GetScriptTypeOfLanguage( LanguageType nLang
);
104 // convert from css::i18n::ScriptType constants to SvtScriptType
105 static SvtScriptType
FromI18NToSvtScriptType( sal_Int16 nI18NType
);
107 static sal_Int16
FromSvtScriptTypeToI18N( SvtScriptType nI18NType
);
109 static sal_Int16
GetI18NScriptTypeOfLanguage( LanguageType nLang
);
113 /** #i42730# Gives access to the Windows 16bit system locale
115 class SvtSystemLanguageOptions final
: public utl::ConfigItem
118 OUString m_sWin16SystemLocale
;
120 bool isKeyboardLayoutTypeInstalled(sal_Int16 scriptType
) const;
122 virtual void ImplCommit() override
;
125 SvtSystemLanguageOptions();
126 virtual ~SvtSystemLanguageOptions() override
;
128 virtual void Notify( const css::uno::Sequence
< OUString
>& rPropertyNames
) override
;
130 LanguageType
GetWin16SystemLanguage() const;
132 bool isCJKKeyboardLayoutInstalled() const;
135 #endif // INCLUDED_SVL_LANGUAGEOPTIONS_HXX
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */