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