merge the formfield patch from ooo-build
[ooovba.git] / svtools / inc / cacheoptions.hxx
blob37082c8e0e8467619dbc4f48503460fb8de04798
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: cacheoptions.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef INCLUDED_SVTOOLS_CACHEOPTIONS_HXX
32 #define INCLUDED_SVTOOLS_CACHEOPTIONS_HXX
34 //_________________________________________________________________________________________________________________
35 // includes
36 //_________________________________________________________________________________________________________________
38 #include "svtools/svldllapi.h"
39 #include <sal/types.h>
40 #include <osl/mutex.hxx>
41 #include <rtl/ustring.hxx>
43 //_________________________________________________________________________________________________________________
44 // forward declarations
45 //_________________________________________________________________________________________________________________
47 /*-************************************************************************************************************//**
48 @short forward declaration to our private date container implementation
49 @descr We use these class as internal member to support small memory requirements.
50 You can create the container if it is neccessary. The class which use these mechanism
51 is faster and smaller then a complete implementation!
52 *//*-*************************************************************************************************************/
54 class SvtCacheOptions_Impl;
56 //_________________________________________________________________________________________________________________
57 // declarations
58 //_________________________________________________________________________________________________________________
60 /*-************************************************************************************************************//**
61 @short collect informations about startup features
62 @descr -
64 @implements -
65 @base -
67 @devstatus ready to use
68 *//*-*************************************************************************************************************/
70 class SVL_DLLPUBLIC SvtCacheOptions
72 //-------------------------------------------------------------------------------------------------------------
73 // public methods
74 //-------------------------------------------------------------------------------------------------------------
76 public:
78 //---------------------------------------------------------------------------------------------------------
79 // constructor / destructor
80 //---------------------------------------------------------------------------------------------------------
82 /*-****************************************************************************************************//**
83 @short standard constructor and destructor
84 @descr This will initialize an instance with default values.
85 We implement these class with a refcount mechanism! Every instance of this class increase it
86 at create and decrease it at delete time - but all instances use the same data container!
87 He is implemented as a static member ...
89 @seealso member m_nRefCount
90 @seealso member m_pDataContainer
92 @param -
93 @return -
95 @onerror -
96 *//*-*****************************************************************************************************/
98 SvtCacheOptions();
99 ~SvtCacheOptions();
101 //---------------------------------------------------------------------------------------------------------
102 // interface
103 //---------------------------------------------------------------------------------------------------------
105 /*-****************************************************************************************************//**
106 @short interface methods to get and set value of config key "org.openoffice.Office.Common/_3D-Engine/..."
107 @descr These options describe internal states to enable/disable features of installed office.
109 GetWriterOLE_Objects()
110 SetWriterOLE_Objects() => set the number of Writer OLE objects to be cached
112 GetDrawingEngineOLE_Objects()
113 SetDrawingEngineOLE_Objects() => set the number of DrawingEngine OLE objects to be cached
115 GetGraphicManagerTotalCacheSize()
116 SetGraphicManagerTotalCacheSize() => set the maximum cache size used by GraphicManager to cache graphic objects
118 GetGraphicManagerObjectCacheSize()
119 SetGraphicManagerObjectCacheSize() => set the maximum cache size for one GraphicObject to be cached by GraphicManager
121 @seealso configuration package "org.openoffice.Office.Common/_3D-Engine"
122 *//*-*****************************************************************************************************/
124 sal_Int32 GetWriterOLE_Objects() const;
125 sal_Int32 GetDrawingEngineOLE_Objects() const;
126 sal_Int32 GetGraphicManagerTotalCacheSize() const;
127 sal_Int32 GetGraphicManagerObjectCacheSize() const;
128 sal_Int32 GetGraphicManagerObjectReleaseTime() const;
130 void SetWriterOLE_Objects( sal_Int32 nObjects );
131 void SetDrawingEngineOLE_Objects( sal_Int32 nObjects );
132 void SetGraphicManagerTotalCacheSize( sal_Int32 nTotalCacheSize );
133 void SetGraphicManagerObjectCacheSize( sal_Int32 nObjectCacheSize );
134 void SetGraphicManagerObjectReleaseTime( sal_Int32 nReleaseTimeSeconds );
136 //-------------------------------------------------------------------------------------------------------------
137 // private methods
138 //-------------------------------------------------------------------------------------------------------------
140 private:
142 /*-****************************************************************************************************//**
143 @short return a reference to a static mutex
144 @descr These class use his own static mutex to be threadsafe.
145 We create a static mutex only for one ime and use at different times.
147 @seealso -
149 @param -
150 @return A reference to a static mutex member.
152 @onerror -
153 *//*-*****************************************************************************************************/
155 SVL_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
157 //-------------------------------------------------------------------------------------------------------------
158 // private member
159 //-------------------------------------------------------------------------------------------------------------
161 private:
163 /*Attention
165 Don't initialize these static member in these header!
166 a) Double dfined symbols will be detected ...
167 b) and unresolved externals exist at linking time.
168 Do it in your source only.
171 static SvtCacheOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
172 static sal_Int32 m_nRefCount ; /// internal ref count mechanism
176 #endif // #ifndef INCLUDED_SVTOOLS_CACHEOPTIONS_HXX