1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef IDOCUMENTSETTINGACCESS_HXX_INCLUDED
25 #define IDOCUMENTSETTINGACCESS_HXX_INCLUDED
26 
27 #include <tools/solar.h>
28 #ifndef _VOS_REF_HXX
29 #include <vos/ref.hxx>
30 #endif
31 #include <chcmprse.hxx>
32 #include <fldupde.hxx>
33 
34 class SvxForbiddenCharactersTable;
35 namespace com { namespace sun { namespace star { namespace i18n { struct ForbiddenCharacters; } } } }
36 
37  /** Provides access to settings of a document
38  */
39  class IDocumentSettingAccess
40  {
41  public:
42      enum DocumentSettingId
43      {
44          // COMPATIBILITY FLAGS START
45          PARA_SPACE_MAX,
46          PARA_SPACE_MAX_AT_PAGES,
47 
48          TAB_COMPAT,
49 
50          ADD_FLY_OFFSETS,
51 
52          OLD_NUMBERING,
53 
54          ADD_EXT_LEADING,
55          USE_VIRTUAL_DEVICE,
56          USE_HIRES_VIRTUAL_DEVICE,
57          OLD_LINE_SPACING,
58          ADD_PARA_SPACING_TO_TABLE_CELLS,
59          USE_FORMER_OBJECT_POS,
60          USE_FORMER_TEXT_WRAPPING,
61          CONSIDER_WRAP_ON_OBJECT_POSITION,
62 
63          IGNORE_FIRST_LINE_INDENT_IN_NUMBERING,
64          DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK,
65          DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT,
66          OUTLINE_LEVEL_YIELDS_OUTLINE_RULE,
67 
68          DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE,
69          TABLE_ROW_KEEP,
70 		 IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION,
71          CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME,
72 
73          UNIX_FORCE_ZERO_EXT_LEADING,
74          USE_OLD_PRINTER_METRICS,
75          TABS_RELATIVE_TO_INDENT,
76          PROTECT_FORM,
77          // --> OD 2008-06-05 #i89181#
78          TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST,
79          // <--
80          // COMPATIBILITY FLAGS END
81 
82          BROWSE_MODE,
83          HTML_MODE,
84          GLOBAL_DOCUMENT,
85          GLOBAL_DOCUMENT_SAVE_LINKS,
86          LABEL_DOCUMENT,
87          PURGE_OLE,
88          KERN_ASIAN_PUNCTUATION,
89          MATH_BASELINE_ALIGNMENT
90      };
91 
92  public:
93 	/** Return the specified document setting.
94 
95        @param id
96        [in] the identifier of the document setting to be returned.
97        See above for a list of valid document setting identifiers.
98 
99        @returns
100        the value of the requested document setting.
101 	*/
102 	virtual bool get(/*[in]*/ DocumentSettingId id) const = 0;
103 
104 	/** Set the specified document setting.
105 
106         @param id
107         [in] the identifier of the document setting to be set.
108         See above for a list of valid document setting identifiers.
109 
110         @param value
111         [in] the new value of the specified document setting.
112 	*/
113 	virtual void set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value) = 0;
114 
115     /** Return the forbidden characters.
116 
117        @param nLang
118        [in] the language for which the forbidden character list is returned.
119 
120        @param bLocaleData
121        [in] if set and there is no user defined forbidden character list for
122             language lang, the default list for language lang will be returned.
123 
124        @returns
125        a list of forbidden characters.
126     */
127     virtual const com::sun::star::i18n::ForbiddenCharacters*
128         getForbiddenCharacters(/*[in]*/ sal_uInt16 nLang, /*[in]*/ bool bLocaleData ) const = 0;
129 
130     /** Set the forbidden characters.
131 
132        @param nLang
133        [in] the language for which the forbidden character list should be set.
134 
135        @param rForbiddenCharacters
136        [in] the new list of forbidden characters for language lang.
137     */
138     virtual void setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang,
139                                         /*[in]*/ const com::sun::star::i18n::ForbiddenCharacters& rForbiddenCharacters ) = 0;
140 
141     /** Get the forbidden character table and creates one if necessary.
142 
143        @returns
144        the forbidden characters table.
145     */
146     virtual vos::ORef<SvxForbiddenCharactersTable>& getForbiddenCharacterTable() = 0;
147 
148     /** Get the forbidden character table.
149 
150        @returns
151        the forbidden characters table.
152     */
153     virtual const vos::ORef<SvxForbiddenCharactersTable>& getForbiddenCharacterTable() const = 0;
154 
155     /** Get the current link update mode.
156 
157        @param bGlobalSettings
158        [in] if set, the link update mode is obtained from the module,
159             if it is set to GLOBALSETTING
160 
161        @returns
162        the current link update mode.
163     */
164     virtual sal_uInt16 getLinkUpdateMode( /*[in]*/bool bGlobalSettings ) const = 0;
165 
166     /** Set the current link update mode.
167 
168        @param nMode
169        [in] the new link update mode.
170     */
171     virtual void setLinkUpdateMode( /*[in]*/ sal_uInt16 nMode ) = 0;
172 
173     /** Get the current field update mode.
174 
175        @param bGlobalSettings
176        [in] if set, the field update mode is obtained from the module,
177             if it is set to GLOBALSETTING
178 
179        @returns
180        the current field update mode.
181     */
182     virtual SwFldUpdateFlags getFieldUpdateFlags( /*[in]*/bool bGlobalSettings ) const = 0;
183 
184     /** Set the current field update mode.
185 
186        @param nMode
187        [in] the new field update mode.
188     */
189     virtual void setFieldUpdateFlags( /*[in]*/ SwFldUpdateFlags nMode )  = 0;
190 
191     /** Get the character compression type for Asian characters.
192 
193        @returns
194        the current character compression mode.
195     */
196     virtual SwCharCompressType getCharacterCompressionType() const = 0;
197 
198     /** Set the character compression type for Asian characters.
199 
200        @param nMode
201        [in] the new character compression type.
202     */
203     virtual void setCharacterCompressionType( /*[in]*/SwCharCompressType nType ) = 0;
204 
205 protected:
~IDocumentSettingAccess()206     virtual ~IDocumentSettingAccess() {};
207  };
208 
209 #endif // IDOCUMENTSETTINGACCESS_HXX_INCLUDED
210