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