1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _SVTOOLS_LANGUAGEOPTIONS_HXX 28 #define _SVTOOLS_LANGUAGEOPTIONS_HXX 29 30 #include "svl/svldllapi.h" 31 #include <sal/types.h> 32 #include <svl/brdcst.hxx> 33 #include <svl/lstner.hxx> 34 #include <unotools/configitem.hxx> 35 #include <unotools/options.hxx> 36 #include <i18npool/lang.h> 37 38 // class SvtLanguageOptions ---------------------------------------------------- 39 40 // these defines can be ored 41 #define SCRIPTTYPE_LATIN 0x01 42 #define SCRIPTTYPE_ASIAN 0x02 43 #define SCRIPTTYPE_COMPLEX 0x04 44 45 class SvtCJKOptions; 46 class SvtCTLOptions; 47 48 class SVL_DLLPUBLIC SvtLanguageOptions : public ::utl::detail::Options 49 { 50 private: 51 SvtCJKOptions* m_pCJKOptions; 52 SvtCTLOptions* m_pCTLOptions; 53 54 public: 55 enum EOption 56 { 57 // cjk options 58 E_CJKFONT, 59 E_VERTICALTEXT, 60 E_ASIANTYPOGRAPHY, 61 E_JAPANESEFIND, 62 E_RUBY, 63 E_CHANGECASEMAP, 64 E_DOUBLELINES, 65 E_EMPHASISMARKS, 66 E_VERTICALCALLOUT, 67 E_ALLCJK, 68 // ctl options 69 E_CTLFONT, 70 E_CTLSEQUENCECHECKING, 71 E_CTLCURSORMOVEMENT, 72 E_CTLTEXTNUMERALS 73 }; 74 75 // bDontLoad is for referencing purposes only 76 SvtLanguageOptions( sal_Bool _bDontLoad = sal_False ); 77 ~SvtLanguageOptions(); 78 79 // CJK options 80 sal_Bool IsCJKFontEnabled() const; 81 sal_Bool IsVerticalTextEnabled() const; 82 sal_Bool IsAsianTypographyEnabled() const; 83 sal_Bool IsJapaneseFindEnabled() const; 84 sal_Bool IsRubyEnabled() const; 85 sal_Bool IsChangeCaseMapEnabled() const; 86 sal_Bool IsDoubleLinesEnabled() const; 87 sal_Bool IsEmphasisMarksEnabled() const; 88 sal_Bool IsVerticalCallOutEnabled() const; 89 void SetAll( sal_Bool _bSet ); 90 sal_Bool IsAnyEnabled() const; 91 92 // CTL options 93 void SetCTLFontEnabled( sal_Bool _bEnabled ); 94 sal_Bool IsCTLFontEnabled() const; 95 96 void SetCTLSequenceChecking( sal_Bool _bEnabled ); 97 sal_Bool IsCTLSequenceChecking() const; 98 99 void SetCTLSequenceCheckingRestricted( sal_Bool _bEnable ); 100 sal_Bool IsCTLSequenceCheckingRestricted( void ) const; 101 102 void SetCTLSequenceCheckingTypeAndReplace( sal_Bool _bEnable ); 103 sal_Bool IsCTLSequenceCheckingTypeAndReplace() const; 104 105 sal_Bool IsReadOnly(EOption eOption) const; 106 107 // returns for a language the scripttype 108 static sal_uInt16 GetScriptTypeOfLanguage( sal_uInt16 nLang ); 109 }; 110 /** #i42730# Gives access to the Windows 16bit system locale 111 */ 112 class SVL_DLLPUBLIC SvtSystemLanguageOptions : public utl::ConfigItem 113 { 114 private: 115 ::rtl::OUString m_sWin16SystemLocale; 116 117 public: 118 SvtSystemLanguageOptions(); 119 ~SvtSystemLanguageOptions(); 120 121 virtual void Commit(); 122 virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames ); 123 124 LanguageType GetWin16SystemLanguage(); 125 }; 126 127 #endif // _SVTOOLS_LANGUAGEOPTIONS_HXX 128 129