1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_SW_INC_IDOCUMENTSETTINGACCESS_HXX
21 #define INCLUDED_SW_INC_IDOCUMENTSETTINGACCESS_HXX
22 
23 #include <sal/types.h>
24 #include "fldupde.hxx"
25 #include <i18nlangtag/lang.h>
26 #include <memory>
27 
28 class SvxForbiddenCharactersTable;
29 namespace com { namespace sun { namespace star { namespace i18n { struct ForbiddenCharacters; } } } }
30 enum class CharCompressType;
31 
32 enum class DocumentSettingId
33 {
34     // COMPATIBILITY FLAGS START
35     PARA_SPACE_MAX,
36     PARA_SPACE_MAX_AT_PAGES,
37 
38     TAB_COMPAT,
39 
40     ADD_FLY_OFFSETS,
41     ADD_VERTICAL_FLY_OFFSETS,
42 
43     OLD_NUMBERING,
44 
45     ADD_EXT_LEADING,
46     USE_VIRTUAL_DEVICE,
47     USE_HIRES_VIRTUAL_DEVICE,
48     OLD_LINE_SPACING,
49     ADD_PARA_SPACING_TO_TABLE_CELLS,
50     ADD_PARA_LINE_SPACING_TO_TABLE_CELLS,
51     USE_FORMER_OBJECT_POS,
52     USE_FORMER_TEXT_WRAPPING,
53     CONSIDER_WRAP_ON_OBJECT_POSITION,
54 
55     IGNORE_FIRST_LINE_INDENT_IN_NUMBERING,
56     DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK,
57     TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK,
58     DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT,
59 
60     DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE,
61     TABLE_ROW_KEEP,
62     IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION,
63     CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME,
64 
65     // tdf#104349 tdf#104668
66     MS_WORD_COMP_TRAILING_BLANKS,
67     // tdf#128197 MS Word in some modes can have line height based on shape height, not on font
68     MS_WORD_COMP_MIN_LINE_HEIGHT_BY_FLY,
69     UNIX_FORCE_ZERO_EXT_LEADING,
70     TABS_RELATIVE_TO_INDENT,
71     PROTECT_FORM,
72     // #i89181#
73     TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST,
74     INVERT_BORDER_SPACING,
75     COLLAPSE_EMPTY_CELL_PARA,
76     SMALL_CAPS_PERCENTAGE_66,
77     TAB_OVERFLOW,
78     UNBREAKABLE_NUMBERINGS,
79     CLIPPED_PICTURES,
80     BACKGROUND_PARA_OVER_DRAWINGS,
81     TAB_OVER_MARGIN,
82     // MS Word still wraps text around objects with less space than LO would.
83     SURROUND_TEXT_WRAP_SMALL,
84     PROP_LINE_SPACING_SHRINKS_FIRST_LINE,
85     SUBTRACT_FLYS,
86     // tdf#112443 disable off-page content positioning
87     DISABLE_OFF_PAGE_POSITIONING,
88     EMPTY_DB_FIELD_HIDES_PARA,
89     // COMPATIBILITY FLAGS END
90     BROWSE_MODE,
91     HTML_MODE,
92     GLOBAL_DOCUMENT,
93     GLOBAL_DOCUMENT_SAVE_LINKS,
94     LABEL_DOCUMENT,
95     PURGE_OLE,
96     KERN_ASIAN_PUNCTUATION,
97     MATH_BASELINE_ALIGNMENT,
98     STYLES_NODEFAULT,
99     FLOATTABLE_NOMARGINS,
100     EMBED_FONTS,
101     EMBED_USED_FONTS,
102     EMBED_LATIN_SCRIPT_FONTS,
103     EMBED_ASIAN_SCRIPT_FONTS,
104     EMBED_COMPLEX_SCRIPT_FONTS,
105     EMBED_SYSTEM_FONTS,
106     APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING,
107     CONTINUOUS_ENDNOTES,
108     HEADER_SPACING_BELOW_LAST_PARA,
109 };
110 
111  /** Provides access to settings of a document
112  */
113  class IDocumentSettingAccess
114  {
115  public:
116     /** Return the specified document setting.
117 
118        @param id
119        [in] the identifier of the document setting to be returned.
120        See above for a list of valid document setting identifiers.
121 
122        @returns
123        the value of the requested document setting.
124     */
125     virtual bool get(/*[in]*/ DocumentSettingId id) const = 0;
126 
127     /** Set the specified document setting.
128 
129         @param id
130         [in] the identifier of the document setting to be set.
131         See above for a list of valid document setting identifiers.
132 
133         @param value
134         [in] the new value of the specified document setting.
135     */
136     virtual void set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value) = 0;
137 
138     /** Return the forbidden characters.
139 
140        @param nLang
141        [in] the language for which the forbidden character list is returned.
142 
143        @param bLocaleData
144        [in] if set and there is no user defined forbidden character list for
145             language lang, the default list for language lang will be returned.
146 
147        @returns
148        a list of forbidden characters.
149     */
150     virtual const css::i18n::ForbiddenCharacters*
151         getForbiddenCharacters(/*[in]*/ LanguageType nLang, /*[in]*/ bool bLocaleData ) const = 0;
152 
153     /** Set the forbidden characters.
154 
155        @param nLang
156        [in] the language for which the forbidden character list should be set.
157 
158        @param rForbiddenCharacters
159        [in] the new list of forbidden characters for language lang.
160     */
161     virtual void setForbiddenCharacters(/*[in]*/ LanguageType nLang,
162                                         /*[in]*/ const css::i18n::ForbiddenCharacters& rForbiddenCharacters ) = 0;
163 
164     /** Get the forbidden character table and creates one if necessary.
165 
166        @returns
167        the forbidden characters table.
168     */
169     virtual std::shared_ptr<SvxForbiddenCharactersTable>& getForbiddenCharacterTable() = 0;
170 
171     /** Get the forbidden character table.
172 
173        @returns
174        the forbidden characters table.
175     */
176     virtual const std::shared_ptr<SvxForbiddenCharactersTable>& getForbiddenCharacterTable() const = 0;
177 
178     /** Get the current link update mode.
179 
180        @param bGlobalSettings
181        [in] if set, the link update mode is obtained from the module,
182             if it is set to GLOBALSETTING
183 
184        @returns
185        the current link update mode.
186     */
187     virtual sal_uInt16 getLinkUpdateMode( /*[in]*/bool bGlobalSettings ) const = 0;
188 
189     /** Set the current link update mode.
190 
191        @param nMode
192        [in] the new link update mode.
193     */
194     virtual void setLinkUpdateMode( /*[in]*/ sal_uInt16 nMode ) = 0;
195 
196     /** Get the current field update mode.
197 
198        @param bGlobalSettings
199        [in] if set, the field update mode is obtained from the module,
200             if it is set to GLOBALSETTING
201 
202        @returns
203        the current field update mode.
204     */
205     virtual SwFieldUpdateFlags getFieldUpdateFlags( /*[in]*/bool bGlobalSettings ) const = 0;
206 
207     /** Set the current field update mode.
208 
209        @param nMode
210        [in] the new field update mode.
211     */
212     virtual void setFieldUpdateFlags( /*[in]*/ SwFieldUpdateFlags nMode )  = 0;
213 
214     /** Get the character compression type for Asian characters.
215 
216        @returns
217        the current character compression mode.
218     */
219     virtual CharCompressType getCharacterCompressionType() const = 0;
220 
221     /** Set the character compression type for Asian characters.
222 
223        @param nMode
224        [in] the new character compression type.
225     */
226     virtual void setCharacterCompressionType( /*[in]*/CharCompressType nType ) = 0;
227 
228     /** Get the n32DummyCompatabilityOptions1
229     */
230     virtual sal_uInt32 Getn32DummyCompatibilityOptions1() const = 0;
231 
232     /** Set the n32DummyCompatabilityOptions1
233     */
234     virtual void Setn32DummyCompatibilityOptions1( const sal_uInt32 CompatibilityOptions1 ) = 0;
235 
236     /** Get the n32DummyCompatabilityOptions2
237     */
238     virtual sal_uInt32 Getn32DummyCompatibilityOptions2() const = 0;
239 
240     /** Set the n32DummyCompatabilityOptions2
241     */
242     virtual void Setn32DummyCompatibilityOptions2( const sal_uInt32 CompatibilityOptions2 ) = 0;
243 
244 protected:
~IDocumentSettingAccess()245     virtual ~IDocumentSettingAccess() {};
246  };
247 
248 #endif // INCLUDED_SW_INC_IDOCUMENTSETTINGACCESS_HXX
249 
250 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
251