Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / core / inc / DocumentSettingManager.hxx
bloba84607de42ca98779c73dcb93a30da278eb01a53
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_SW_SOURCE_CORE_INC_DOCUMENTSETTINGMANAGER_HXX
20 #define INCLUDED_SW_SOURCE_CORE_INC_DOCUMENTSETTINGMANAGER_HXX
22 #include <IDocumentSettingAccess.hxx>
23 class SwDoc;
24 typedef struct _xmlTextWriter* xmlTextWriterPtr;
26 namespace sw {
27 class DocumentSettingManager final :
28 public IDocumentSettingAccess
30 std::shared_ptr<SvxForbiddenCharactersTable> mxForbiddenCharsTable;
31 SwDoc &m_rDoc;
33 sal_uInt16 mnLinkUpdMode; //< UpdateMode for links.
35 SwFieldUpdateFlags meFieldUpdMode;//< Automatically Update Mode for fields/charts.
36 CharCompressType meChrCmprType;//< for ASIAN: compress punctuation/kana
38 sal_uInt32 mn32DummyCompatibilityOptions1;
39 sal_uInt32 mn32DummyCompatibilityOptions2;
41 // COMPATIBILITY FLAGS START
44 // HISTORY OF THE COMPATIBILITY FLAGS:
46 // SO5:
47 // mbParaSpaceMax def = false, true since SO8
48 // mbParaSpaceMaxAtPages def = false, true since SO8
50 // SO6:
51 // mbTabCompat def = false, true since SO8
53 // SO7:
54 // mbUseVirtualDevice def = true
55 // mbAddFlyOffsets def = false, hidden
57 // SO7pp1:
58 // bOldNumbering def = false, hidden
60 // SO8:
61 // mbAddExternalLeading def = true
62 // mbUseHiResolutionVirtualDevice def = true, hidden
63 // mbOldLineSpacing def = false
64 // mbAddParaSpacingToTableCells def = true
65 // mbUseFormerObjectPos def = false
66 // mbUseFormerTextWrapping def = false
67 // mbConsiderWrapOnObjPos def = false
69 // SO8pp1:
70 // mbIgnoreFirstLineIndentInNumbering def = false, hidden
71 // mbDoNotJustifyLinesWithManualBreak def = false, hidden
72 // mbDoNotResetParaAttrsForNumFont def = false, hidden
74 // SO8pp3
75 // mbDoNotCaptureDrawObjsOnPage def = false, hidden
76 // - Relevant for drawing objects, which don't follow the text flow, but
77 // whose position is outside the page area:
78 // false: Such drawing objects are captured on the page area of its anchor.
79 // true: Such drawing objects can leave the page area, they aren't captured.
80 // mbTableRowKeep def = false, hidden
81 // mbIgnoreTabsAndBlanksForLineCalculation def = false, hidden
82 // mbClipAsCharacterAnchoredWriterFlyFrame def = false, hidden
83 // - Introduced in order to re-activate clipping of as-character anchored
84 // Writer fly frames in method <SwFlyInContentFrame::MakeAll()> for documents,
85 // which are created with version prior SO8/OOo 2.0
87 // SO8pp4
88 // mbUnixForceZeroExtLeading def = false, hidden
90 // SO8pu8
92 // SO9
93 // #i24363# tab stops relative to indent
94 // mbTabRelativeToIndent def = true, hidden
95 // #i89181# suppress tab stop at left indent for paragraphs in lists, whose
96 // list level position and space mode equals LABEL_ALIGNMENT and whose list
97 // label is followed by a tab character.
98 // mbTabAtLeftIndentForParagraphsInList def = false, hidden
100 bool mbHTMLMode : 1; //< true: Document is in HTMLMode.
101 bool mbIsGlobalDoc : 1; //< true: It's a global document.
102 bool mbGlblDocSaveLinks : 1; //< true: Save sections linked in global document.
103 bool mbIsLabelDoc : 1; //< true: It's a label document.
104 bool mbPurgeOLE : 1; //< true: Purge OLE-Objects
105 bool mbKernAsianPunctuation : 1; //< true: kerning also for ASIAN punctuation
107 bool mbParaSpaceMax : 1;
108 bool mbParaSpaceMaxAtPages : 1;
109 bool mbTabCompat : 1;
110 bool mbUseVirtualDevice : 1;
111 bool mbAddFlyOffsets : 1;
112 bool mbAddVerticalFlyOffsets : 1;
113 bool mbAddExternalLeading : 1;
114 bool mbUseHiResolutionVirtualDevice : 1;
115 bool mbOldLineSpacing : 1; // #i11859#
116 bool mbAddParaSpacingToTableCells : 1;
117 bool mbUseFormerObjectPos : 1; // #i11860#
118 bool mbUseFormerTextWrapping : 1;
119 bool mbConsiderWrapOnObjPos : 1; // #i28701#
120 // true: object positioning algorithm has consider the wrapping style of // the floating screen objects as given by its attribute 'WrapInfluenceOnObjPos'
121 // floating screen objects as given by its
122 // attribute 'WrapInfluenceOnObjPos'.
123 bool mbMathBaselineAlignment : 1; // TL 2010-10-29 #i972#
124 bool mbStylesNoDefault : 1;
125 bool mbFloattableNomargins : 1; //< If paragraph margins next to a floating table should be ignored.
126 bool mEmbedFonts : 1; //< Whether to embed fonts when saving.
127 bool mEmbedUsedFonts : 1; //< Whether to embed fonts that are used by the document when saving.
128 bool mEmbedLatinScriptFonts : 1; //< Whether to embed latin script fonts when saving.
129 bool mEmbedAsianScriptFonts : 1; //< Whether to embed asian script fonts when saving.
130 bool mEmbedComplexScriptFonts : 1; //< Whether to embed complex script fonts when saving.
131 bool mEmbedSystemFonts : 1; //< Whether to embed also system fonts.
133 // non-ui-compatibility flags:
134 bool mbOldNumbering : 1;
135 bool mbIgnoreFirstLineIndentInNumbering : 1; // #i47448#
136 bool mbDoNotJustifyLinesWithManualBreak : 1; // #i49277#
137 bool mbDoNotResetParaAttrsForNumFont : 1; // #i53199#
138 bool mbTableRowKeep : 1;
139 bool mbIgnoreTabsAndBlanksForLineCalculation : 1; // #i3952#
140 bool mbDoNotCaptureDrawObjsOnPage : 1; // #i62875#
141 bool mbClipAsCharacterAnchoredWriterFlyFrames : 1;
142 bool mbUnixForceZeroExtLeading : 1; // #i60945#
143 bool mbTabRelativeToIndent : 1; // #i24363# tab stops relative to indent
144 bool mbProtectForm : 1;
145 bool mbMsWordCompTrailingBlanks : 1; // tdf#104349 tdf#104668
146 bool mbMsWordCompMinLineHeightByFly : 1;
147 bool mbInvertBorderSpacing : 1;
148 bool mbCollapseEmptyCellPara : 1;
149 bool mbTabAtLeftIndentForParagraphsInList; // #i89181# - see above
150 bool mbSmallCapsPercentage66;
151 bool mbTabOverflow;
152 bool mbUnbreakableNumberings;
153 bool mbClippedPictures;
154 bool mbBackgroundParaOverDrawings;
155 bool mbTabOverMargin;
156 bool mbTabOverSpacing;
157 bool mbTreatSingleColumnBreakAsPageBreak; // tdf#76349
158 bool mbSurroundTextWrapSmall;
159 bool mbPropLineSpacingShrinksFirstLine; // fdo#79602
160 bool mbSubtractFlys; // tdf#86578
161 bool mApplyParagraphMarkFormatToNumbering;
162 bool mbAddParaLineSpacingToTableCells; // tdf#125300 tdf#134782
164 bool mbLastBrowseMode : 1;
165 bool mbDisableOffPagePositioning; // tdf#112443
166 bool mbEmptyDbFieldHidesPara;
167 bool mbContinuousEndnotes = false;
168 bool mbProtectBookmarks;
169 bool mbProtectFields;
170 bool mbHeaderSpacingBelowLastPara;
171 bool mbFrameAutowidthWithMorePara; //tdf#124423
172 /// Gutter position: false means left (not a compatibility setting).
173 bool mbGutterAtTop;
174 bool mbFootnoteInColumnToPageEnd;
175 sal_Int32 mnImagePreferredDPI;
176 bool mbAutoFirstLineIndentDisregardLineSpace;
177 bool mbHyphenateURLs = false;
178 bool mbDoNotBreakWrappedTables = false;
179 bool mbAllowTextAfterFloatingTableBreak = false;
180 // If this is on as_char flys wrapping will be handled the same like in Word
181 bool mbNoNumberingShowFollowBy;
182 bool mbDropCapPunctuation; // tdf#150200, tdf#150438
184 public:
186 DocumentSettingManager(SwDoc &rDoc);
187 virtual ~DocumentSettingManager() override;
189 // IDocumentSettingAccess
190 virtual bool get(/*[in]*/ DocumentSettingId id) const override;
191 virtual void set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value) override;
192 virtual const css::i18n::ForbiddenCharacters* getForbiddenCharacters(/*[in]*/ LanguageType nLang, /*[in]*/ bool bLocaleData ) const override;
193 virtual void setForbiddenCharacters(/*[in]*/ LanguageType nLang, /*[in]*/ const css::i18n::ForbiddenCharacters& rForbiddenCharacters ) override;
194 virtual std::shared_ptr<SvxForbiddenCharactersTable>& getForbiddenCharacterTable() override;
195 virtual const std::shared_ptr<SvxForbiddenCharactersTable>& getForbiddenCharacterTable() const override;
196 virtual sal_uInt16 getLinkUpdateMode( /*[in]*/bool bGlobalSettings ) const override;
197 virtual void setLinkUpdateMode( /*[in]*/ sal_uInt16 nMode ) override;
198 virtual SwFieldUpdateFlags getFieldUpdateFlags( /*[in]*/bool bGlobalSettings ) const override;
199 virtual void setFieldUpdateFlags( /*[in]*/ SwFieldUpdateFlags eMode ) override;
200 virtual CharCompressType getCharacterCompressionType() const override;
201 virtual void setCharacterCompressionType( /*[in]*/CharCompressType nType ) override;
203 sal_Int32 getImagePreferredDPI() override
205 return mnImagePreferredDPI;
207 void setImagePreferredDPI(sal_Int32 nValue) override
209 mnImagePreferredDPI = nValue;
212 // Replace all compatibility options with those from rSource.
213 void ReplaceCompatibilityOptions(const DocumentSettingManager& rSource);
215 sal_uInt32 Getn32DummyCompatibilityOptions1() const override;
216 void Setn32DummyCompatibilityOptions1( const sal_uInt32 CompatibilityOptions1 ) override;
217 sal_uInt32 Getn32DummyCompatibilityOptions2() const override;
218 void Setn32DummyCompatibilityOptions2( const sal_uInt32 CompatibilityOptions2 ) override;
219 void dumpAsXml(xmlTextWriterPtr pWriter) const;
224 #endif //_DOCSETTING_HXX
226 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */