xref: /trunk/main/sw/inc/viewopt.hxx (revision a41e6500)
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_CONTENT_TIPS      0x00100000L
93 #define VIEWOPT_2_RESERVED3         0x00200000L
94 #define VIEWOPT_2_SCROLLBAR_TIPS    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 
GetPixelTwips() const191 	sal_uInt16 GetPixelTwips() const { return nPixelTwips; }
192 
GetCoreOptions() const193 	inline sal_uInt32	GetCoreOptions() const {return nCoreOptions;}
194     inline void     SetUIOptions( const SwViewOption& );
195 
196 /*---------------------------------------------------------------------------
197 	Optionen aus nCoreOptions
198 ----------------------------------------------------------------------------*/
199 
IsIdle() const200 	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.
SetIdle(sal_Bool b) const207     inline void SetIdle( sal_Bool b ) const
208         { bIdle = b; }
209 
IsTab(sal_Bool bHard=sal_False) const210 	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; }
SetTab(sal_Bool b)214 	inline void SetTab( sal_Bool b ) 		{
215 		(b != 0) ? (nCoreOptions |= VIEWOPT_1_TAB ) : ( nCoreOptions &= ~VIEWOPT_1_TAB); }
216 
IsBlank(sal_Bool bHard=sal_False) const217     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; }
SetBlank(sal_Bool b)221 	inline void SetBlank( sal_Bool b )
222 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_BLANK ) : ( nCoreOptions &= ~VIEWOPT_1_BLANK); }
223 
IsHardBlank() const224 	inline sal_Bool IsHardBlank() const
225 					{ return !bReadonly && nCoreOptions & VIEWOPT_1_HARDBLANK ? sal_True : sal_False; }
SetHardBlank(sal_Bool b)226 	inline void SetHardBlank( sal_Bool b )
227 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_HARDBLANK ) : ( nCoreOptions &= ~VIEWOPT_1_HARDBLANK); }
228 
IsParagraph(sal_Bool bHard=sal_False) const229 	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; }
SetParagraph(sal_Bool b)233 	inline void SetParagraph( sal_Bool b )
234 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_PARAGRAPH ) : ( nCoreOptions &= ~VIEWOPT_1_PARAGRAPH); }
235 
IsLineBreak(sal_Bool bHard=sal_False) const236 	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; }
SetLineBreak(sal_Bool b)240 	inline void SetLineBreak( sal_Bool b )
241 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_LINEBREAK ) : ( nCoreOptions &= ~VIEWOPT_1_LINEBREAK); }
242 
SetPageBreak(sal_Bool b)243     inline void SetPageBreak( sal_Bool b )
244 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_PAGEBREAK ) : ( nCoreOptions &= ~VIEWOPT_1_PAGEBREAK); }
245 
SetColumnBreak(sal_Bool b)246     inline void SetColumnBreak( sal_Bool b)
247 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_COLUMNBREAK ) : ( nCoreOptions &= ~VIEWOPT_1_COLUMNBREAK); }
248 
IsSoftHyph() const249 	inline sal_Bool IsSoftHyph() const
250 					{ return !bReadonly && (nCoreOptions & VIEWOPT_1_SOFTHYPH) ? sal_True : sal_False; }
SetSoftHyph(sal_Bool b)251 	inline void SetSoftHyph( sal_Bool b )
252 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_SOFTHYPH ) : ( nCoreOptions &= ~VIEWOPT_1_SOFTHYPH); }
253 
IsFldName() const254 	inline sal_Bool IsFldName() const 		{ return !bReadonly && (nCoreOptions & VIEWOPT_1_FLDNAME) ? sal_True : sal_False; }
SetFldName(sal_Bool b)255 	inline void SetFldName( sal_Bool b )
256 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_FLDNAME ) : ( nCoreOptions &= ~VIEWOPT_1_FLDNAME); }
257 
IsPostIts() const258     inline sal_Bool IsPostIts() const
259 		{ return (nCoreOptions & VIEWOPT_1_POSTITS) ? sal_True : sal_False; }
SetPostIts(sal_Bool b)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 
IsShowHiddenChar(sal_Bool bHard=sal_False) const266     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 
SetShowHiddenChar(sal_Bool b)271     inline void SetShowHiddenChar( sal_Bool b )
272         { (b != 0) ? (nCoreOptions |= VIEWOPT_1_CHAR_HIDDEN ) : ( nCoreOptions &= ~VIEWOPT_1_CHAR_HIDDEN); }
273 
274 
IsShowHiddenField() const275     inline sal_Bool IsShowHiddenField() const
276         { return !bReadonly && (nCoreOptions & VIEWOPT_1_FLD_HIDDEN) ? sal_True : sal_False; }
SetShowHiddenField(sal_Bool b)277     inline void SetShowHiddenField( sal_Bool b )
278         { (b != 0) ? (nCoreOptions |= VIEWOPT_1_FLD_HIDDEN ) : ( nCoreOptions &= ~VIEWOPT_1_FLD_HIDDEN); }
279 
IsGraphic() const280 	inline sal_Bool IsGraphic() const
281 		{ return nCoreOptions & VIEWOPT_1_GRAPHIC ? sal_True : sal_False; }
SetGraphic(sal_Bool b)282 	inline void SetGraphic( sal_Bool b )
283 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_GRAPHIC ) : ( nCoreOptions &= ~VIEWOPT_1_GRAPHIC); }
284 
IsPageBack() const285 	inline sal_Bool IsPageBack() const
286 		{ return nCoreOptions & VIEWOPT_1_PAGEBACK ? sal_True : sal_False; }
SetPageBack(sal_Bool b)287     inline void SetPageBack( sal_Bool b )
288         { (b != 0) ? (nCoreOptions |= VIEWOPT_1_PAGEBACK) : ( nCoreOptions &= ~VIEWOPT_1_PAGEBACK); }
289 
IsSolidMarkHdl() const290 	inline sal_Bool IsSolidMarkHdl() const
291 		{ return nCoreOptions & VIEWOPT_1_SOLIDMARKHDL ? sal_True : sal_False; }
SetSolidMarkHdl(sal_Bool b)292 	inline void SetSolidMarkHdl( sal_Bool b )
293 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_SOLIDMARKHDL) : ( nCoreOptions &= ~VIEWOPT_1_SOLIDMARKHDL); }
294 
IsBigMarkHdl() const295 	inline sal_Bool IsBigMarkHdl() const
296 		{ return nCore2Options & VIEWOPT_CORE2_BIGMARKHDL ? sal_True : sal_False;}
SetBigMarkHdl(sal_Bool b)297 	inline void SetBigMarkHdl(sal_Bool b)
298 		{ (b != 0) ? (nCore2Options |=  VIEWOPT_CORE2_BIGMARKHDL ) : (nCore2Options &=  ~VIEWOPT_CORE2_BIGMARKHDL);}
299 
IsTable() const300 	inline sal_Bool IsTable() const
301 		{ return nCoreOptions & VIEWOPT_1_TABLE ? sal_True : sal_False; }
SetTable(sal_Bool b)302 	inline void SetTable( sal_Bool b )
303 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_TABLE ) : ( nCoreOptions &= ~VIEWOPT_1_TABLE); }
304 
IsDraw() const305 	inline sal_Bool IsDraw() const
306 		{ return nCoreOptions & VIEWOPT_1_DRAW ? sal_True : sal_False; }
SetDraw(sal_Bool b)307 	inline void SetDraw( sal_Bool b )
308 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_DRAW ) : ( nCoreOptions &= ~VIEWOPT_1_DRAW); }
309 
IsControl() const310 	inline sal_Bool IsControl() const
311 		{ return nCoreOptions & VIEWOPT_1_CONTROL ? sal_True : sal_False; }
SetControl(sal_Bool b)312 	inline void SetControl( sal_Bool b )
313 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_CONTROL ) : ( nCoreOptions &= ~VIEWOPT_1_CONTROL); }
314 
IsSnap() const315     inline sal_Bool IsSnap() const
316 		{ return nCoreOptions & VIEWOPT_1_SNAP ? sal_True : sal_False; }
SetSnap(sal_Bool b)317 	inline void SetSnap( sal_Bool b )
318 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_SNAP ) : ( nCoreOptions &= ~VIEWOPT_1_SNAP); }
319 
SetSnapSize(Size & rSz)320 	inline void	SetSnapSize( Size &rSz ){ aSnapSize = rSz; }
GetSnapSize() const321 	inline const Size &GetSnapSize() const { return aSnapSize; }
322 
IsGridVisible() const323 	inline sal_Bool IsGridVisible() const
324 		{ return !bReadonly && (nCoreOptions & VIEWOPT_1_GRIDVISIBLE) ? sal_True : sal_False; }
SetGridVisible(sal_Bool b)325 	inline void SetGridVisible( sal_Bool b )
326 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_GRIDVISIBLE ) : ( nCoreOptions &= ~VIEWOPT_1_GRIDVISIBLE); }
327 
IsOnlineSpell() const328 	inline sal_Bool IsOnlineSpell() const
329 		{ return !bReadonly && (nCoreOptions & VIEWOPT_1_ONLINESPELL) ? sal_True : sal_False; }
SetOnlineSpell(sal_Bool b)330 	inline void SetOnlineSpell( sal_Bool b )
331 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_ONLINESPELL ) : ( nCoreOptions &= ~VIEWOPT_1_ONLINESPELL); }
332 
IsViewMetaChars() const333 	inline sal_Bool IsViewMetaChars() const
334 		{ return !bReadonly && (nCoreOptions & VIEWOPT_1_VIEWMETACHARS) ? sal_True : sal_False; }
SetViewMetaChars(sal_Bool b)335 	inline void SetViewMetaChars( sal_Bool b)
336 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_VIEWMETACHARS ) : ( nCoreOptions &= ~VIEWOPT_1_VIEWMETACHARS); }
337 
IsSynchronize() const338 	inline sal_Bool IsSynchronize() const
339 		{  return nCoreOptions & VIEWOPT_1_SYNCHRONIZE ? sal_True : sal_False;}
SetSynchronize(sal_Bool b)340 	inline void SetSynchronize( sal_Bool b )
341 		{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_SYNCHRONIZE ) : ( nCoreOptions &= ~VIEWOPT_1_SYNCHRONIZE); }
342 
IsCrossHair() const343 	inline sal_Bool IsCrossHair() const
344 		{ return nCoreOptions & VIEWOPT_1_CROSSHAIR ? sal_True : sal_False; }
SetCrossHair(sal_Bool b)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 ----------------------------------------------------------------------------*/
IsBlackFont() const351 	inline sal_Bool	IsBlackFont() const
352 		{return nCore2Options & VIEWOPT_CORE2_BLACKFONT ? sal_True : sal_False;}
353 
SetBlackFont(sal_Bool b)354     inline void SetBlackFont(sal_Bool b)
355         { (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_BLACKFONT) : (nCore2Options &= ~VIEWOPT_CORE2_BLACKFONT);}
356 
IsShowHiddenPara() const357 	inline sal_Bool	IsShowHiddenPara() const
358 		{return nCore2Options & VIEWOPT_CORE2_HIDDENPARA ? sal_True : sal_False;}
359 
SetShowHiddenPara(sal_Bool b)360 	inline void SetShowHiddenPara(sal_Bool b)
361 		{ (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_HIDDENPARA) : (nCore2Options &= ~VIEWOPT_CORE2_HIDDENPARA);}
362 
IsSmoothScroll() const363 	inline sal_Bool	IsSmoothScroll() const
364 		{return nCore2Options & VIEWOPT_CORE2_SMOOTHSCROLL ? sal_True : sal_False;}
365 
SetSmoothScroll(sal_Bool b)366 	inline void SetSmoothScroll(sal_Bool b)
367 		{ (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_SMOOTHSCROLL) : (nCore2Options &= ~VIEWOPT_CORE2_SMOOTHSCROLL);}
368 
IsCursorInProtectedArea() const369 	inline sal_Bool	IsCursorInProtectedArea() const
370 		{return nCore2Options & VIEWOPT_CORE2_CRSR_IN_PROT ? sal_True : sal_False;}
371 
SetCursorInProtectedArea(sal_Bool b)372 	inline void SetCursorInProtectedArea(sal_Bool b)
373 		{ (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_CRSR_IN_PROT) : (nCore2Options &= ~VIEWOPT_CORE2_CRSR_IN_PROT);}
374 
IsPDFExport() const375     inline sal_Bool IsPDFExport() const
376         {return nCore2Options & VIEWOPT_CORE2_PDF_EXPORT ? sal_True : sal_False;}
377 
SetPDFExport(sal_Bool b)378     inline void SetPDFExport(sal_Bool b)
379         { (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_PDF_EXPORT) : (nCore2Options &= ~VIEWOPT_CORE2_PDF_EXPORT);}
380 
IsPrinting() const381     inline sal_Bool IsPrinting() const
382         {return nCore2Options & VIEWOPT_CORE2_PRINTING ? sal_True : sal_False;}
383 
SetPrinting(sal_Bool b)384     inline void SetPrinting(sal_Bool b)
385         { (b != 0) ? (nCore2Options |= VIEWOPT_CORE2_PRINTING) : (nCore2Options &= ~VIEWOPT_CORE2_PRINTING);}
386 
387 /*---------------------------------------------------------------------------
388 
389 ----------------------------------------------------------------------------*/
390 
391 
GetDivisionX() const392 	inline short GetDivisionX() const	{ return nDivisionX; }
SetDivisionX(short n)393 	inline void  SetDivisionX( short n ){ nDivisionX = n; }
GetDivisionY() const394 	inline short GetDivisionY() const	{ return nDivisionY; }
SetDivisionY(short n)395 	inline void  SetDivisionY( short n ){ nDivisionY = n; }
396 
GetPagePrevRow() const397 	inline sal_uInt8  GetPagePrevRow() const	  { return nPagePrevRow; }
SetPagePrevRow(sal_uInt8 n)398 	inline void  SetPagePrevRow( sal_uInt8 n ) { nPagePrevRow = n; }
GetPagePrevCol() const399 	inline sal_uInt8  GetPagePrevCol() const	  { return nPagePrevCol; }
SetPagePrevCol(sal_uInt8 n)400 	inline void  SetPagePrevCol( sal_uInt8 n ) { nPagePrevCol = n; }
IsReadonly() const401 	sal_Bool  		 IsReadonly() const { return bReadonly; }
SetReadonly(sal_Bool bSet)402 	void		 SetReadonly(sal_Bool bSet) { bReadonly = bSet; }
403 
IsSelectionInReadonly() const404     sal_Bool         IsSelectionInReadonly() const {return bSelectionInReadonly;}
SetSelectionInReadonly(sal_Bool bSet)405     void         SetSelectionInReadonly(sal_Bool bSet) {bSelectionInReadonly = bSet;}
406 
IsFormView() const407     sal_Bool         IsFormView() const { return mbFormView; }
SetFormView(sal_Bool bSet)408     void         SetFormView( sal_Bool bSet ) { mbFormView = bSet; }
409     // <--
410 
getBrowseMode() const411     inline sal_Bool  getBrowseMode() const { return mbBrowseMode; }
setBrowseMode(sal_Bool bSet)412     inline void  setBrowseMode(sal_Bool bSet) { mbBrowseMode = bSet; }
IsPagePrevBookview() const413     inline sal_Bool  IsPagePrevBookview() const { return mbBookView; }
SetPagePrevBookview(sal_Bool bSet)414     inline void  SetPagePrevBookview(sal_Bool bSet) { mbBookView = bSet; }
415 
416     sal_Bool IsAutoCompleteWords() const;
417 
418     // PAGES01
IsViewLayoutBookMode() const419     bool   IsViewLayoutBookMode() const { return mbViewLayoutBookMode; }
SetViewLayoutBookMode(bool bNew)420     void   SetViewLayoutBookMode( bool bNew ) { mbViewLayoutBookMode = bNew; }
GetViewLayoutColumns() const421     sal_uInt16 GetViewLayoutColumns() const { return mnViewLayoutColumns; }
SetViewLayoutColumns(sal_uInt16 nNew)422     void   SetViewLayoutColumns( sal_uInt16 nNew ) { mnViewLayoutColumns = nNew; }
423 
424 #ifdef DBG_UTIL
425 	// korrespondieren zu den Angaben in ui/config/cfgvw.src
IsTest1() const426 	inline sal_Bool IsTest1() const		{ return bTest1; }
SetTest1(sal_Bool b)427 	inline void SetTest1( sal_Bool b )	{ bTest1 = b; }
IsTest2() const428 	inline sal_Bool IsTest2() const		{ return bTest2; }
SetTest2(sal_Bool b)429 	inline void SetTest2( sal_Bool b )	{ bTest2 = b; }
IsTest3() const430 	inline sal_Bool IsTest3() const		{ return bTest3; }
SetTest3(sal_Bool b)431 	inline void SetTest3( sal_Bool b )	{ bTest3 = b; }
IsTest4() const432 	inline sal_Bool IsTest4() const		{ return bTest4; }
SetTest4(sal_Bool b)433 	inline void SetTest4( sal_Bool b )	{ bTest4 = b; }
IsTest5() const434 	inline sal_Bool IsTest5() const		{ return bTest5; }
SetTest5(sal_Bool b)435 	inline void SetTest5( sal_Bool b )	{ bTest5 = b; }
IsTest6() const436 	inline sal_Bool IsTest6() const		{ return bTest6; }
SetTest6(sal_Bool b)437 	inline void SetTest6( sal_Bool b )	{ bTest6 = b; }
IsTest7() const438 	inline sal_Bool IsTest7() const		{ return bTest7; }
SetTest7(sal_Bool b)439 	inline void SetTest7( sal_Bool b )	{ bTest7 = b; }
IsTest8() const440 	inline sal_Bool IsTest8() const		{ return bTest8; }
SetTest8(sal_Bool b)441 	inline void SetTest8( sal_Bool b )	{ bTest8 = b; }
IsTest9()442 	static inline sal_Bool IsTest9()			{ return bTest9; }
SetTest9(sal_Bool b)443 	static inline void SetTest9( sal_Bool b )	{ bTest9 = b; }
IsTest10() const444 	inline sal_Bool IsTest10() const	{ return bTest10; }
SetTest10(sal_Bool b)445 	inline void SetTest10( sal_Bool b )	{ bTest10 = b; }
446 #endif
447 
GetZoom() const448 	inline sal_uInt16 GetZoom() const	 { return nZoom; }
SetZoom(sal_uInt16 n)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;
operator !=(const SwViewOption & rOpt) const458     inline sal_Bool operator != ( const SwViewOption &rOpt ) const  { return !(*this == rOpt); }
459 
460 
461 /*---------------------------------------------------------------------------
462 	Optionen aus nUIOptions
463 ----------------------------------------------------------------------------*/
464 
IsViewVScrollBar() const465     sal_Bool    IsViewVScrollBar() const
466 		{ return nUIOptions & VIEWOPT_2_VSCROLLBAR ? sal_True : sal_False;	  }
IsViewHScrollBar() const467 	sal_Bool 	IsViewHScrollBar() const
468 		{ return nUIOptions & VIEWOPT_2_HSCROLLBAR ? sal_True : sal_False;	  }
IsKeepRatio() const469     sal_Bool    IsKeepRatio()      const
470 		{ return nUIOptions & VIEWOPT_2_KEEPASPECTRATIO ? sal_True : sal_False;	  }
IsGrfKeepZoom() const471 	sal_Bool 	IsGrfKeepZoom()	   const
472 		{ return nUIOptions & VIEWOPT_2_GRFKEEPZOOM ? sal_True : sal_False;	  }
IsShowContentTips() const473     sal_Bool    IsShowContentTips() const
474         { return nUIOptions & VIEWOPT_2_CONTENT_TIPS ? sal_True : sal_False; }
IsPrtFormat() const475 	sal_Bool 	IsPrtFormat() const
476 		{ return nUIOptions & VIEWOPT_2_PRTFORMAT ? sal_True : sal_False; }
IsShowScrollBarTips() const477     sal_Bool    IsShowScrollBarTips() const
478         { return nUIOptions & VIEWOPT_2_SCROLLBAR_TIPS ? sal_True : sal_False; }
479 
GetZoomType() const480     SvxZoomType    GetZoomType()      const { return eZoom; }
481 
GetTblDest() const482 	sal_uInt8	GetTblDest() const 	  { return nTblDest; }
483 
SetViewVScrollBar(sal_Bool b)484 	void   SetViewVScrollBar(sal_Bool b)
485 		{ b ? (nUIOptions |= VIEWOPT_2_VSCROLLBAR ) : ( nUIOptions &= ~VIEWOPT_2_VSCROLLBAR); }
SetViewHScrollBar(sal_Bool b)486 	void   SetViewHScrollBar(sal_Bool b)
487 		{ b ? (nUIOptions |= VIEWOPT_2_HSCROLLBAR ) : ( nUIOptions &= ~VIEWOPT_2_HSCROLLBAR); }
SetKeepRatio(sal_Bool b)488 	void   SetKeepRatio		(sal_Bool b)
489 		{ b ? (nUIOptions |= VIEWOPT_2_KEEPASPECTRATIO ) : ( nUIOptions &= ~VIEWOPT_2_KEEPASPECTRATIO); }
SetGrfKeepZoom(sal_Bool b)490 	void   SetGrfKeepZoom	(sal_Bool b)
491 		{ b ? (nUIOptions |= VIEWOPT_2_GRFKEEPZOOM ) : ( nUIOptions &= ~VIEWOPT_2_GRFKEEPZOOM); }
SetShowContentTips(sal_Bool b)492     void SetShowContentTips( sal_Bool b)
493         { b ? (nUIOptions |= VIEWOPT_2_CONTENT_TIPS) : (nUIOptions &= ~VIEWOPT_2_CONTENT_TIPS); }
SetPrtFormat(sal_Bool b)494     void SetPrtFormat( sal_Bool b)
495         { b ? (nUIOptions |= VIEWOPT_2_PRTFORMAT) : (nUIOptions &= ~VIEWOPT_2_PRTFORMAT); }
SetShowScrollBarTips(sal_Bool b)496     void SetShowScrollBarTips( sal_Bool b)
497         { b ? (nUIOptions |= VIEWOPT_2_SCROLLBAR_TIPS) : (nUIOptions &= ~VIEWOPT_2_SCROLLBAR_TIPS); }
498 
SetZoomType(SvxZoomType eZoom_)499     void            SetZoomType     (SvxZoomType eZoom_){ eZoom = eZoom_;  }
SetTblDest(sal_uInt8 nNew)500 	void   			SetTblDest( sal_uInt8 nNew )  	{ nTblDest = nNew;  }
501 
GetSymbolFont() const502 	const String&	GetSymbolFont() const {return sSymbolFont;}
SetSymbolFont(const String & sSet)503 	void 			SetSymbolFont(const String& sSet) {sSymbolFont = sSet;}
504 
GetRetoucheColor() const505 	const Color& 	GetRetoucheColor() const 		{ return aRetoucheColor;}
SetRetoucheColor(const Color & r)506 	void 			SetRetoucheColor(const Color&r) { aRetoucheColor = r;	}
507 
IsViewAnyRuler() const508     sal_Bool            IsViewAnyRuler() const {return 0 != (nUIOptions & VIEWOPT_2_ANY_RULER);}
SetViewAnyRuler(sal_Bool bSet)509     void            SetViewAnyRuler(sal_Bool bSet)
510                         { bSet ? (nUIOptions |= VIEWOPT_2_ANY_RULER) : (nUIOptions &= ~VIEWOPT_2_ANY_RULER);}
511 
IsViewHRuler(sal_Bool bDirect=sal_False) const512     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                         }
SetViewHRuler(sal_Bool b)522     void            SetViewHRuler   (sal_Bool b)
523                         {    b ? (nUIOptions |= VIEWOPT_2_H_RULER ) : ( nUIOptions &= ~VIEWOPT_2_H_RULER);}
524 
IsViewVRuler(sal_Bool bDirect=sal_False) const525     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                         }
SetViewVRuler(sal_Bool b)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
IsShadowCursor() const539 	sal_Bool 	IsShadowCursor()    const
540 		{ return nUIOptions & VIEWOPT_2_SHADOWCRSR ? sal_True : sal_False;   }
SetShadowCursor(sal_Bool b)541 	void   SetShadowCursor(sal_Bool b)
542 		{ b ? (nUIOptions |= VIEWOPT_2_SHADOWCRSR ) : ( nUIOptions &= ~VIEWOPT_2_SHADOWCRSR); }
543 
544     //move vertical ruler to the right
IsVRulerRight() const545     sal_Bool    IsVRulerRight()    const
546         { return nUIOptions & VIEWOPT_2_V_RULER_RIGHT ? sal_True : sal_False;   }
SetVRulerRight(sal_Bool b)547     void   SetVRulerRight(sal_Bool b)
548         { b ? (nUIOptions |= VIEWOPT_2_V_RULER_RIGHT ) : ( nUIOptions &= ~VIEWOPT_2_V_RULER_RIGHT); }
549 
IsStarOneSetting() const550 	sal_Bool			IsStarOneSetting() const {return bStarOneSetting; }
SetStarOneSetting(sal_Bool bSet)551 	void			SetStarOneSetting(sal_Bool bSet) {bStarOneSetting = bSet; }
552 
IsPagePreview() const553     sal_Bool            IsPagePreview() const {return bIsPagePreview; }
SetPagePreview(sal_Bool bSet)554     void            SetPagePreview(sal_Bool bSet) { bIsPagePreview= bSet; }
555 
GetShdwCrsrFillMode() const556 	sal_uInt8 			GetShdwCrsrFillMode() const { return nShdwCrsrFillMode; }
SetShdwCrsrFillMode(sal_uInt8 nMode)557 	void 			SetShdwCrsrFillMode( sal_uInt8 nMode ) { nShdwCrsrFillMode = nMode; };
558 
IsShowPlaceHolderFields() const559     sal_Bool        IsShowPlaceHolderFields() const { return bShowPlaceHolderFields; }
SetShowPlaceHolderFields(sal_Bool bSet)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 
IsDocBoundaries()581     static sal_Bool     IsDocBoundaries()   {return IsAppearanceFlag(VIEWOPT_DOC_BOUNDARIES);}
IsObjectBoundaries()582     static sal_Bool     IsObjectBoundaries(){return IsAppearanceFlag(VIEWOPT_OBJECT_BOUNDARIES);}
IsTableBoundaries()583     static sal_Bool     IsTableBoundaries() {return IsAppearanceFlag(VIEWOPT_TABLE_BOUNDARIES );}
IsIndexShadings()584     static sal_Bool     IsIndexShadings()   {return IsAppearanceFlag(VIEWOPT_INDEX_SHADINGS   );}
IsLinks()585     static sal_Bool     IsLinks()           {return IsAppearanceFlag(VIEWOPT_LINKS            );}
IsVisitedLinks()586     static sal_Bool     IsVisitedLinks()    {return IsAppearanceFlag(VIEWOPT_VISITED_LINKS    );}
IsFieldShadings()587     static sal_Bool     IsFieldShadings()   {return IsAppearanceFlag(VIEWOPT_FIELD_SHADINGS);}
IsSectionBoundaries()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 
SetDocBoundaries(sal_Bool bSet)592     void    SetDocBoundaries(sal_Bool bSet)   {SetAppearanceFlag(VIEWOPT_DOC_BOUNDARIES, bSet);}
593 
594     static void     ApplyColorConfigValues(const svtools::ColorConfig& rConfig);
595 };
596 
597 
operator ==(const SwViewOption & rOpt) const598 inline sal_Bool SwViewOption::operator==( const SwViewOption &rOpt ) const
599 {
600 	return IsEqualFlags( rOpt ) && nZoom == rOpt.GetZoom();
601 }
602 
SetUIOptions(const SwViewOption & rVOpt)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