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: compatibility.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_COMPATIBILITY_HXX
31 #define INCLUDED_SVTOOLS_COMPATIBILITY_HXX
34 #include <sal/types.h>
37 #ifndef _OSL_MUTEX_HXX_
38 #include <osl/mutex.hxx>
41 #ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_
42 #include <com/sun/star/uno/Sequence.h>
45 #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
46 #include <com/sun/star/beans/PropertyValue.hpp>
49 #ifndef INCLUDED_SVTOOLS_OPTIONS_HXX
50 #include <bf_svtools/options.hxx>
55 //_________________________________________________________________________________________________________________
57 //_________________________________________________________________________________________________________________
59 enum CompatibilityOptions
61 COPT_USE_PRINTERDEVICE
= 0,
63 COPT_ADD_SPACING_AT_PAGES
,
64 COPT_USE_OUR_TABSTOPS
,
67 COPT_ADD_TABLESPACING
,
68 COPT_USE_OBJECTPOSITIONING
,
69 COPT_USE_OUR_TEXTWRAPPING
,
70 COPT_CONSIDER_WRAPPINGSTYLE
,
74 /*-************************************************************************************************************//**
75 @descr The method GetList() returns a list of property values.
76 Use follow defines to seperate values by names.
77 *//*-*************************************************************************************************************/
78 #define COMPATIBILITY_PROPERTYNAME_NAME OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) )
79 #define COMPATIBILITY_PROPERTYNAME_MODULE OUString( RTL_CONSTASCII_USTRINGPARAM( "Module" ) )
80 #define COMPATIBILITY_PROPERTYNAME_USEPRTMETRICS OUString( RTL_CONSTASCII_USTRINGPARAM( "UsePrinterMetrics" ) )
81 #define COMPATIBILITY_PROPERTYNAME_ADDSPACING OUString( RTL_CONSTASCII_USTRINGPARAM( "AddSpacing" ) )
82 #define COMPATIBILITY_PROPERTYNAME_ADDSPACINGATPAGES OUString( RTL_CONSTASCII_USTRINGPARAM( "AddSpacingAtPages" ) )
83 #define COMPATIBILITY_PROPERTYNAME_USEOURTABSTOPS OUString( RTL_CONSTASCII_USTRINGPARAM( "UseOurTabStopFormat" ) )
84 #define COMPATIBILITY_PROPERTYNAME_NOEXTLEADING OUString( RTL_CONSTASCII_USTRINGPARAM( "NoExternalLeading" ) )
85 #define COMPATIBILITY_PROPERTYNAME_USELINESPACING OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLineSpacing" ) )
86 #define COMPATIBILITY_PROPERTYNAME_ADDTABLESPACING OUString( RTL_CONSTASCII_USTRINGPARAM( "AddTableSpacing" ) )
87 #define COMPATIBILITY_PROPERTYNAME_USEOBJECTPOSITIONING OUString( RTL_CONSTASCII_USTRINGPARAM( "UseObjectPositioning" ) )
88 #define COMPATIBILITY_PROPERTYNAME_USEOURTEXTWRAPPING OUString( RTL_CONSTASCII_USTRINGPARAM( "UseOurTextWrapping" ) )
89 #define COMPATIBILITY_PROPERTYNAME_CONSIDERWRAPPINGSTYLE OUString( RTL_CONSTASCII_USTRINGPARAM( "ConsiderWrappingStyle" ) )
90 #define COMPATIBILITY_PROPERTYNAME_EXPANDWORDSPACE OUString( RTL_CONSTASCII_USTRINGPARAM( "ExpandWordSpace" ) )
92 #define COMPATIBILITY_DEFAULT_NAME OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) )
94 //_________________________________________________________________________________________________________________
95 // forward declarations
96 //_________________________________________________________________________________________________________________
98 /*-************************************************************************************************************//**
99 @short forward declaration to our private date container implementation
100 @descr We use these class as internal member to support small memory requirements.
101 You can create the container if it is neccessary. The class which use these mechanism
102 is faster and smaller then a complete implementation!
103 *//*-*************************************************************************************************************/
105 class SvtCompatibilityOptions_Impl
;
107 //_________________________________________________________________________________________________________________
109 //_________________________________________________________________________________________________________________
111 /*-************************************************************************************************************//**
112 @short collect informations about dynamic menus
113 @descr Make it possible to configure dynamic menu structures of menus like "new" or "wizard".
118 @devstatus ready to use
119 *//*-*************************************************************************************************************/
121 class SvtCompatibilityOptions
: public Options
123 //-------------------------------------------------------------------------------------------------------------
125 //-------------------------------------------------------------------------------------------------------------
129 //---------------------------------------------------------------------------------------------------------
130 // constructor / destructor
131 //---------------------------------------------------------------------------------------------------------
133 /*-****************************************************************************************************//**
134 @short standard constructor and destructor
135 @descr This will initialize an instance with default values.
136 We implement these class with a refcount mechanism! Every instance of this class increase it
137 at create and decrease it at delete time - but all instances use the same data container!
138 He is implemented as a static member ...
140 @seealso member m_nRefCount
141 @seealso member m_pDataContainer
147 *//*-*****************************************************************************************************/
149 SvtCompatibilityOptions();
150 virtual ~SvtCompatibilityOptions();
152 //-------------------------------------------------------------------------------------------------------------
154 //-------------------------------------------------------------------------------------------------------------
158 /*-****************************************************************************************************//**
159 @short return a reference to a static mutex
160 @descr These class is partially threadsafe (for de-/initialization only).
161 All access methods are'nt safe!
162 We create a static mutex only for one ime and use at different times.
167 @return A reference to a static mutex member.
170 *//*-*****************************************************************************************************/
172 static ::osl::Mutex
& GetOwnStaticMutex();
174 //-------------------------------------------------------------------------------------------------------------
176 //-------------------------------------------------------------------------------------------------------------
182 Don't initialize these static member in these header!
183 a) Double dfined symbols will be detected ...
184 b) and unresolved externals exist at linking time.
185 Do it in your source only.
188 static SvtCompatibilityOptions_Impl
* m_pDataContainer
; /// impl. data container as dynamic pointer for smaller memory requirements!
189 static sal_Int32 m_nRefCount
; /// internal ref count mechanism
191 }; // class SvtCompatibilityOptions
195 #endif // #ifndef INCLUDED_SVTOOLS_COMPATIBILITY_HXX