bump product version to 4.2.0.1
[LibreOffice.git] / include / unotools / compatibility.hxx
blob2583e051a16e9e43332bc647b36b3c0a770220b4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_UNOTOOLS_COMPATIBILITY_HXX
20 #define INCLUDED_UNOTOOLS_COMPATIBILITY_HXX
22 #include <unotools/unotoolsdllapi.h>
23 #include <sal/types.h>
24 #include <osl/mutex.hxx>
25 #include <com/sun/star/uno/Sequence.h>
26 #include <com/sun/star/beans/PropertyValue.hpp>
27 #include <unotools/options.hxx>
29 //_________________________________________________________________________________________________________________
30 // types, enums, ...
31 //_________________________________________________________________________________________________________________
33 enum CompatibilityOptions
35 COPT_USE_PRINTERDEVICE = 0,
36 COPT_ADD_SPACING,
37 COPT_ADD_SPACING_AT_PAGES,
38 COPT_USE_OUR_TABSTOPS,
39 COPT_NO_EXTLEADING,
40 COPT_USE_LINESPACING,
41 COPT_ADD_TABLESPACING,
42 COPT_USE_OBJECTPOSITIONING,
43 COPT_USE_OUR_TEXTWRAPPING,
44 COPT_CONSIDER_WRAPPINGSTYLE,
45 COPT_EXPAND_WORDSPACE
48 /*-************************************************************************************************************//**
49 @descr The method GetList() returns a list of property values.
50 Use follow defines to separate values by names.
51 *//*-*************************************************************************************************************/
52 #define COMPATIBILITY_PROPERTYNAME_NAME OUString( "Name" )
53 #define COMPATIBILITY_PROPERTYNAME_MODULE OUString( "Module" )
54 #define COMPATIBILITY_PROPERTYNAME_USEPRTMETRICS OUString( "UsePrinterMetrics" )
55 #define COMPATIBILITY_PROPERTYNAME_ADDSPACING OUString( "AddSpacing" )
56 #define COMPATIBILITY_PROPERTYNAME_ADDSPACINGATPAGES OUString( "AddSpacingAtPages" )
57 #define COMPATIBILITY_PROPERTYNAME_USEOURTABSTOPS OUString( "UseOurTabStopFormat" )
58 #define COMPATIBILITY_PROPERTYNAME_NOEXTLEADING OUString( "NoExternalLeading" )
59 #define COMPATIBILITY_PROPERTYNAME_USELINESPACING OUString( "UseLineSpacing" )
60 #define COMPATIBILITY_PROPERTYNAME_ADDTABLESPACING OUString( "AddTableSpacing" )
61 #define COMPATIBILITY_PROPERTYNAME_USEOBJECTPOSITIONING OUString( "UseObjectPositioning" )
62 #define COMPATIBILITY_PROPERTYNAME_USEOURTEXTWRAPPING OUString( "UseOurTextWrapping" )
63 #define COMPATIBILITY_PROPERTYNAME_CONSIDERWRAPPINGSTYLE OUString( "ConsiderWrappingStyle" )
64 #define COMPATIBILITY_PROPERTYNAME_EXPANDWORDSPACE OUString( "ExpandWordSpace" )
66 #define COMPATIBILITY_DEFAULT_NAME OUString( "_default" )
68 //_________________________________________________________________________________________________________________
69 // forward declarations
70 //_________________________________________________________________________________________________________________
72 /*-************************************************************************************************************//**
73 @short forward declaration to our private date container implementation
74 @descr We use these class as internal member to support small memory requirements.
75 You can create the container if it is neccessary. The class which use these mechanism
76 is faster and smaller then a complete implementation!
77 *//*-*************************************************************************************************************/
79 class SvtCompatibilityOptions_Impl;
81 /*-************************************************************************************************************//**
82 @short collect information about dynamic menus
83 @descr Make it possible to configure dynamic menu structures of menus like "new" or "wizard".
85 @implements -
86 @base -
88 @devstatus ready to use
89 *//*-*************************************************************************************************************/
91 class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions: public utl::detail::Options
93 //-------------------------------------------------------------------------------------------------------------
94 // public methods
95 //-------------------------------------------------------------------------------------------------------------
97 public:
99 //---------------------------------------------------------------------------------------------------------
100 // constructor / destructor
101 //---------------------------------------------------------------------------------------------------------
103 /*-****************************************************************************************************//**
104 @short standard constructor and destructor
105 @descr This will initialize an instance with default values.
106 We implement these class with a refcount mechanism! Every instance of this class increase it
107 at create and decrease it at delete time - but all instances use the same data container!
108 He is implemented as a static member ...
110 @seealso member m_nRefCount
111 @seealso member m_pDataContainer
113 @param -
114 @return -
116 @onerror -
117 *//*-*****************************************************************************************************/
119 SvtCompatibilityOptions();
120 virtual ~SvtCompatibilityOptions();
122 //---------------------------------------------------------------------------------------------------------
123 // interface
124 //---------------------------------------------------------------------------------------------------------
126 /*-****************************************************************************************************//**
127 @short clear complete specified list
128 @descr Call this methods to clear the whole list.
130 @seealso -
132 @param -
133 @return -
135 @onerror -
136 *//*-*****************************************************************************************************/
138 void Clear();
140 void SetDefault( OUString sName, bool bValue );
142 /*-****************************************************************************************************//**
143 @short return complete specified list
144 @descr Call it to get all entries of compatibility options.
145 We return a list of all nodes with its names and properties.
147 @seealso -
149 @param -
150 @return A list of compatibility options is returned.
152 @onerror We return an empty list.
153 *//*-*****************************************************************************************************/
155 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > GetList() const;
157 /*-****************************************************************************************************//**
158 @short append a new item
159 @descr
161 @seealso method Clear()
163 @param "sName" Name
164 @param "sModule" Module
166 @return -
168 @onerror -
169 *//*-*****************************************************************************************************/
171 void AppendItem( const OUString& sName,
172 const OUString& sModule,
173 bool bUsePrtMetrics,
174 bool bAddSpacing,
175 bool bAddSpacingAtPages,
176 bool bUseOurTabStops,
177 bool bNoExtLeading,
178 bool bUseLineSpacing,
179 bool bAddTableSpacing,
180 bool bUseObjectPositioning,
181 bool bUseOurTextWrapping,
182 bool bConsiderWrappingStyle,
183 bool bExpandWordSpace );
185 bool IsUsePrtDevice() const;
186 bool IsAddSpacing() const;
187 bool IsAddSpacingAtPages() const;
188 bool IsUseOurTabStops() const;
189 bool IsNoExtLeading() const;
190 bool IsUseLineSpacing() const;
191 bool IsAddTableSpacing() const;
192 bool IsUseObjectPositioning() const;
193 bool IsUseOurTextWrapping() const;
194 bool IsConsiderWrappingStyle() const;
195 bool IsExpandWordSpace() const;
197 //-------------------------------------------------------------------------------------------------------------
198 // private methods
199 //-------------------------------------------------------------------------------------------------------------
201 private:
203 /*-****************************************************************************************************//**
204 @short return a reference to a static mutex
205 @descr These class is partially threadsafe (for de-/initialization only).
206 All access methods are'nt safe!
207 We create a static mutex only for one ime and use at different times.
209 @seealso -
211 @param -
212 @return A reference to a static mutex member.
214 @onerror -
215 *//*-*****************************************************************************************************/
217 UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
219 //-------------------------------------------------------------------------------------------------------------
220 // private member
221 //-------------------------------------------------------------------------------------------------------------
223 private:
225 /*Attention
227 Don't initialize these static member in these header!
228 a) Double dfined symbols will be detected ...
229 b) and unresolved externals exist at linking time.
230 Do it in your source only.
233 static SvtCompatibilityOptions_Impl* m_pDataContainer; /// impl. data container as dynamic pointer for smaller memory requirements!
234 static sal_Int32 m_nRefCount ; /// internal ref count mechanism
236 }; // class SvtCompatibilityOptions
238 #endif // INCLUDED_UNOTOOLS_COMPATIBILITY_HXX
240 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */