1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: internaloptions.hxx,v $
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 ************************************************************************/
30 #ifndef INCLUDED_SVTOOLS_INTERNALOPTIONS_HXX
31 #define INCLUDED_SVTOOLS_INTERNALOPTIONS_HXX
33 //_________________________________________________________________________________________________________________
35 //_________________________________________________________________________________________________________________
38 #include <sal/types.h>
41 #ifndef _OSL_MUTEX_HXX_
42 #include <osl/mutex.hxx>
45 #ifndef _RTL_USTRING_HXX_
46 #include <rtl/ustring.hxx>
49 #ifndef INCLUDED_SVTOOLS_OPTIONS_HXX
50 #include <bf_svtools/options.hxx>
53 //_________________________________________________________________________________________________________________
55 //_________________________________________________________________________________________________________________
57 #define MUTEX ::osl::Mutex
58 #define OUSTRING ::rtl::OUString
63 //_________________________________________________________________________________________________________________
64 // forward declarations
65 //_________________________________________________________________________________________________________________
67 /*-************************************************************************************************************//**
68 @short forward declaration to our private date container implementation
69 @descr We use these class as internal member to support small memory requirements.
70 You can create the container if it is neccessary. The class which use these mechanism
71 is faster and smaller then a complete implementation!
72 *//*-*************************************************************************************************************/
74 class SvtInternalOptions_Impl
;
76 //_________________________________________________________________________________________________________________
78 //_________________________________________________________________________________________________________________
80 /*-************************************************************************************************************//**
81 @short collect informations about internal features
87 @ATTENTION This class is partially threadsafe.
89 @devstatus ready to use
90 *//*-*************************************************************************************************************/
92 class SvtInternalOptions
: public Options
94 //-------------------------------------------------------------------------------------------------------------
96 //-------------------------------------------------------------------------------------------------------------
100 //---------------------------------------------------------------------------------------------------------
101 // constructor / destructor
102 //---------------------------------------------------------------------------------------------------------
104 /*-****************************************************************************************************//**
105 @short standard constructor and destructor
106 @descr This will initialize an instance with default values.
107 We implement these class with a refcount mechanism! Every instance of this class increase it
108 at create and decrease it at delete time - but all instances use the same data container!
109 He is implemented as a static member ...
111 @seealso member m_nRefCount
112 @seealso member m_pDataContainer
118 *//*-*****************************************************************************************************/
120 SvtInternalOptions();
121 virtual ~SvtInternalOptions();
123 //-------------------------------------------------------------------------------------------------------------
125 //-------------------------------------------------------------------------------------------------------------
129 /*-****************************************************************************************************//**
130 @short return a reference to a static mutex
131 @descr These class is partially threadsafe (for de-/initialization only).
132 All access methods are'nt safe!
133 We create a static mutex only for one ime and use at different times.
138 @return A reference to a static mutex member.
141 *//*-*****************************************************************************************************/
143 static MUTEX
& GetOwnStaticMutex();
145 //-------------------------------------------------------------------------------------------------------------
147 //-------------------------------------------------------------------------------------------------------------
153 Don't initialize these static member in these header!
154 a) Double dfined symbols will be detected ...
155 b) and unresolved externals exist at linking time.
156 Do it in your source only.
159 static SvtInternalOptions_Impl
* m_pDataContainer
; /// impl. data container as dynamic pointer for smaller memory requirements!
160 static sal_Int32 m_nRefCount
; /// internal ref count mechanism
162 }; // class SvtInternalOptions
166 #endif // #ifndef INCLUDED_SVTOOLS_INTERNALOPTIONS_HXX