1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
31 enum CompatibilityOptions
33 COPT_USE_PRINTERDEVICE
= 0,
35 COPT_ADD_SPACING_AT_PAGES
,
36 COPT_USE_OUR_TABSTOPS
,
39 COPT_ADD_TABLESPACING
,
40 COPT_USE_OBJECTPOSITIONING
,
41 COPT_USE_OUR_TEXTWRAPPING
,
42 COPT_CONSIDER_WRAPPINGSTYLE
,
46 /*-************************************************************************************************************
47 @descr The method GetList() returns a list of property values.
48 Use follow defines to separate values by names.
49 *//*-*************************************************************************************************************/
50 #define COMPATIBILITY_PROPERTYNAME_NAME "Name"
51 #define COMPATIBILITY_PROPERTYNAME_MODULE "Module"
52 #define COMPATIBILITY_PROPERTYNAME_USEPRTMETRICS "UsePrinterMetrics"
53 #define COMPATIBILITY_PROPERTYNAME_ADDSPACING "AddSpacing"
54 #define COMPATIBILITY_PROPERTYNAME_ADDSPACINGATPAGES "AddSpacingAtPages"
55 #define COMPATIBILITY_PROPERTYNAME_USEOURTABSTOPS "UseOurTabStopFormat"
56 #define COMPATIBILITY_PROPERTYNAME_NOEXTLEADING "NoExternalLeading"
57 #define COMPATIBILITY_PROPERTYNAME_USELINESPACING "UseLineSpacing"
58 #define COMPATIBILITY_PROPERTYNAME_ADDTABLESPACING "AddTableSpacing"
59 #define COMPATIBILITY_PROPERTYNAME_USEOBJECTPOSITIONING "UseObjectPositioning"
60 #define COMPATIBILITY_PROPERTYNAME_USEOURTEXTWRAPPING "UseOurTextWrapping"
61 #define COMPATIBILITY_PROPERTYNAME_CONSIDERWRAPPINGSTYLE "ConsiderWrappingStyle"
62 #define COMPATIBILITY_PROPERTYNAME_EXPANDWORDSPACE "ExpandWordSpace"
64 #define COMPATIBILITY_DEFAULT_NAME "_default"
66 // forward declarations
68 /*-************************************************************************************************************
69 @short forward declaration to our private date container implementation
70 @descr We use these class as internal member to support small memory requirements.
71 You can create the container if it is necessary. The class which use these mechanism
72 is faster and smaller then a complete implementation!
73 *//*-*************************************************************************************************************/
75 class SvtCompatibilityOptions_Impl
;
77 /*-************************************************************************************************************
78 @short collect information about dynamic menus
79 @descr Make it possible to configure dynamic menu structures of menus like "new" or "wizard".
80 @devstatus ready to use
81 *//*-*************************************************************************************************************/
83 class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions
: public utl::detail::Options
90 // constructor / destructor
92 /*-****************************************************************************************************
93 @short standard constructor and destructor
94 @descr This will initialize an instance with default values.
95 We implement these class with a refcount mechanism! Every instance of this class increase it
96 at create and decrease it at delete time - but all instances use the same data container!
97 He is implemented as a static member ...
99 @seealso member m_nRefCount
100 @seealso member m_pDataContainer
101 *//*-*****************************************************************************************************/
103 SvtCompatibilityOptions();
104 virtual ~SvtCompatibilityOptions();
108 /*-****************************************************************************************************
109 @short clear complete specified list
110 @descr Call this methods to clear the whole list.
111 *//*-*****************************************************************************************************/
115 void SetDefault( const OUString
& sName
, bool bValue
);
117 /*-****************************************************************************************************
118 @short return complete specified list
119 @descr Call it to get all entries of compatibility options.
120 We return a list of all nodes with its names and properties.
121 @return A list of compatibility options is returned.
123 @onerror We return an empty list.
124 *//*-*****************************************************************************************************/
126 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> > GetList() const;
128 /*-****************************************************************************************************
129 @short append a new item
132 @seealso method Clear()
135 @param "sModule" Module
136 *//*-*****************************************************************************************************/
138 void AppendItem( const OUString
& sName
,
139 const OUString
& sModule
,
142 bool bAddSpacingAtPages
,
143 bool bUseOurTabStops
,
145 bool bUseLineSpacing
,
146 bool bAddTableSpacing
,
147 bool bUseObjectPositioning
,
148 bool bUseOurTextWrapping
,
149 bool bConsiderWrappingStyle
,
150 bool bExpandWordSpace
);
152 bool IsUsePrtDevice() const;
153 bool IsAddSpacing() const;
154 bool IsAddSpacingAtPages() const;
155 bool IsUseOurTabStops() const;
156 bool IsNoExtLeading() const;
157 bool IsUseLineSpacing() const;
158 bool IsAddTableSpacing() const;
159 bool IsUseObjectPositioning() const;
160 bool IsUseOurTextWrapping() const;
161 bool IsConsiderWrappingStyle() const;
162 bool IsExpandWordSpace() const;
168 /*-****************************************************************************************************
169 @short return a reference to a static mutex
170 @descr These class is partially threadsafe (for de-/initialization only).
171 All access methods are'nt safe!
172 We create a static mutex only for one ime and use at different times.
173 @return A reference to a static mutex member.
174 *//*-*****************************************************************************************************/
176 UNOTOOLS_DLLPRIVATE
static ::osl::Mutex
& GetOwnStaticMutex();
184 Don't initialize these static members in these headers!
185 a) Double defined symbols will be detected ...
186 b) and unresolved externals exist at linking time.
187 Do it in your source only.
190 static SvtCompatibilityOptions_Impl
* m_pDataContainer
;
191 static sal_Int32 m_nRefCount
;
193 }; // class SvtCompatibilityOptions
195 #endif // INCLUDED_UNOTOOLS_COMPATIBILITY_HXX
197 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */