xref: /aoo42x/main/sw/inc/viewopt.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _VIEWOPT_HXX
28 #define _VIEWOPT_HXX
29 #include <tools/gen.hxx>
30 #include <tools/string.hxx>
31 #include <tools/color.hxx>
32 
33 #include <svx/zoomitem.hxx>
34 #include "swdllapi.h"
35 #include "authratr.hxx"
36 
37 class SwRect;
38 class Window;
39 class OutputDevice;
40 class ViewShell;
41 class SwDocShell;
42 namespace svtools{ class ColorConfig;}
43 
44 //#define VIEWOPT_1_IDLE             0x00000001L  no longer used, see new member 'bIdle'
45 #define VIEWOPT_1_TAB           0x00000002L
46 #define VIEWOPT_1_BLANK         0x00000004L
47 #define VIEWOPT_1_HARDBLANK     0x00000008L
48 #define VIEWOPT_1_PARAGRAPH	    0x00000010L
49 #define VIEWOPT_1_LINEBREAK	    0x00000020L
50 #define VIEWOPT_1_PAGEBREAK	    0x00000040L
51 #define VIEWOPT_1_COLUMNBREAK   0x00000080L
52 #define VIEWOPT_1_SOFTHYPH      0x00000100L
53 
54 #define VIEWOPT_1_REF 		    0x00000400L
55 #define VIEWOPT_1_FLDNAME 	    0x00000800L
56 //#define           0x00001000L
57 //#define      0x00002000L
58 #define VIEWOPT_1_POSTITS		0x00004000L
59 #define VIEWOPT_1_FLD_HIDDEN    0x00008000L
60 #define VIEWOPT_1_CHAR_HIDDEN   0x00010000L
61 #define VIEWOPT_1_GRAPHIC       0x00020000L
62 #define VIEWOPT_1_TABLE	        0x00040000L
63 #define VIEWOPT_1_DRAW		    0x00080000L
64 #define VIEWOPT_1_CONTROL	    0x00100000L
65 //#define  0x00200000L
66 #define VIEWOPT_1_CROSSHAIR     0x00400000L
67 #define VIEWOPT_1_SNAP		    0x00800000L
68 #define VIEWOPT_1_SYNCHRONIZE	0x01000000L
69 #define VIEWOPT_1_GRIDVISIBLE	0x02000000L
70 #define VIEWOPT_1_ONLINESPELL   0x04000000L
71 //#define VIEWOPT_1_HIDESPELL     0x08000000L   /* removed #i91949 */
72 #define VIEWOPT_1_RESERVED1		0x10000000L
73 #define VIEWOPT_1_VIEWMETACHARS 0x20000000L
74 #define VIEWOPT_1_PAGEBACK      0x40000000L
75 #define VIEWOPT_1_SOLIDMARKHDL  0x80000000L
76 
77 #define VIEWOPT_CORE2_BLACKFONT 		0x00000001L
78 #define VIEWOPT_CORE2_HIDDENPARA		0x00000002L
79 #define VIEWOPT_CORE2_SMOOTHSCROLL		0x00000004L
80 #define VIEWOPT_CORE2_CRSR_IN_PROT		0x00000008L
81 #define VIEWOPT_CORE2_PDF_EXPORT        0x00000010L
82 #define VIEWOPT_CORE2_PRINTING          0x00000020L
83 #define VIEWOPT_CORE2_BIGMARKHDL  		0x00000040L
84 
85 #define VIEWOPT_2_UNUSED1           0x00000100L
86 #define VIEWOPT_2_UNUSED2           0x00000200L
87 #define VIEWOPT_2_H_RULER           0x00000400L
88 #define VIEWOPT_2_VSCROLLBAR	    0x00000800L
89 #define VIEWOPT_2_HSCROLLBAR	    0x00001000L
90 #define VIEWOPT_2_STATUSLINE	    0x00002000L
91 #define VIEWOPT_2_V_RULER           0x00004000L
92 #define VIEWOPT_2_ANY_RULER         0x00008000L
93 #define VIEWOPT_2_MODIFIED		    0x00010000L
94 #define VIEWOPT_2_KEEPASPECTRATIO   0x00020000L
95 #define VIEWOPT_2_GRFKEEPZOOM	    0x00040000L
96 #define VIEWOPT_2_PREVENT_TIPS      0x00100000L
97 #define VIEWOPT_2_RESERVED3         0x00200000L
98 #define VIEWOPT_2_RESERVED4         0x00400000L
99 #define VIEWOPT_2_PRTFORMAT         0x00800000L
100 #define VIEWOPT_2_SHADOWCRSR        0x01000000L
101 #define VIEWOPT_2_V_RULER_RIGHT     0x02000000L
102 
103 //Tabellenhintergrund
104 #define TBL_DEST_CELL 	0
105 #define TBL_DEST_ROW 	1
106 #define TBL_DEST_TBL	2
107 
108 //Appearance flags
109 #define VIEWOPT_DOC_BOUNDARIES      0x0001
110 #define VIEWOPT_OBJECT_BOUNDARIES   0x0002
111 #define VIEWOPT_TABLE_BOUNDARIES    0x0004
112 #define VIEWOPT_INDEX_SHADINGS      0x0008
113 #define VIEWOPT_LINKS               0x0010
114 #define VIEWOPT_VISITED_LINKS       0x0020
115 #define VIEWOPT_FIELD_SHADINGS      0x0040
116 #define VIEWOPT_SECTION_BOUNDARIES  0x0080
117 
118 // Implementierung in core/text/txtpaint.cxx
119 extern void SyncVout( const OutputDevice *pOut );
120 
121 class SwViewOption
122 {
123     static Color    aDocColor;  // color of document boundaries
124     static Color    aDocBoundColor;  // color of document boundaries
125     static Color    aObjectBoundColor; // color of object boundaries
126     static Color    aAppBackgroundColor; // application background
127     static Color    aTableBoundColor; // color of table boundaries
128     static Color    aFontColor;
129     static Color    aIndexShadingsColor; // background color of indexes
130     static Color    aLinksColor;
131     static Color    aVisitedLinksColor;
132     static Color    aDirectCursorColor;
133     static Color    aTextGridColor;
134     static Color    aSpellColor;     // mark color of online spell checking
135     static Color    aSmarttagColor;
136     static Color    aFieldShadingsColor;
137     static Color    aSectionBoundColor;
138     static Color    aPageBreakColor;
139     static Color    aScriptIndicatorColor;
140 
141     static sal_Int32 nAppearanceFlags;  //
142 protected:
143 	static sal_uInt16	nPixelTwips;// 1 Pixel == ? Twips
144 
145 	String	  		sSymbolFont;        // Symbolzeichensatz
146 	sal_uInt32 			nCoreOptions;		// Bits fuer die ViewShell
147 	sal_uInt32 			nCore2Options;		// Bits fuer die ViewShell
148 	sal_uInt32			nUIOptions;         // UI-Bits
149 	Color 			aRetoucheColor;		// DefaultBackground fuer BrowseView
150     Size            aSnapSize;          // Beschreibt hori. wie vert. Snap
151     sal_uInt16          mnViewLayoutColumns;// # columns for edit view
152 	short 			nDivisionX;	  	 	// Rasterunterteilung
153 	short 			nDivisionY;
154 	sal_uInt8  			nPagePrevRow;		// Page Preview Row/Columns
155 	sal_uInt8  			nPagePrevCol;		// Page Preview Row/Columns
156 	sal_uInt8			nShdwCrsrFillMode;	// FillMode fuer den ShadowCrsr
157 	sal_Bool 			bReadonly : 1;		// Readonly-Doc
158 	sal_Bool			bStarOneSetting : 1;// prevent from UI automatics (no scrollbars in readonly documents)
159     sal_Bool            bIsPagePreview : 1; // the preview mustn't print field/footnote/... shadings
160     sal_Bool            bSelectionInReadonly : 1; //determines whether selection is switched on in readonly documents
161     sal_Bool            mbFormView : 1;
162     sal_Bool			mbBrowseMode : 1;    //swmod 080130
163     sal_Bool            mbBookView : 1;      // view mode for page preview
164     sal_Bool            mbViewLayoutBookMode : 1; // book view mode for edit view
165     sal_Bool        bShowPlaceHolderFields : 1; //only used in printing!
166     mutable bool    bIdle;
167 
168 	// Maszstab
169 	sal_uInt16 			nZoom;		   	 	// Angaben in Prozent
170     SvxZoomType     eZoom;              // 'enum' fuer Zoom
171 
172     sal_uInt8            nTblDest;           // Ziel fuer Tabellenhintergrund
173 
174 #ifdef DBG_UTIL
175 	// korrespondieren zu den Angaben in ui/config/cfgvw.src
176 	sal_Bool  bTest1		:1;		// Test-Flag  "Layout not loading"
177 	sal_Bool  bTest2		:1;  	// Test-Flag  "WYSIWYG++"
178 	sal_Bool  bTest3		:1;  	// Test-Flag  ""
179 	sal_Bool  bTest4		:1;  	// Test-Flag  "WYSIWYG debug"
180 	sal_Bool  bTest5		:1;  	// Test-Flag  "No idle format"
181 	sal_Bool  bTest6		:1;  	// Test-Flag  "No screen adj"
182 	sal_Bool  bTest7		:1;  	// Test-Flag  "win format"
183 	sal_Bool  bTest8		:1;  	// Test-Flag  ""
184 	static sal_Bool  bTest9;	// Test-Flag  "DrawingLayerNotLoading"
185 	sal_Bool  bTest10		:1;  	// Test-Flag  "Format by Input"
186 #endif
187 
188 public:
189 			SwViewOption();				  		// CTOR
190 			SwViewOption(const SwViewOption&);	//
191 			~SwViewOption();	  		  		//
192 
193 	void   Init( Window *pWin );		// Initialisierung der statischen Daten
194 
195 	sal_uInt16 GetPixelTwips() const { return nPixelTwips; }
196 
197 	inline sal_uInt32	GetCoreOptions() const {return nCoreOptions;}
198     inline void     SetUIOptions( const SwViewOption& );
199 
200 /*---------------------------------------------------------------------------
201 	Optionen aus nCoreOptions
202 ----------------------------------------------------------------------------*/
203 
204 	inline sal_Bool IsIdle() const
205         { return bIdle; }
206 
207     // logically this is a const function since it does not modify the viewoptions
208     // but only effects idle formatting. Of course that member is already implement
209     // in the wrong place here... Also currently there are many const modifying casts in the code
210     // just to call this function on otherwise const objects. Thus declaring it as const now.
211     inline void SetIdle( sal_Bool b ) const
212         { bIdle = b; }
213 
214 	inline sal_Bool IsTab(sal_Bool bHard = sal_False) const
215 					{   return !bReadonly && (nCoreOptions & VIEWOPT_1_TAB) &&
216 							((nCoreOptions & VIEWOPT_1_VIEWMETACHARS)||bHard)
217 									? sal_True : sal_False; }
218 	inline void SetTab( sal_Bool b ) 		{
219 		(b != 0) ? (nCoreOptions |= VIEWOPT_1_TAB ) : ( nCoreOptions &= ~VIEWOPT_1_TAB); }
220 
221     inline sal_Bool IsBlank(sal_Bool bHard = sal_False) const
222 					{ return !bReadonly && (nCoreOptions & VIEWOPT_1_BLANK) &&
223 							((nCoreOptions & VIEWOPT_1_VIEWMETACHARS)||bHard)
224 									? sal_True : sal_False; }
225 	inline void SetBlank( sal_Bool b )
226 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_BLANK ) : ( nCoreOptions &= ~VIEWOPT_1_BLANK); }
227 
228 	inline sal_Bool IsHardBlank() const
229 					{ return !bReadonly && nCoreOptions & VIEWOPT_1_HARDBLANK ? sal_True : sal_False; }
230 	inline void SetHardBlank( sal_Bool b )
231 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_HARDBLANK ) : ( nCoreOptions &= ~VIEWOPT_1_HARDBLANK); }
232 
233 	inline sal_Bool IsParagraph(sal_Bool bHard = sal_False) const
234 					{   return !bReadonly && (nCoreOptions & VIEWOPT_1_PARAGRAPH) &&
235 							((nCoreOptions & VIEWOPT_1_VIEWMETACHARS)||bHard)
236 									? sal_True : sal_False; }
237 	inline void SetParagraph( sal_Bool b )
238 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_PARAGRAPH ) : ( nCoreOptions &= ~VIEWOPT_1_PARAGRAPH); }
239 
240 	inline sal_Bool IsLineBreak(sal_Bool bHard = sal_False) const
241 					{   return !bReadonly && (nCoreOptions & VIEWOPT_1_LINEBREAK) &&
242 							((nCoreOptions & VIEWOPT_1_VIEWMETACHARS)||bHard)
243 									? sal_True : sal_False; }
244 	inline void SetLineBreak( sal_Bool b )
245 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_LINEBREAK ) : ( nCoreOptions &= ~VIEWOPT_1_LINEBREAK); }
246 
247     inline void SetPageBreak( sal_Bool b )
248 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_PAGEBREAK ) : ( nCoreOptions &= ~VIEWOPT_1_PAGEBREAK); }
249 
250     inline void SetColumnBreak( sal_Bool b)
251 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_COLUMNBREAK ) : ( nCoreOptions &= ~VIEWOPT_1_COLUMNBREAK); }
252 
253 	inline sal_Bool IsSoftHyph() const
254 					{ return !bReadonly && (nCoreOptions & VIEWOPT_1_SOFTHYPH) ? sal_True : sal_False; }
255 	inline void SetSoftHyph( sal_Bool b )
256 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_SOFTHYPH ) : ( nCoreOptions &= ~VIEWOPT_1_SOFTHYPH); }
257 
258 	inline sal_Bool IsFldName() const 		{ return !bReadonly && (nCoreOptions & VIEWOPT_1_FLDNAME) ? sal_True : sal_False; }
259 	inline void SetFldName( sal_Bool b )
260 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_FLDNAME ) : ( nCoreOptions &= ~VIEWOPT_1_FLDNAME); }
261 
262     inline sal_Bool IsPostIts() const
263 		{ return (nCoreOptions & VIEWOPT_1_POSTITS) ? sal_True : sal_False; }
264 	inline void SetPostIts( sal_Bool b )
265 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_POSTITS ) : ( nCoreOptions &= ~VIEWOPT_1_POSTITS); }
266 		   void PaintPostIts( OutputDevice *pOut, const SwRect &rRect,
267                               sal_Bool bIsScript ) const;
268 		   sal_uInt16 GetPostItsWidth( const OutputDevice *pOut = 0 ) const;
269 
270     inline sal_Bool IsShowHiddenChar(sal_Bool bHard = sal_False) const
271         { return !bReadonly && (nCoreOptions & VIEWOPT_1_CHAR_HIDDEN) &&
272                             ((nCoreOptions & VIEWOPT_1_VIEWMETACHARS)||bHard)
273                                     ? sal_True : sal_False; }
274 
275     inline void SetShowHiddenChar( sal_Bool b )
276         { (b != 0) ? (nCoreOptions |= VIEWOPT_1_CHAR_HIDDEN ) : ( nCoreOptions &= ~VIEWOPT_1_CHAR_HIDDEN); }
277 
278 
279     inline sal_Bool IsShowHiddenField() const
280         { return !bReadonly && (nCoreOptions & VIEWOPT_1_FLD_HIDDEN) ? sal_True : sal_False; }
281     inline void SetShowHiddenField( sal_Bool b )
282         { (b != 0) ? (nCoreOptions |= VIEWOPT_1_FLD_HIDDEN ) : ( nCoreOptions &= ~VIEWOPT_1_FLD_HIDDEN); }
283 
284 	inline sal_Bool IsGraphic() const
285 		{ return nCoreOptions & VIEWOPT_1_GRAPHIC ? sal_True : sal_False; }
286 	inline void SetGraphic( sal_Bool b )
287 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_GRAPHIC ) : ( nCoreOptions &= ~VIEWOPT_1_GRAPHIC); }
288 
289 	inline sal_Bool IsPageBack() const
290 		{ return nCoreOptions & VIEWOPT_1_PAGEBACK ? sal_True : sal_False; }
291     inline void SetPageBack( sal_Bool b )
292         { (b != 0) ? (nCoreOptions |= VIEWOPT_1_PAGEBACK) : ( nCoreOptions &= ~VIEWOPT_1_PAGEBACK); }
293 
294 	inline sal_Bool IsSolidMarkHdl() const
295 		{ return nCoreOptions & VIEWOPT_1_SOLIDMARKHDL ? sal_True : sal_False; }
296 	inline void SetSolidMarkHdl( sal_Bool b )
297 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_SOLIDMARKHDL) : ( nCoreOptions &= ~VIEWOPT_1_SOLIDMARKHDL); }
298 
299 	inline sal_Bool IsBigMarkHdl() const
300 		{ return nCore2Options & VIEWOPT_CORE2_BIGMARKHDL ? sal_True : sal_False;}
301 	inline void SetBigMarkHdl(sal_Bool b)
302 		{ (b != 0) ? (nCore2Options |=  VIEWOPT_CORE2_BIGMARKHDL ) : (nCore2Options &=  ~VIEWOPT_CORE2_BIGMARKHDL);}
303 
304 	inline sal_Bool IsTable() const
305 		{ return nCoreOptions & VIEWOPT_1_TABLE ? sal_True : sal_False; }
306 	inline void SetTable( sal_Bool b )
307 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_TABLE ) : ( nCoreOptions &= ~VIEWOPT_1_TABLE); }
308 
309 	inline sal_Bool IsDraw() const
310 		{ return nCoreOptions & VIEWOPT_1_DRAW ? sal_True : sal_False; }
311 	inline void SetDraw( sal_Bool b )
312 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_DRAW ) : ( nCoreOptions &= ~VIEWOPT_1_DRAW); }
313 
314 	inline sal_Bool IsControl() const
315 		{ return nCoreOptions & VIEWOPT_1_CONTROL ? sal_True : sal_False; }
316 	inline void SetControl( sal_Bool b )
317 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_CONTROL ) : ( nCoreOptions &= ~VIEWOPT_1_CONTROL); }
318 
319     inline sal_Bool IsSnap() const
320 		{ return nCoreOptions & VIEWOPT_1_SNAP ? sal_True : sal_False; }
321 	inline void SetSnap( sal_Bool b )
322 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_SNAP ) : ( nCoreOptions &= ~VIEWOPT_1_SNAP); }
323 
324 	inline void	SetSnapSize( Size &rSz ){ aSnapSize = rSz; }
325 	inline const Size &GetSnapSize() const { return aSnapSize; }
326 
327 	inline sal_Bool IsGridVisible() const
328 		{ return !bReadonly && (nCoreOptions & VIEWOPT_1_GRIDVISIBLE) ? sal_True : sal_False; }
329 	inline void SetGridVisible( sal_Bool b )
330 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_GRIDVISIBLE ) : ( nCoreOptions &= ~VIEWOPT_1_GRIDVISIBLE); }
331 
332 	inline sal_Bool IsOnlineSpell() const
333 		{ return !bReadonly && (nCoreOptions & VIEWOPT_1_ONLINESPELL) ? sal_True : sal_False; }
334 	inline void SetOnlineSpell( sal_Bool b )
335 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_ONLINESPELL ) : ( nCoreOptions &= ~VIEWOPT_1_ONLINESPELL); }
336 
337 	inline sal_Bool IsViewMetaChars() const
338 		{ return !bReadonly && (nCoreOptions & VIEWOPT_1_VIEWMETACHARS) ? sal_True : sal_False; }
339 	inline void SetViewMetaChars( sal_Bool b)
340 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_VIEWMETACHARS ) : ( nCoreOptions &= ~VIEWOPT_1_VIEWMETACHARS); }
341 
342 	inline sal_Bool IsSynchronize() const
343 		{  return nCoreOptions & VIEWOPT_1_SYNCHRONIZE ? sal_True : sal_False;}
344 	inline void SetSynchronize( sal_Bool b )
345 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_SYNCHRONIZE ) : ( nCoreOptions &= ~VIEWOPT_1_SYNCHRONIZE); }
346 
347 	inline sal_Bool IsCrossHair() const
348 		{ return nCoreOptions & VIEWOPT_1_CROSSHAIR ? sal_True : sal_False; }
349 	inline void SetCrossHair( sal_Bool b )
350 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_CROSSHAIR ) : ( nCoreOptions &= ~VIEWOPT_1_CROSSHAIR); }
351 
352 /*---------------------------------------------------------------------------
353 	Optionen aus nCore2Options
354 ----------------------------------------------------------------------------*/
355 	inline sal_Bool	IsBlackFont() const
356 		{return nCore2Options & VIEWOPT_CORE2_BLACKFONT ? sal_True : sal_False;}
357 
358     inline void SetBlackFont(sal_Bool b)
359         { (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_BLACKFONT) : (nCore2Options &= ~VIEWOPT_CORE2_BLACKFONT);}
360 
361 	inline sal_Bool	IsShowHiddenPara() const
362 		{return nCore2Options & VIEWOPT_CORE2_HIDDENPARA ? sal_True : sal_False;}
363 
364 	inline void SetShowHiddenPara(sal_Bool b)
365 		{ (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_HIDDENPARA) : (nCore2Options &= ~VIEWOPT_CORE2_HIDDENPARA);}
366 
367 	inline sal_Bool	IsSmoothScroll() const
368 		{return nCore2Options & VIEWOPT_CORE2_SMOOTHSCROLL ? sal_True : sal_False;}
369 
370 	inline void SetSmoothScroll(sal_Bool b)
371 		{ (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_SMOOTHSCROLL) : (nCore2Options &= ~VIEWOPT_CORE2_SMOOTHSCROLL);}
372 
373 	inline sal_Bool	IsCursorInProtectedArea() const
374 		{return nCore2Options & VIEWOPT_CORE2_CRSR_IN_PROT ? sal_True : sal_False;}
375 
376 	inline void SetCursorInProtectedArea(sal_Bool b)
377 		{ (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_CRSR_IN_PROT) : (nCore2Options &= ~VIEWOPT_CORE2_CRSR_IN_PROT);}
378 
379     inline sal_Bool IsPDFExport() const
380         {return nCore2Options & VIEWOPT_CORE2_PDF_EXPORT ? sal_True : sal_False;}
381 
382     inline void SetPDFExport(sal_Bool b)
383         { (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_PDF_EXPORT) : (nCore2Options &= ~VIEWOPT_CORE2_PDF_EXPORT);}
384 
385     inline sal_Bool IsPrinting() const
386         {return nCore2Options & VIEWOPT_CORE2_PRINTING ? sal_True : sal_False;}
387 
388     inline void SetPrinting(sal_Bool b)
389         { (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_PRINTING) : (nCore2Options &= ~VIEWOPT_CORE2_PRINTING);}
390 
391 /*---------------------------------------------------------------------------
392 
393 ----------------------------------------------------------------------------*/
394 
395 
396 	inline short GetDivisionX() const	{ return nDivisionX; }
397 	inline void  SetDivisionX( short n ){ nDivisionX = n; }
398 	inline short GetDivisionY() const	{ return nDivisionY; }
399 	inline void  SetDivisionY( short n ){ nDivisionY = n; }
400 
401 	inline sal_uInt8  GetPagePrevRow() const	  { return nPagePrevRow; }
402 	inline void  SetPagePrevRow( sal_uInt8 n ) { nPagePrevRow = n; }
403 	inline sal_uInt8  GetPagePrevCol() const	  { return nPagePrevCol; }
404 	inline void  SetPagePrevCol( sal_uInt8 n ) { nPagePrevCol = n; }
405 	sal_Bool  		 IsReadonly() const { return bReadonly; }
406 	void		 SetReadonly(sal_Bool bSet) { bReadonly = bSet; }
407 
408     sal_Bool         IsSelectionInReadonly() const {return bSelectionInReadonly;}
409     void         SetSelectionInReadonly(sal_Bool bSet) {bSelectionInReadonly = bSet;}
410 
411     sal_Bool         IsFormView() const { return mbFormView; }
412     void         SetFormView( sal_Bool bSet ) { mbFormView = bSet; }
413     // <--
414 
415     inline sal_Bool  getBrowseMode() const { return mbBrowseMode; }
416     inline void  setBrowseMode(sal_Bool bSet) { mbBrowseMode = bSet; }
417     inline sal_Bool  IsPagePrevBookview() const { return mbBookView; }
418     inline void  SetPagePrevBookview(sal_Bool bSet) { mbBookView = bSet; }
419 
420     sal_Bool IsAutoCompleteWords() const;
421 
422     // PAGES01
423     bool   IsViewLayoutBookMode() const { return mbViewLayoutBookMode; }
424     void   SetViewLayoutBookMode( bool bNew ) { mbViewLayoutBookMode = bNew; }
425     sal_uInt16 GetViewLayoutColumns() const { return mnViewLayoutColumns; }
426     void   SetViewLayoutColumns( sal_uInt16 nNew ) { mnViewLayoutColumns = nNew; }
427 
428 #ifdef DBG_UTIL
429 	// korrespondieren zu den Angaben in ui/config/cfgvw.src
430 	inline sal_Bool IsTest1() const		{ return bTest1; }
431 	inline void SetTest1( sal_Bool b )	{ bTest1 = b; }
432 	inline sal_Bool IsTest2() const		{ return bTest2; }
433 	inline void SetTest2( sal_Bool b )	{ bTest2 = b; }
434 	inline sal_Bool IsTest3() const		{ return bTest3; }
435 	inline void SetTest3( sal_Bool b )	{ bTest3 = b; }
436 	inline sal_Bool IsTest4() const		{ return bTest4; }
437 	inline void SetTest4( sal_Bool b )	{ bTest4 = b; }
438 	inline sal_Bool IsTest5() const		{ return bTest5; }
439 	inline void SetTest5( sal_Bool b )	{ bTest5 = b; }
440 	inline sal_Bool IsTest6() const		{ return bTest6; }
441 	inline void SetTest6( sal_Bool b )	{ bTest6 = b; }
442 	inline sal_Bool IsTest7() const		{ return bTest7; }
443 	inline void SetTest7( sal_Bool b )	{ bTest7 = b; }
444 	inline sal_Bool IsTest8() const		{ return bTest8; }
445 	inline void SetTest8( sal_Bool b )	{ bTest8 = b; }
446 	static inline sal_Bool IsTest9()			{ return bTest9; }
447 	static inline void SetTest9( sal_Bool b )	{ bTest9 = b; }
448 	inline sal_Bool IsTest10() const	{ return bTest10; }
449 	inline void SetTest10( sal_Bool b )	{ bTest10 = b; }
450 #endif
451 
452 	inline sal_uInt16 GetZoom() const	 { return nZoom; }
453 	inline void   SetZoom( sal_uInt16 n ){ nZoom = n; }
454 
455 	void DrawRect( OutputDevice* pOut, const SwRect &rRect, long nCol ) const;
456 	void DrawRectPrinter( OutputDevice* pOut, const SwRect& rRect ) const;
457 
458 	SwViewOption& operator=( const SwViewOption &rOpt );
459 	// Vergleichsmethoden
460 	sal_Bool IsEqualFlags ( const SwViewOption &rOpt ) const;
461     inline sal_Bool operator == ( const SwViewOption &rOpt ) const;
462     inline sal_Bool operator != ( const SwViewOption &rOpt ) const  { return !(*this == rOpt); }
463 
464 
465 /*---------------------------------------------------------------------------
466 	Optionen aus nUIOptions
467 ----------------------------------------------------------------------------*/
468 
469     sal_Bool    IsViewVScrollBar() const
470 		{ return nUIOptions & VIEWOPT_2_VSCROLLBAR ? sal_True : sal_False;	  }
471 	sal_Bool 	IsViewHScrollBar() const
472 		{ return nUIOptions & VIEWOPT_2_HSCROLLBAR ? sal_True : sal_False;	  }
473     sal_Bool    IsKeepRatio()      const
474 		{ return nUIOptions & VIEWOPT_2_KEEPASPECTRATIO ? sal_True : sal_False;	  }
475 	sal_Bool 	IsGrfKeepZoom()	   const
476 		{ return nUIOptions & VIEWOPT_2_GRFKEEPZOOM ? sal_True : sal_False;	  }
477     sal_Bool    IsPreventTips() const
478         { return nUIOptions & VIEWOPT_2_PREVENT_TIPS ? sal_True : sal_False; }
479 	sal_Bool 	IsPrtFormat() const
480 		{ return nUIOptions & VIEWOPT_2_PRTFORMAT ? sal_True : sal_False; }
481 
482     SvxZoomType    GetZoomType()      const { return eZoom; }
483 
484 	sal_uInt8	GetTblDest() const 	  { return nTblDest; }
485 
486 	void   SetViewVScrollBar(sal_Bool b)
487 		{ b ? (nUIOptions |= VIEWOPT_2_VSCROLLBAR ) : ( nUIOptions &= ~VIEWOPT_2_VSCROLLBAR); }
488 	void   SetViewHScrollBar(sal_Bool b)
489 		{ b ? (nUIOptions |= VIEWOPT_2_HSCROLLBAR ) : ( nUIOptions &= ~VIEWOPT_2_HSCROLLBAR); }
490 	void   SetKeepRatio		(sal_Bool b)
491 		{ b ? (nUIOptions |= VIEWOPT_2_KEEPASPECTRATIO ) : ( nUIOptions &= ~VIEWOPT_2_KEEPASPECTRATIO); }
492 	void   SetGrfKeepZoom	(sal_Bool b)
493 		{ b ? (nUIOptions |= VIEWOPT_2_GRFKEEPZOOM ) : ( nUIOptions &= ~VIEWOPT_2_GRFKEEPZOOM); }
494     void SetPreventTips( sal_Bool b)
495         { b ? (nUIOptions |= VIEWOPT_2_PREVENT_TIPS) : (nUIOptions &= ~VIEWOPT_2_PREVENT_TIPS); }
496     void SetPrtFormat( sal_Bool b)
497         { b ? (nUIOptions |= VIEWOPT_2_PRTFORMAT) : (nUIOptions &= ~VIEWOPT_2_PRTFORMAT); }
498 
499     void            SetZoomType     (SvxZoomType eZoom_){ eZoom = eZoom_;  }
500 	void   			SetTblDest( sal_uInt8 nNew )  	{ nTblDest = nNew;  }
501 
502 	const String&	GetSymbolFont() const {return sSymbolFont;}
503 	void 			SetSymbolFont(const String& sSet) {sSymbolFont = sSet;}
504 
505 	const Color& 	GetRetoucheColor() const 		{ return aRetoucheColor;}
506 	void 			SetRetoucheColor(const Color&r) { aRetoucheColor = r;	}
507 
508     sal_Bool            IsViewAnyRuler() const {return 0 != (nUIOptions & VIEWOPT_2_ANY_RULER);}
509     void            SetViewAnyRuler(sal_Bool bSet)
510                         { bSet ? (nUIOptions |= VIEWOPT_2_ANY_RULER) : (nUIOptions &= ~VIEWOPT_2_ANY_RULER);}
511 
512     sal_Bool            IsViewHRuler(sal_Bool bDirect = sal_False)     const
513                         {
514                             sal_Bool bRet = sal::static_int_cast< sal_Bool >( bDirect  ?
515                                     0 != (nUIOptions & VIEWOPT_2_H_RULER) :
516                                     !bReadonly ?
517                                         (nUIOptions & (VIEWOPT_2_ANY_RULER|VIEWOPT_2_H_RULER)) == (VIEWOPT_2_ANY_RULER|VIEWOPT_2_H_RULER)
518                                         : sal_False );
519                             return bRet;
520 
521                         }
522     void            SetViewHRuler   (sal_Bool b)
523                         {    b ? (nUIOptions |= VIEWOPT_2_H_RULER ) : ( nUIOptions &= ~VIEWOPT_2_H_RULER);}
524 
525     sal_Bool            IsViewVRuler(sal_Bool bDirect = sal_False) const
526                         {
527                             sal_Bool bRet = sal::static_int_cast< sal_Bool >( bDirect  ?
528                                     0 !=(nUIOptions & VIEWOPT_2_V_RULER) :
529                                     !bReadonly ?
530                                         (nUIOptions &
531                                             (VIEWOPT_2_ANY_RULER|VIEWOPT_2_V_RULER)) == (VIEWOPT_2_ANY_RULER|VIEWOPT_2_V_RULER)
532                                         : sal_False );
533                             return bRet;
534                         }
535     void            SetViewVRuler     (sal_Bool b)
536                         { b ? (nUIOptions |= VIEWOPT_2_V_RULER ) : ( nUIOptions &= ~VIEWOPT_2_V_RULER);}
537 
538 	// ShadowCursor ein schalten/abfragen/Farbe setzen/Modus setzen
539 	sal_Bool 	IsShadowCursor()    const
540 		{ return nUIOptions & VIEWOPT_2_SHADOWCRSR ? sal_True : sal_False;   }
541 	void   SetShadowCursor(sal_Bool b)
542 		{ b ? (nUIOptions |= VIEWOPT_2_SHADOWCRSR ) : ( nUIOptions &= ~VIEWOPT_2_SHADOWCRSR); }
543 
544     //move vertical ruler to the right
545     sal_Bool    IsVRulerRight()    const
546         { return nUIOptions & VIEWOPT_2_V_RULER_RIGHT ? sal_True : sal_False;   }
547     void   SetVRulerRight(sal_Bool b)
548         { b ? (nUIOptions |= VIEWOPT_2_V_RULER_RIGHT ) : ( nUIOptions &= ~VIEWOPT_2_V_RULER_RIGHT); }
549 
550 	sal_Bool			IsStarOneSetting() const {return bStarOneSetting; }
551 	void			SetStarOneSetting(sal_Bool bSet) {bStarOneSetting = bSet; }
552 
553     sal_Bool            IsPagePreview() const {return bIsPagePreview; }
554     void            SetPagePreview(sal_Bool bSet) { bIsPagePreview= bSet; }
555 
556 	sal_uInt8 			GetShdwCrsrFillMode() const { return nShdwCrsrFillMode; }
557 	void 			SetShdwCrsrFillMode( sal_uInt8 nMode ) { nShdwCrsrFillMode = nMode; };
558 
559     sal_Bool        IsShowPlaceHolderFields() const { return bShowPlaceHolderFields; }
560     void            SetShowPlaceHolderFields(sal_Bool bSet) { bShowPlaceHolderFields = bSet; }
561 
562     static Color&   GetDocColor();
563     static Color&   GetDocBoundariesColor();
564     static Color&   GetAppBackgroundColor();
565     static Color&   GetObjectBoundariesColor();
566     static Color&   GetTableBoundariesColor();
567     static Color&   GetIndexShadingsColor();
568     static Color&   GetLinksColor();
569     static Color&   GetVisitedLinksColor();
570     static Color&   GetDirectCursorColor();
571     static Color&   GetTextGridColor();
572     static Color&   GetSpellColor();
573     static Color&   GetSmarttagColor();
574     SW_DLLPUBLIC static Color&   GetFontColor();
575     static Color&   GetFieldShadingsColor();
576     static Color&   GetSectionBoundColor();
577     static Color&   GetPageBreakColor();
578 
579     static sal_Bool     IsAppearanceFlag(sal_Int32 nFlag);
580 
581     static sal_Bool     IsDocBoundaries()   {return IsAppearanceFlag(VIEWOPT_DOC_BOUNDARIES);}
582     static sal_Bool     IsObjectBoundaries(){return IsAppearanceFlag(VIEWOPT_OBJECT_BOUNDARIES);}
583     static sal_Bool     IsTableBoundaries() {return IsAppearanceFlag(VIEWOPT_TABLE_BOUNDARIES );}
584     static sal_Bool     IsIndexShadings()   {return IsAppearanceFlag(VIEWOPT_INDEX_SHADINGS   );}
585     static sal_Bool     IsLinks()           {return IsAppearanceFlag(VIEWOPT_LINKS            );}
586     static sal_Bool     IsVisitedLinks()    {return IsAppearanceFlag(VIEWOPT_VISITED_LINKS    );}
587     static sal_Bool     IsFieldShadings()   {return IsAppearanceFlag(VIEWOPT_FIELD_SHADINGS);}
588     static sal_Bool     IsSectionBoundaries() {return IsAppearanceFlag(VIEWOPT_SECTION_BOUNDARIES);}
589 
590     static void     SetAppearanceFlag(sal_Int32 nFlag, sal_Bool bSet, sal_Bool bSaveInConfig = sal_False);
591 
592     void    SetDocBoundaries(sal_Bool bSet)   {SetAppearanceFlag(VIEWOPT_DOC_BOUNDARIES, bSet);}
593 
594     static void     ApplyColorConfigValues(const svtools::ColorConfig& rConfig);
595 };
596 
597 
598 inline sal_Bool SwViewOption::operator==( const SwViewOption &rOpt ) const
599 {
600 	return IsEqualFlags( rOpt ) && nZoom == rOpt.GetZoom();
601 }
602 
603 inline void SwViewOption::SetUIOptions( const SwViewOption& rVOpt )
604 {
605 	nUIOptions = rVOpt.nUIOptions;
606 	nTblDest = rVOpt.nTblDest;
607 	nShdwCrsrFillMode = rVOpt.nShdwCrsrFillMode;
608 }
609 
610 
611 // Hilfsfunktion zur Ermittlung der HTML-Faehigkeiten
612 SW_DLLPUBLIC sal_uInt16		GetHtmlMode(const SwDocShell*);
613 
614 
615 #endif
616