1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir #ifndef INCLUDED_unotools_LOCALISATIONOPTIONS_HXX 28*cdf0e10cSrcweir #define INCLUDED_unotools_LOCALISATIONOPTIONS_HXX 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 31*cdf0e10cSrcweir // includes 32*cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir #include <sal/types.h> 35*cdf0e10cSrcweir #include "unotools/unotoolsdllapi.h" 36*cdf0e10cSrcweir #include <osl/mutex.hxx> 37*cdf0e10cSrcweir #include <unotools/options.hxx> 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 40*cdf0e10cSrcweir // forward declarations 41*cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir /*-************************************************************************************************************//** 44*cdf0e10cSrcweir @short forward declaration to our private date container implementation 45*cdf0e10cSrcweir @descr We use these class as internal member to support small memory requirements. 46*cdf0e10cSrcweir You can create the container if it is neccessary. The class which use these mechanism 47*cdf0e10cSrcweir is faster and smaller then a complete implementation! 48*cdf0e10cSrcweir *//*-*************************************************************************************************************/ 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir class SvtLocalisationOptions_Impl; 51*cdf0e10cSrcweir 52*cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 53*cdf0e10cSrcweir // declarations 54*cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 55*cdf0e10cSrcweir 56*cdf0e10cSrcweir /*-************************************************************************************************************//** 57*cdf0e10cSrcweir @short collect informations about localisation features 58*cdf0e10cSrcweir @descr - 59*cdf0e10cSrcweir 60*cdf0e10cSrcweir @implements - 61*cdf0e10cSrcweir @base - 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir @devstatus ready to use 64*cdf0e10cSrcweir *//*-*************************************************************************************************************/ 65*cdf0e10cSrcweir 66*cdf0e10cSrcweir class UNOTOOLS_DLLPUBLIC SvtLocalisationOptions: public utl::detail::Options 67*cdf0e10cSrcweir { 68*cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 69*cdf0e10cSrcweir // public methods 70*cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir public: 73*cdf0e10cSrcweir 74*cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 75*cdf0e10cSrcweir // constructor / destructor 76*cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir /*-****************************************************************************************************//** 79*cdf0e10cSrcweir @short standard constructor and destructor 80*cdf0e10cSrcweir @descr This will initialize an instance with default values. 81*cdf0e10cSrcweir We implement these class with a refcount mechanism! Every instance of this class increase it 82*cdf0e10cSrcweir at create and decrease it at delete time - but all instances use the same data container! 83*cdf0e10cSrcweir He is implemented as a static member ... 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir @seealso member m_nRefCount 86*cdf0e10cSrcweir @seealso member m_pDataContainer 87*cdf0e10cSrcweir 88*cdf0e10cSrcweir @param - 89*cdf0e10cSrcweir @return - 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir @onerror - 92*cdf0e10cSrcweir *//*-*****************************************************************************************************/ 93*cdf0e10cSrcweir 94*cdf0e10cSrcweir SvtLocalisationOptions(); 95*cdf0e10cSrcweir virtual ~SvtLocalisationOptions(); 96*cdf0e10cSrcweir 97*cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 98*cdf0e10cSrcweir // interface 99*cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 100*cdf0e10cSrcweir 101*cdf0e10cSrcweir /*-****************************************************************************************************//** 102*cdf0e10cSrcweir @short interface methods to get and set value of config key "org.openoffice.Office.Common/View/Localisation/AutoMnemonic" 103*cdf0e10cSrcweir @descr These value specifies if shortcuts should be assigned automatically. 104*cdf0e10cSrcweir 105*cdf0e10cSrcweir @seealso - 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir @param "bState", new value to set it in configuration. 108*cdf0e10cSrcweir @return The value which represent current state of internal variable. 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir @onerror No error should occurre! 111*cdf0e10cSrcweir *//*-*****************************************************************************************************/ 112*cdf0e10cSrcweir 113*cdf0e10cSrcweir sal_Bool IsAutoMnemonic ( ) const ; 114*cdf0e10cSrcweir void SetAutoMnemonic ( sal_Bool bState ) ; 115*cdf0e10cSrcweir 116*cdf0e10cSrcweir /*-****************************************************************************************************//** 117*cdf0e10cSrcweir @short interface methods to get and set value of config key "org.openoffice.Office.Common/View/Localisation/DialogScale" 118*cdf0e10cSrcweir @descr These value specifies the factor for increasing controls. 119*cdf0e10cSrcweir Value from [0..100] are allowed. 120*cdf0e10cSrcweir 121*cdf0e10cSrcweir @ATTENTION These methods don't check for valid or invalid values! 122*cdf0e10cSrcweir Our configuration server can do it ... but these implementation don't get any notifications 123*cdf0e10cSrcweir about wrong commits ...! 124*cdf0e10cSrcweir => If you set an invalid value - nothing will be changed. The information will lost. 125*cdf0e10cSrcweir 126*cdf0e10cSrcweir @seealso baseclass ConfigItem 127*cdf0e10cSrcweir 128*cdf0e10cSrcweir @param "nScale" new value to set it in configuration. 129*cdf0e10cSrcweir @return The value which represent current state of internal variable. 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir @onerror No error should occurre! 132*cdf0e10cSrcweir *//*-*****************************************************************************************************/ 133*cdf0e10cSrcweir 134*cdf0e10cSrcweir sal_Int32 GetDialogScale( ) const ; 135*cdf0e10cSrcweir void SetDialogScale( sal_Int32 nScale ) ; 136*cdf0e10cSrcweir 137*cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 138*cdf0e10cSrcweir // private methods 139*cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 140*cdf0e10cSrcweir 141*cdf0e10cSrcweir private: 142*cdf0e10cSrcweir 143*cdf0e10cSrcweir /*-****************************************************************************************************//** 144*cdf0e10cSrcweir @short return a reference to a static mutex 145*cdf0e10cSrcweir @descr These class is partially threadsafe (for de-/initialization only). 146*cdf0e10cSrcweir All access methods are'nt safe! 147*cdf0e10cSrcweir We create a static mutex only for one ime and use at different times. 148*cdf0e10cSrcweir 149*cdf0e10cSrcweir @seealso - 150*cdf0e10cSrcweir 151*cdf0e10cSrcweir @param - 152*cdf0e10cSrcweir @return A reference to a static mutex member. 153*cdf0e10cSrcweir 154*cdf0e10cSrcweir @onerror - 155*cdf0e10cSrcweir *//*-*****************************************************************************************************/ 156*cdf0e10cSrcweir 157*cdf0e10cSrcweir UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex(); 158*cdf0e10cSrcweir 159*cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 160*cdf0e10cSrcweir // private member 161*cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 162*cdf0e10cSrcweir 163*cdf0e10cSrcweir private: 164*cdf0e10cSrcweir 165*cdf0e10cSrcweir /*Attention 166*cdf0e10cSrcweir 167*cdf0e10cSrcweir Don't initialize these static member in these header! 168*cdf0e10cSrcweir a) Double dfined symbols will be detected ... 169*cdf0e10cSrcweir b) and unresolved externals exist at linking time. 170*cdf0e10cSrcweir Do it in your source only. 171*cdf0e10cSrcweir */ 172*cdf0e10cSrcweir 173*cdf0e10cSrcweir static SvtLocalisationOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements! 174*cdf0e10cSrcweir static sal_Int32 m_nRefCount ; /// internal ref count mechanism 175*cdf0e10cSrcweir 176*cdf0e10cSrcweir }; // class SvtLocalisationOptions 177*cdf0e10cSrcweir 178*cdf0e10cSrcweir #endif // #ifndef INCLUDED_unotools_LOCALISATIONOPTIONS_HXX 179