build fix
[LibreOffice.git] / include / unotools / compatibility.hxx
blob8f4ce5a2ee126703465a3a56604b7203adb09628
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>
28 #include <memory>
30 enum CompatibilityOptions
32 COPT_USE_PRINTERDEVICE = 0,
33 COPT_ADD_SPACING,
34 COPT_ADD_SPACING_AT_PAGES,
35 COPT_USE_OUR_TABSTOPS,
36 COPT_NO_EXTLEADING,
37 COPT_USE_LINESPACING,
38 COPT_ADD_TABLESPACING,
39 COPT_USE_OBJECTPOSITIONING,
40 COPT_USE_OUR_TEXTWRAPPING,
41 COPT_CONSIDER_WRAPPINGSTYLE,
42 COPT_EXPAND_WORDSPACE,
43 COPT_PROTECT_FORM,
44 COPT_SUBTRACT_FLYS_ANCHORED_AT_FLYS
47 /*-************************************************************************************************************
48 @descr The method GetList() returns a list of property values.
49 Use follow defines to separate values by names.
50 *//*-*************************************************************************************************************/
51 #define COMPATIBILITY_PROPERTYNAME_NAME "Name"
52 #define COMPATIBILITY_PROPERTYNAME_MODULE "Module"
53 #define COMPATIBILITY_PROPERTYNAME_USEPRTMETRICS "UsePrinterMetrics"
54 #define COMPATIBILITY_PROPERTYNAME_ADDSPACING "AddSpacing"
55 #define COMPATIBILITY_PROPERTYNAME_ADDSPACINGATPAGES "AddSpacingAtPages"
56 #define COMPATIBILITY_PROPERTYNAME_USEOURTABSTOPS "UseOurTabStopFormat"
57 #define COMPATIBILITY_PROPERTYNAME_NOEXTLEADING "NoExternalLeading"
58 #define COMPATIBILITY_PROPERTYNAME_USELINESPACING "UseLineSpacing"
59 #define COMPATIBILITY_PROPERTYNAME_ADDTABLESPACING "AddTableSpacing"
60 #define COMPATIBILITY_PROPERTYNAME_USEOBJECTPOSITIONING "UseObjectPositioning"
61 #define COMPATIBILITY_PROPERTYNAME_USEOURTEXTWRAPPING "UseOurTextWrapping"
62 #define COMPATIBILITY_PROPERTYNAME_CONSIDERWRAPPINGSTYLE "ConsiderWrappingStyle"
63 #define COMPATIBILITY_PROPERTYNAME_EXPANDWORDSPACE "ExpandWordSpace"
64 #define COMPATIBILITY_PROPERTYNAME_PROTECTFORM "ProtectForm"
65 #define COMPATIBILITY_PROPERTYNAME_SUBTRACT_FLYS_ANCHORED_AT_FLYS "SubtractFlysAnchoredAtFlys"
67 #define COMPATIBILITY_DEFAULT_NAME "_default"
69 // forward declarations
71 /*-************************************************************************************************************
72 @short forward declaration to our private date container implementation
73 @descr We use these class as internal member to support small memory requirements.
74 You can create the container if it is necessary. The class which use these mechanism
75 is faster and smaller then a complete implementation!
76 *//*-*************************************************************************************************************/
78 class SvtCompatibilityOptions_Impl;
80 /*-************************************************************************************************************
81 @short collect information about dynamic menus
82 @descr Make it possible to configure dynamic menu structures of menus like "new" or "wizard".
83 @devstatus ready to use
84 *//*-*************************************************************************************************************/
86 class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions: public utl::detail::Options
88 public:
89 SvtCompatibilityOptions();
90 virtual ~SvtCompatibilityOptions() override;
92 // interface
94 /*-****************************************************************************************************
95 @short clear complete specified list
96 @descr Call this methods to clear the whole list.
97 *//*-*****************************************************************************************************/
99 void Clear();
101 void SetDefault( const OUString & sName, bool bValue );
103 /*-****************************************************************************************************
104 @short return complete specified list
105 @descr Call it to get all entries of compatibility options.
106 We return a list of all nodes with its names and properties.
107 @return A list of compatibility options is returned.
109 @onerror We return an empty list.
110 *//*-*****************************************************************************************************/
112 css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > GetList() const;
114 /*-****************************************************************************************************
115 @short append a new item
116 @descr
118 @seealso method Clear()
120 @param "sName" Name
121 @param "sModule" Module
122 *//*-*****************************************************************************************************/
124 void AppendItem( const OUString& sName,
125 const OUString& sModule,
126 bool bUsePrtMetrics,
127 bool bAddSpacing,
128 bool bAddSpacingAtPages,
129 bool bUseOurTabStops,
130 bool bNoExtLeading,
131 bool bUseLineSpacing,
132 bool bAddTableSpacing,
133 bool bUseObjectPositioning,
134 bool bUseOurTextWrapping,
135 bool bConsiderWrappingStyle,
136 bool bExpandWordSpace,
137 bool bProtectForm,
138 bool bSubtractFlysAnchoredAtFlys );
140 bool IsUsePrtDevice() const;
141 bool IsAddSpacing() const;
142 bool IsAddSpacingAtPages() const;
143 bool IsUseOurTabStops() const;
144 bool IsNoExtLeading() const;
145 bool IsUseLineSpacing() const;
146 bool IsAddTableSpacing() const;
147 bool IsUseObjectPositioning() const;
148 bool IsUseOurTextWrapping() const;
149 bool IsConsiderWrappingStyle() const;
150 bool IsExpandWordSpace() const;
152 private:
154 /*-****************************************************************************************************
155 @short return a reference to a static mutex
156 @descr These class is partially threadsafe (for de-/initialization only).
157 All access methods are'nt safe!
158 We create a static mutex only for one ime and use at different times.
159 @return A reference to a static mutex member.
160 *//*-*****************************************************************************************************/
162 UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
164 std::shared_ptr<SvtCompatibilityOptions_Impl> m_pImpl;
166 }; // class SvtCompatibilityOptions
168 #endif // INCLUDED_UNOTOOLS_COMPATIBILITY_HXX
170 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */