Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _MODOPT_HXX
29 : : #define _MODOPT_HXX
30 : :
31 : : #include <boost/ptr_container/ptr_vector.hpp>
32 : : #include <tools/string.hxx>
33 : : #include <tools/wintypes.hxx>
34 : : #include <vcl/field.hxx>
35 : : #include <unotools/configitem.hxx>
36 : : #include "swdllapi.h"
37 : : #include "authratr.hxx"
38 : : #include <SwCapObjType.hxx>
39 : : #include "tblenum.hxx"
40 : : #include "itabenum.hxx"
41 : : #include <tools/globname.hxx>
42 : : #include <editeng/svxenum.hxx>
43 : : class SwModuleOptions;
44 : :
45 : : class InsCaptionOpt;
46 : :
47 : 113 : class InsCaptionOptArr
48 : : {
49 : : private:
50 : : typedef boost::ptr_vector<InsCaptionOpt> InsCapOptArr;
51 : : InsCapOptArr m_aInsCapOptArr;
52 : : public:
53 : : InsCaptionOpt* Find(const SwCapObjType eType, const SvGlobalName *pOleId = 0);
54 : : void Insert(InsCaptionOpt* pObj);
55 : : };
56 : :
57 : : class SwRevisionConfig : public utl::ConfigItem
58 : : {
59 : : friend class SwModuleOptions;
60 : :
61 : : AuthorCharAttr aInsertAttr; //Revision/TextDisplay/Insert/Attribute // Redlining: Author-Zeichenattribute
62 : : //Revision/TextDisplay/Insert/Color
63 : : AuthorCharAttr aDeletedAttr; //Revision/TextDisplay/Delete/Attribute
64 : : //Revision/TextDisplay/Delete/Color
65 : : AuthorCharAttr aFormatAttr; //Revision/TextDisplay/ChangeAttribute/Attribute
66 : : //Revision/TextDisplay/ChangeAttribute/Color
67 : : sal_uInt16 nMarkAlign; //Revision/LinesChanged/Mark
68 : : Color aMarkColor; //Revision/LinesChanged/Color
69 : :
70 : : const com::sun::star::uno::Sequence<rtl::OUString>& GetPropertyNames();
71 : : public:
72 : : SwRevisionConfig();
73 : : ~SwRevisionConfig();
74 : :
75 : : virtual void Commit();
76 : : virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
77 : : void Load();
78 : 0 : void SetModified(){ConfigItem::SetModified();}
79 : : };
80 : :
81 : : class SwCompareConfig : public utl::ConfigItem
82 : : {
83 : : friend class SwModuleOptions;
84 : :
85 : : sal_uInt16 eCmpMode; //Compare/CompareDocuments;
86 : : sal_Bool bUseRsid; //Compare/Settings/Use RSID
87 : : sal_Bool bIgnorePieces; //Compare/Settings/Ignore pieces of length
88 : : sal_uInt16 nPieceLen; //Compare/Settings/Ignore pieces of length
89 : :
90 : : const com::sun::star::uno::Sequence<rtl::OUString>& GetPropertyNames();
91 : : public:
92 : : SwCompareConfig();
93 : : ~SwCompareConfig();
94 : :
95 : : virtual void Commit();
96 : 0 : virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ){ };
97 : : void Load();
98 : 0 : void SetModified() {ConfigItem::SetModified(); }
99 : : };
100 : :
101 : : class SwInsertConfig : public utl::ConfigItem
102 : : {
103 : : friend class SwModuleOptions;
104 : :
105 : : InsCaptionOptArr* pCapOptions;
106 : : InsCaptionOpt* pOLEMiscOpt;
107 : :
108 : : SvGlobalName aGlobalNames[5];
109 : :
110 : : sal_Bool bInsWithCaption; //Insert/Caption/Automatic
111 : : sal_Bool bCaptionOrderNumberingFirst; //#i61007# caption order starting with numbering
112 : :
113 : : SwInsertTableOptions aInsTblOpts;
114 : : sal_Bool bIsWeb;
115 : :
116 : : const com::sun::star::uno::Sequence<rtl::OUString>& GetPropertyNames();
117 : : public:
118 : : SwInsertConfig(sal_Bool bWeb);
119 : : ~SwInsertConfig();
120 : :
121 : : virtual void Commit();
122 : : virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
123 : : void Load();
124 : 0 : void SetModified(){ConfigItem::SetModified();}
125 : : };
126 : :
127 : : class SwTableConfig : public utl::ConfigItem
128 : : {
129 : : friend class SwModuleOptions;
130 : :
131 : : sal_uInt16 nTblHMove; //int Table/Shift/Row
132 : : sal_uInt16 nTblVMove; //int Table/Shift/Column
133 : : sal_uInt16 nTblHInsert; //int Table/Insert/Row
134 : : sal_uInt16 nTblVInsert; //int Table/Insert/Column
135 : : TblChgMode eTblChgMode; //int Table/Change/Effect
136 : :
137 : : sal_Bool bInsTblFormatNum; // Table/Input/NumberRecognition // Automatic recognition of numbers.
138 : : sal_Bool bInsTblChangeNumFormat; // Table/Input/NumberFormatRecognition // Automatic recognition of number formats.
139 : : sal_Bool bInsTblAlignNum; // Table/Input/Alignment // Align numbers.
140 : :
141 : : const com::sun::star::uno::Sequence<rtl::OUString>& GetPropertyNames();
142 : : public:
143 : : SwTableConfig(sal_Bool bWeb);
144 : : ~SwTableConfig();
145 : :
146 : : virtual void Commit();
147 : : virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
148 : : void Load();
149 : 0 : void SetModified(){ConfigItem::SetModified();}
150 : : };
151 : :
152 : : class SwMiscConfig : public utl::ConfigItem
153 : : {
154 : : friend class SwModuleOptions;
155 : :
156 : : String sWordDelimiter; // Statistics/WordNumber/Delimiter
157 : : sal_Bool bDefaultFontsInCurrDocOnly; // DefaultFont/Document
158 : : sal_Bool bShowIndexPreview ; // Index/ShowPreview
159 : : sal_Bool bGrfToGalleryAsLnk; // Misc/GraphicToGalleryAsLink
160 : : sal_Bool bNumAlignSize; // Numbering/Graphic/KeepRatio
161 : : sal_Bool bSinglePrintJob; // FormLetter/PrintOutput/SinglePrintJobs
162 : : sal_Bool bIsNameFromColumn; // FormLetter/FileOutput/FileName/Generation
163 : : sal_Bool bAskForMailMergeInPrint; // Ask if documents containing fields should be 'mailmerged'
164 : : sal_Int16 nMailingFormats; // FormLetter/MailingOutput/Formats
165 : : String sNameFromColumn; // FormLetter/FileOutput/FileName/FromDatabaseField (string!)
166 : : String sMailingPath; // FormLetter/FileOutput/Path
167 : : String sMailName; // FormLetter/FileOutput/FileName/FromManualSetting (string!)
168 : :
169 : : const com::sun::star::uno::Sequence<rtl::OUString>& GetPropertyNames();
170 : : public:
171 : : SwMiscConfig();
172 : : ~SwMiscConfig();
173 : :
174 : : virtual void Commit();
175 : : virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
176 : : void Load();
177 : 10 : void SetModified(){ConfigItem::SetModified();}
178 : : };
179 : :
180 [ + - ][ + - ]: 40 : class SW_DLLPUBLIC SwModuleOptions
[ + - ][ + - ]
[ + - ][ + - ]
181 : : {
182 : : SwRevisionConfig aRevisionConfig;
183 : : SwInsertConfig aInsertConfig;
184 : : SwInsertConfig aWebInsertConfig;
185 : :
186 : : SwTableConfig aTableConfig;
187 : : SwTableConfig aWebTableConfig;
188 : :
189 : : SwMiscConfig aMiscConfig;
190 : :
191 : : SwCompareConfig aCompareConfig;
192 : :
193 : : //fiscus: don't show tips of text fields - it's not part of the configuration!
194 : : sal_Bool bHideFieldTips : 1;
195 : :
196 : : public:
197 : : SwModuleOptions();
198 : :
199 : 232 : TblChgMode GetTblMode() const { return aTableConfig.eTblChgMode;}
200 : 0 : void SetTblMode( TblChgMode eSet ) { aTableConfig.eTblChgMode = eSet;
201 : 0 : aTableConfig.SetModified();}
202 : :
203 : 0 : sal_uInt16 GetTblHMove() const { return aTableConfig.nTblHMove;}
204 : 0 : void SetTblHMove( sal_uInt16 nSet ) { aTableConfig.nTblHMove = nSet;
205 : 0 : aTableConfig.SetModified();}
206 : :
207 : 0 : sal_uInt16 GetTblVMove() const { return aTableConfig.nTblVMove;}
208 : 0 : void SetTblVMove( sal_uInt16 nSet ) { aTableConfig.nTblVMove = nSet;
209 : 0 : aTableConfig.SetModified();}
210 : :
211 : 0 : sal_uInt16 GetTblHInsert() const {return aTableConfig.nTblHInsert;}
212 : 0 : void SetTblHInsert( sal_uInt16 nSet ) { aTableConfig.nTblHInsert = nSet;
213 : 0 : aTableConfig.SetModified();}
214 : :
215 : 0 : sal_uInt16 GetTblVInsert() const {return aTableConfig.nTblVInsert;}
216 : 0 : void SetTblVInsert( sal_uInt16 nSet ) { aTableConfig.nTblVInsert = nSet;
217 : 0 : aTableConfig.SetModified();}
218 : :
219 : 0 : const AuthorCharAttr &GetInsertAuthorAttr() const { return aRevisionConfig.aInsertAttr; }
220 : 0 : void SetInsertAuthorAttr( AuthorCharAttr &rAttr ) { aRevisionConfig.aInsertAttr = rAttr;
221 : 0 : aRevisionConfig.SetModified();}
222 : :
223 : 0 : const AuthorCharAttr &GetDeletedAuthorAttr() const { return aRevisionConfig.aDeletedAttr; }
224 : 0 : void SetDeletedAuthorAttr( AuthorCharAttr &rAttr ) { aRevisionConfig.aDeletedAttr = rAttr;
225 : 0 : aRevisionConfig.SetModified();}
226 : :
227 : 0 : const AuthorCharAttr &GetFormatAuthorAttr() const { return aRevisionConfig.aFormatAttr; }
228 : 0 : void SetFormatAuthorAttr( AuthorCharAttr &rAttr ) { aRevisionConfig.aFormatAttr = rAttr;
229 : 0 : aRevisionConfig.SetModified();}
230 : :
231 : 87398 : sal_uInt16 GetMarkAlignMode() const { return aRevisionConfig.nMarkAlign; }
232 : 0 : void SetMarkAlignMode(sal_uInt16 nMode) { aRevisionConfig.nMarkAlign = nMode;
233 : 0 : aRevisionConfig.SetModified();}
234 : :
235 : 0 : const Color& GetMarkAlignColor() const { return aRevisionConfig.aMarkColor; }
236 : 0 : void SetMarkAlignColor(const Color &rColor) { aRevisionConfig.aMarkColor = rColor;
237 : 0 : aRevisionConfig.SetModified();}
238 : :
239 : 0 : sal_Bool IsInsWithCaption(sal_Bool bHTML) const
240 [ # # ]: 0 : { return bHTML ? sal_False : aInsertConfig.bInsWithCaption; }
241 : 0 : void SetInsWithCaption( sal_Bool bHTML, sal_Bool b )
242 : 0 : { if(!bHTML)
243 : 0 : aInsertConfig.bInsWithCaption = b;
244 : 0 : aInsertConfig.SetModified();}
245 : :
246 : 0 : sal_Bool IsCaptionOrderNumberingFirst() const { return aInsertConfig.bCaptionOrderNumberingFirst; }
247 : 0 : void SetCaptionOrderNumberingFirst( sal_Bool bSet )
248 : : {
249 : 0 : if(aInsertConfig.bCaptionOrderNumberingFirst != bSet)
250 : : {
251 : 0 : aInsertConfig.bCaptionOrderNumberingFirst = bSet;
252 : 0 : aInsertConfig.SetModified();
253 : : }
254 : 0 : }
255 : :
256 : 0 : sal_Bool IsInsTblFormatNum(sal_Bool bHTML) const
257 [ # # ]: 0 : { return bHTML ? aWebTableConfig.bInsTblFormatNum : aTableConfig.bInsTblFormatNum; }
258 : 0 : void SetInsTblFormatNum( sal_Bool bHTML, sal_Bool b )
259 [ # # ]: 0 : { bHTML ? (aWebTableConfig.bInsTblFormatNum = b) : (aTableConfig.bInsTblFormatNum = b);
260 [ # # ]: 0 : bHTML ? aWebTableConfig.SetModified() : aTableConfig.SetModified();}
261 : :
262 : 0 : sal_Bool IsInsTblChangeNumFormat(sal_Bool bHTML) const
263 [ # # ]: 0 : { return bHTML ? aWebTableConfig.bInsTblChangeNumFormat : aTableConfig.bInsTblChangeNumFormat; }
264 : 0 : void SetInsTblChangeNumFormat( sal_Bool bHTML, sal_Bool b )
265 : 0 : { bHTML ? (aWebTableConfig.bInsTblChangeNumFormat = b) : (aTableConfig.bInsTblChangeNumFormat = b);
266 : 0 : bHTML ? aWebTableConfig.SetModified() : aTableConfig.SetModified();}
267 : :
268 : :
269 : 154 : sal_Bool IsInsTblAlignNum(sal_Bool bHTML) const
270 [ - + ]: 154 : { return bHTML ? aWebTableConfig.bInsTblAlignNum : aTableConfig.bInsTblAlignNum; }
271 : 0 : void SetInsTblAlignNum( sal_Bool bHTML, sal_Bool b )
272 : 0 : { bHTML ? (aWebTableConfig.bInsTblAlignNum = b) : (aTableConfig.bInsTblAlignNum = b);
273 : 0 : bHTML ? aWebTableConfig.SetModified() : aTableConfig.SetModified();}
274 : :
275 : 0 : SwInsertTableOptions GetInsTblFlags(sal_Bool bHTML) const
276 [ # # ]: 0 : { return bHTML ? aWebInsertConfig.aInsTblOpts : aInsertConfig.aInsTblOpts;}
277 : 0 : void SetInsTblFlags( sal_Bool bHTML, const SwInsertTableOptions& rOpts ) {
278 : 0 : bHTML ? (aWebInsertConfig.aInsTblOpts = rOpts) : (aInsertConfig.aInsTblOpts = rOpts);
279 : 0 : bHTML ? aWebInsertConfig.SetModified() : aInsertConfig.SetModified();}
280 : :
281 : : const InsCaptionOpt* GetCapOption(sal_Bool bHTML, const SwCapObjType eType, const SvGlobalName *pOleId);
282 : : sal_Bool SetCapOption(sal_Bool bHTML, const InsCaptionOpt* pOpt);
283 : :
284 : :
285 : 0 : sal_Bool IsGrfToGalleryAsLnk() const { return aMiscConfig.bGrfToGalleryAsLnk; }
286 : 0 : void SetGrfToGalleryAsLnk( sal_Bool b ) { aMiscConfig.bGrfToGalleryAsLnk = b;
287 : 0 : aMiscConfig.SetModified();}
288 : :
289 : 0 : sal_Int16 GetMailingFormats() const { return aMiscConfig.nMailingFormats;}
290 : 0 : void SetMailingFormats( sal_Int16 nSet ) { aMiscConfig.nMailingFormats = nSet;
291 : 0 : aMiscConfig.SetModified();}
292 : :
293 : : sal_Bool IsSinglePrintJob() const { return aMiscConfig.bSinglePrintJob; }
294 : 0 : void SetSinglePrintJob( sal_Bool b ) { aMiscConfig.bSinglePrintJob = b;
295 : 0 : aMiscConfig.SetModified();}
296 : :
297 : : sal_Bool IsNumAlignSize() const { return aMiscConfig.bNumAlignSize; }
298 : : void SetNumAlignSize( sal_Bool b ) { aMiscConfig.bNumAlignSize = b;
299 : : aMiscConfig.SetModified();}
300 : :
301 : 0 : sal_Bool IsNameFromColumn() const { return aMiscConfig.bIsNameFromColumn; }
302 : 0 : void SetIsNameFromColumn( sal_Bool bSet )
303 : : {
304 : 0 : aMiscConfig.SetModified();
305 : 0 : aMiscConfig.bIsNameFromColumn = bSet;
306 : 0 : }
307 : :
308 : 0 : sal_Bool IsAskForMailMerge() const { return aMiscConfig.bAskForMailMergeInPrint;}
309 : : void SetAskForMailMerge(sal_Bool bSet)
310 : : {
311 : : aMiscConfig.SetModified();
312 : : aMiscConfig.bAskForMailMergeInPrint = bSet;
313 : : }
314 : :
315 : :
316 : 0 : const String& GetNameFromColumn() const { return aMiscConfig.sNameFromColumn; }
317 : 0 : void SetNameFromColumn( const String& rSet ) { aMiscConfig.sNameFromColumn = rSet;
318 : 0 : aMiscConfig.SetModified();}
319 : :
320 : 0 : String GetMailingPath() const { return aMiscConfig.sMailingPath; }
321 : 0 : void SetMailingPath(const String& sPath) { aMiscConfig.sMailingPath = sPath;
322 : 0 : aMiscConfig.SetModified();}
323 : :
324 : : String GetMailName() const { return aMiscConfig.sMailName; }
325 : : void SetMailName(const String& sName){ aMiscConfig.sMailName = sName;
326 : : aMiscConfig.SetModified();}
327 : :
328 : 24 : const String &GetWordDelimiter() const { return aMiscConfig.sWordDelimiter; }
329 : 10 : void SetWordDelimiter(const String& sDelim) { aMiscConfig.sWordDelimiter = sDelim;
330 : 10 : aMiscConfig.SetModified();}
331 : :
332 : : //convert word delimiter from or to user interface
333 : : static String ConvertWordDelimiter(const String& rDelim, sal_Bool bFromUI);
334 : :
335 : 0 : sal_Bool IsShowIndexPreview() const {return aMiscConfig.bShowIndexPreview;}
336 : 0 : void SetShowIndexPreview(sal_Bool bSet)
337 : 0 : {aMiscConfig.bShowIndexPreview = bSet;
338 : 0 : aMiscConfig.SetModified();}
339 : :
340 : 0 : sal_Bool IsDefaultFontInCurrDocOnly() const { return aMiscConfig.bDefaultFontsInCurrDocOnly;}
341 : 0 : void SetDefaultFontInCurrDocOnly(sal_Bool bSet)
342 : : {
343 : 0 : aMiscConfig.bDefaultFontsInCurrDocOnly = bSet;
344 : 0 : aMiscConfig.SetModified();
345 : 0 : }
346 : :
347 : 20 : sal_Bool IsHideFieldTips() const {return bHideFieldTips;}
348 : 8 : void SetHideFieldTips(sal_Bool bSet) {bHideFieldTips = bSet;}
349 : :
350 : 0 : SvxCompareMode GetCompareMode() const { return (SvxCompareMode)aCompareConfig.eCmpMode; }
351 : 0 : void SetCompareMode( SvxCompareMode eMode ) { aCompareConfig.eCmpMode = eMode;
352 : 0 : aCompareConfig.SetModified(); }
353 : :
354 : 0 : sal_Bool IsUseRsid() const { return aCompareConfig.bUseRsid; }
355 : 0 : void SetUseRsid( sal_Bool b ) { aCompareConfig.bUseRsid = b;
356 : 0 : aCompareConfig.SetModified(); }
357 : :
358 : 0 : sal_Bool IsIgnorePieces() const { return aCompareConfig.bIgnorePieces; }
359 : 0 : void SetIgnorePieces( sal_Bool b ) { aCompareConfig.bIgnorePieces = b;
360 : 0 : aCompareConfig.SetModified(); }
361 : :
362 : 0 : sal_uInt16 GetPieceLen() const { return aCompareConfig.nPieceLen; }
363 : 0 : void SetPieceLen( sal_uInt16 nLen ) { aCompareConfig.nPieceLen = nLen;
364 : 0 : aCompareConfig.SetModified(); }
365 : :
366 : : };
367 : : #endif
368 : :
369 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|