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 24cdf0e10cSrcweir #ifndef INCLUDED_unotools_PRINTWARNINGOPTIONS_HXX 25cdf0e10cSrcweir #define INCLUDED_unotools_PRINTWARNINGOPTIONS_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 28cdf0e10cSrcweir // includes 29cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 30cdf0e10cSrcweir 31cdf0e10cSrcweir #include "unotools/unotoolsdllapi.h" 32cdf0e10cSrcweir #include <sal/types.h> 33cdf0e10cSrcweir #include <osl/mutex.hxx> 34cdf0e10cSrcweir #include <rtl/ustring.hxx> 35cdf0e10cSrcweir #include <unotools/options.hxx> 36cdf0e10cSrcweir 37cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 38cdf0e10cSrcweir // forward declarations 39cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 40cdf0e10cSrcweir 41cdf0e10cSrcweir /*-************************************************************************************************************//** 42cdf0e10cSrcweir @short forward declaration to our private date container implementation 43cdf0e10cSrcweir @descr We use these class as internal member to support small memory requirements. 44*86e1cf34SPedro Giffuni You can create the container if it is necessary. The class which use these mechanism 45cdf0e10cSrcweir is faster and smaller then a complete implementation! 46cdf0e10cSrcweir *//*-*************************************************************************************************************/ 47cdf0e10cSrcweir 48cdf0e10cSrcweir class SvtPrintWarningOptions_Impl; 49cdf0e10cSrcweir 50cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 51cdf0e10cSrcweir // declarations 52cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 53cdf0e10cSrcweir 54cdf0e10cSrcweir /*-************************************************************************************************************//** 55cdf0e10cSrcweir @short collect informations about startup features 56cdf0e10cSrcweir @descr - 57cdf0e10cSrcweir 58cdf0e10cSrcweir @implements - 59cdf0e10cSrcweir @base - 60cdf0e10cSrcweir 61cdf0e10cSrcweir @devstatus ready to use 62cdf0e10cSrcweir *//*-*************************************************************************************************************/ 63cdf0e10cSrcweir 64cdf0e10cSrcweir class UNOTOOLS_DLLPUBLIC SvtPrintWarningOptions: public utl::detail::Options 65cdf0e10cSrcweir { 66cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 67cdf0e10cSrcweir // public methods 68cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 69cdf0e10cSrcweir 70cdf0e10cSrcweir public: 71cdf0e10cSrcweir 72cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 73cdf0e10cSrcweir // constructor / destructor 74cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 75cdf0e10cSrcweir 76cdf0e10cSrcweir /*-****************************************************************************************************//** 77cdf0e10cSrcweir @short standard constructor and destructor 78cdf0e10cSrcweir @descr This will initialize an instance with default values. 79cdf0e10cSrcweir We implement these class with a refcount mechanism! Every instance of this class increase it 80cdf0e10cSrcweir at create and decrease it at delete time - but all instances use the same data container! 81cdf0e10cSrcweir He is implemented as a static member ... 82cdf0e10cSrcweir 83cdf0e10cSrcweir @seealso member m_nRefCount 84cdf0e10cSrcweir @seealso member m_pDataContainer 85cdf0e10cSrcweir 86cdf0e10cSrcweir @param - 87cdf0e10cSrcweir @return - 88cdf0e10cSrcweir 89cdf0e10cSrcweir @onerror - 90cdf0e10cSrcweir *//*-*****************************************************************************************************/ 91cdf0e10cSrcweir 92cdf0e10cSrcweir SvtPrintWarningOptions(); 93cdf0e10cSrcweir virtual ~SvtPrintWarningOptions(); 94cdf0e10cSrcweir 95cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 96cdf0e10cSrcweir // interface 97cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------- 98cdf0e10cSrcweir 99cdf0e10cSrcweir /*-****************************************************************************************************//** 100cdf0e10cSrcweir @short interface methods to get and set value of config key "org.openoffice.Office.Common/Print/Warning..." 101cdf0e10cSrcweir @descr These options describe internal states to enable/disable features of installed office. 102cdf0e10cSrcweir 103cdf0e10cSrcweir @seealso configuration package "org.openoffice.Office.Common/_3D-Engine" 104cdf0e10cSrcweir *//*-*****************************************************************************************************/ 105cdf0e10cSrcweir 106cdf0e10cSrcweir sal_Bool IsPaperSize() const; 107cdf0e10cSrcweir sal_Bool IsPaperOrientation() const; 108cdf0e10cSrcweir sal_Bool IsNotFound() const; 109cdf0e10cSrcweir sal_Bool IsTransparency() const; 110cdf0e10cSrcweir sal_Bool IsModifyDocumentOnPrintingAllowed() const; 111cdf0e10cSrcweir 112cdf0e10cSrcweir void SetPaperSize( sal_Bool bState ); 113cdf0e10cSrcweir void SetPaperOrientation( sal_Bool bState ); 114cdf0e10cSrcweir void SetNotFound( sal_Bool bState ); 115cdf0e10cSrcweir void SetTransparency( sal_Bool bState ); 116cdf0e10cSrcweir void SetModifyDocumentOnPrintingAllowed( sal_Bool bState ); 117cdf0e10cSrcweir 118cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 119cdf0e10cSrcweir // private methods 120cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 121cdf0e10cSrcweir 122cdf0e10cSrcweir private: 123cdf0e10cSrcweir 124cdf0e10cSrcweir /*-****************************************************************************************************//** 125cdf0e10cSrcweir @short return a reference to a static mutex 126cdf0e10cSrcweir @descr These class use his own static mutex to be threadsafe. 127cdf0e10cSrcweir We create a static mutex only for one ime and use at different times. 128cdf0e10cSrcweir 129cdf0e10cSrcweir @seealso - 130cdf0e10cSrcweir 131cdf0e10cSrcweir @param - 132cdf0e10cSrcweir @return A reference to a static mutex member. 133cdf0e10cSrcweir 134cdf0e10cSrcweir @onerror - 135cdf0e10cSrcweir *//*-*****************************************************************************************************/ 136cdf0e10cSrcweir 137cdf0e10cSrcweir UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex(); 138cdf0e10cSrcweir 139cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 140cdf0e10cSrcweir // private member 141cdf0e10cSrcweir //------------------------------------------------------------------------------------------------------------- 142cdf0e10cSrcweir private: 143cdf0e10cSrcweir 144cdf0e10cSrcweir /*Attention 145cdf0e10cSrcweir 146cdf0e10cSrcweir Don't initialize these static member in these header! 147cdf0e10cSrcweir a) Double dfined symbols will be detected ... 148cdf0e10cSrcweir b) and unresolved externals exist at linking time. 149cdf0e10cSrcweir Do it in your source only. 150cdf0e10cSrcweir */ 151cdf0e10cSrcweir 152cdf0e10cSrcweir static SvtPrintWarningOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements! 153cdf0e10cSrcweir static sal_Int32 m_nRefCount ; /// internal ref count mechanism 154cdf0e10cSrcweir 155cdf0e10cSrcweir }; // class SvtPrintWarningOptions 156cdf0e10cSrcweir 157cdf0e10cSrcweir #endif // #ifndef INCLUDED_unotools_PRINTWARNINGOPTIONS_HXX 158