1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _SVTOOLS_LANGUAGEOPTIONS_HXX 24 #define _SVTOOLS_LANGUAGEOPTIONS_HXX 25 26 #include "svl/svldllapi.h" 27 #include <sal/types.h> 28 #include <svl/brdcst.hxx> 29 #include <svl/lstner.hxx> 30 #include <unotools/configitem.hxx> 31 #include <unotools/options.hxx> 32 #include <i18npool/lang.h> 33 34 // class SvtLanguageOptions ---------------------------------------------------- 35 36 // these defines can be ored 37 #define SCRIPTTYPE_LATIN 0x01 38 #define SCRIPTTYPE_ASIAN 0x02 39 #define SCRIPTTYPE_COMPLEX 0x04 40 41 class SvtCJKOptions; 42 class SvtCTLOptions; 43 44 class SVL_DLLPUBLIC SvtLanguageOptions : public ::utl::detail::Options 45 { 46 private: 47 SvtCJKOptions* m_pCJKOptions; 48 SvtCTLOptions* m_pCTLOptions; 49 50 public: 51 enum EOption 52 { 53 // cjk options 54 E_CJKFONT, 55 E_VERTICALTEXT, 56 E_ASIANTYPOGRAPHY, 57 E_JAPANESEFIND, 58 E_RUBY, 59 E_CHANGECASEMAP, 60 E_DOUBLELINES, 61 E_EMPHASISMARKS, 62 E_VERTICALCALLOUT, 63 E_ALLCJK, 64 // ctl options 65 E_CTLFONT, 66 E_CTLSEQUENCECHECKING, 67 E_CTLCURSORMOVEMENT, 68 E_CTLTEXTNUMERALS 69 }; 70 71 // bDontLoad is for referencing purposes only 72 SvtLanguageOptions( sal_Bool _bDontLoad = sal_False ); 73 ~SvtLanguageOptions(); 74 75 // CJK options 76 sal_Bool IsCJKFontEnabled() const; 77 sal_Bool IsVerticalTextEnabled() const; 78 sal_Bool IsAsianTypographyEnabled() const; 79 sal_Bool IsJapaneseFindEnabled() const; 80 sal_Bool IsRubyEnabled() const; 81 sal_Bool IsChangeCaseMapEnabled() const; 82 sal_Bool IsDoubleLinesEnabled() const; 83 sal_Bool IsEmphasisMarksEnabled() const; 84 sal_Bool IsVerticalCallOutEnabled() const; 85 void SetAll( sal_Bool _bSet ); 86 sal_Bool IsAnyEnabled() const; 87 88 // CTL options 89 void SetCTLFontEnabled( sal_Bool _bEnabled ); 90 sal_Bool IsCTLFontEnabled() const; 91 92 void SetCTLSequenceChecking( sal_Bool _bEnabled ); 93 sal_Bool IsCTLSequenceChecking() const; 94 95 void SetCTLSequenceCheckingRestricted( sal_Bool _bEnable ); 96 sal_Bool IsCTLSequenceCheckingRestricted( void ) const; 97 98 void SetCTLSequenceCheckingTypeAndReplace( sal_Bool _bEnable ); 99 sal_Bool IsCTLSequenceCheckingTypeAndReplace() const; 100 101 sal_Bool IsReadOnly(EOption eOption) const; 102 103 // returns for a language the scripttype 104 static sal_uInt16 GetScriptTypeOfLanguage( sal_uInt16 nLang ); 105 }; 106 /** #i42730# Gives access to the Windows 16bit system locale 107 */ 108 class SVL_DLLPUBLIC SvtSystemLanguageOptions : public utl::ConfigItem 109 { 110 private: 111 ::rtl::OUString m_sWin16SystemLocale; 112 113 public: 114 SvtSystemLanguageOptions(); 115 ~SvtSystemLanguageOptions(); 116 117 virtual void Commit(); 118 virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames ); 119 120 LanguageType GetWin16SystemLanguage(); 121 }; 122 123 #endif // _SVTOOLS_LANGUAGEOPTIONS_HXX 124 125