Bump version to 6.4-15
[LibreOffice.git] / include / svl / languageoptions.hxx
blob5fc9c8624dc41dc46939e7ca9cd29b4aa212236d
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 .
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>
28 #include <memory>
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
36 NONE = 0x00,
37 LATIN = 0x01,
38 ASIAN = 0x02,
39 COMPLEX = 0x04,
40 UNKNOWN = 0x08 // (only used in SC) if type has not been determined yet
42 namespace o3tl
44 template<> struct typed_flags<SvtScriptType> : is_typed_flags<SvtScriptType, 0x0f> {};
47 class SvtCJKOptions;
48 class SvtCTLOptions;
50 class SVL_DLLPUBLIC SvtLanguageOptions final : public ::utl::detail::Options
52 private:
53 std::unique_ptr<SvtCJKOptions> m_pCJKOptions;
54 std::unique_ptr<SvtCTLOptions> m_pCTLOptions;
56 public:
57 enum EOption
59 // cjk options
60 E_CJKFONT,
61 E_VERTICALTEXT,
62 E_ASIANTYPOGRAPHY,
63 E_JAPANESEFIND,
64 E_RUBY,
65 E_CHANGECASEMAP,
66 E_DOUBLELINES,
67 E_EMPHASISMARKS,
68 E_VERTICALCALLOUT,
69 E_ALLCJK,
70 // ctl options
71 E_CTLFONT,
72 E_CTLSEQUENCECHECKING,
73 E_CTLCURSORMOVEMENT,
74 E_CTLTEXTNUMERALS
77 // bDontLoad is for referencing purposes only
78 SvtLanguageOptions( bool _bDontLoad = false );
79 virtual ~SvtLanguageOptions() override;
81 // CJK options
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;
89 // CTL options
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
117 private:
118 OUString m_sWin16SystemLocale;
120 bool isKeyboardLayoutTypeInstalled(sal_Int16 scriptType) const;
122 virtual void ImplCommit() override;
124 public:
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: */