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