1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SW_INC_VIEWOPT_HXX
21 #define INCLUDED_SW_INC_VIEWOPT_HXX
23 #include <config_feature_desktop.h>
25 #include <tools/gen.hxx>
26 #include <tools/color.hxx>
28 #include <sfx2/zoomitem.hxx>
32 namespace vcl
{ class Window
; }
35 namespace svtools
{ class ColorConfig
;}
37 enum class ViewOptFlags1
{
38 UseHeaderFooterMenu
= 0x00000001,
41 HardBlank
= 0x00000008,
42 Paragraph
= 0x00000010,
43 Linebreak
= 0x00000020,
44 Pagebreak
= 0x00000040,
45 Columnbreak
= 0x00000080,
46 SoftHyph
= 0x00000100,
48 FieldName
= 0x00000800,
50 FieldHidden
= 0x00008000,
51 CharHidden
= 0x00010000,
56 Crosshair
= 0x00400000,
58 Synchronize
= 0x01000000,
59 GridVisible
= 0x02000000,
60 OnlineSpell
= 0x04000000,
61 ShowInlineTooltips
= 0x10000000, //tooltips on tracked changes
62 ViewMetachars
= 0x20000000,
66 template<> struct typed_flags
<ViewOptFlags1
> : is_typed_flags
<ViewOptFlags1
, 0x77dfcdff> {};
69 enum class ViewOptCoreFlags2
{
72 SmoothScroll
= 0x0004,
73 CursorInProt
= 0x0008,
78 template<> struct typed_flags
<ViewOptCoreFlags2
> : is_typed_flags
<ViewOptCoreFlags2
, 0x007f> {};
81 enum class ViewOptFlags2
{
83 VScrollbar
= 0x00000800,
84 HScrollbar
= 0x00001000,
86 AnyRuler
= 0x00008000,
87 Modified
= 0x00010000,
88 KeepAspectRatio
= 0x00020000,
89 GrfKeepZoom
= 0x00040000,
90 ContentTips
= 0x00100000,
91 ScrollbarTips
= 0x00400000,
92 PrintFormat
= 0x00800000,
93 ShadowCursor
= 0x01000000,
94 VRulerRight
= 0x02000000,
95 ResolvedPostits
= 0x04000000,
98 template<> struct typed_flags
<ViewOptFlags2
> : is_typed_flags
<ViewOptFlags2
, 0x07d7dc00> {};
102 #define TBL_DEST_CELL 0
103 #define TBL_DEST_ROW 1
104 #define TBL_DEST_TBL 2
107 enum class ViewOptFlags
{
109 DocBoundaries
= 0x0001,
110 ObjectBoundaries
= 0x0002,
111 TableBoundaries
= 0x0004,
112 IndexShadings
= 0x0008,
114 VisitedLinks
= 0x0020,
115 FieldShadings
= 0x0040,
116 SectionBoundaries
= 0x0080,
120 template<> struct typed_flags
<ViewOptFlags
> : is_typed_flags
<ViewOptFlags
, 0x01ff> {};
123 class SW_DLLPUBLIC SwViewOption
125 static Color s_aDocColor
; // color of document boundaries
126 static Color s_aDocBoundColor
; // color of document boundaries
127 static Color s_aObjectBoundColor
; // color of object boundaries
128 static Color s_aAppBackgroundColor
; // application background
129 static Color s_aTableBoundColor
; // color of table boundaries
130 static Color s_aFontColor
;
131 static Color s_aIndexShadingsColor
; // background color of indexes
132 static Color s_aLinksColor
;
133 static Color s_aVisitedLinksColor
;
134 static Color s_aDirectCursorColor
;
135 static Color s_aTextGridColor
;
136 static Color s_aSpellColor
; // mark color of online spell checking
137 static Color s_aSmarttagColor
;
138 static Color s_aFieldShadingsColor
;
139 static Color s_aSectionBoundColor
;
140 static Color s_aPageBreakColor
;
141 static Color s_aScriptIndicatorColor
;
142 static Color s_aShadowColor
;
143 static Color s_aHeaderFooterMarkColor
;
145 static ViewOptFlags s_nAppearanceFlags
;
146 static sal_uInt16 s_nPixelTwips
;// 1 Pixel == ? Twips
148 OUString m_sSymbolFont
; // Symbolfont.
149 ViewOptFlags1 m_nCoreOptions
; // Bits for SwViewShell.
150 ViewOptCoreFlags2 m_nCore2Options
; // Bits for SwViewShell.
151 ViewOptFlags2 m_nUIOptions
; // UI-Bits
152 Color m_aRetouchColor
; // DefaultBackground for BrowseView
153 Size m_aSnapSize
; // Describes horizontal and vertical snap.
154 sal_uInt16 mnViewLayoutColumns
; // # columns for edit view
155 short m_nDivisionX
; // Grid division.
157 sal_uInt8 m_nPagePreviewRow
; // Page Preview Row/Columns.
158 sal_uInt8 m_nPagePreviewCol
; // Page Preview Row/Columns.
159 sal_uInt8 m_nShadowCursorFillMode
; // FillMode for ShadowCursor.
160 bool m_bReadonly
: 1; // Readonly-Doc.
161 bool m_bStarOneSetting
: 1;// Prevent from UI automatics (no scrollbars in readonly documents).
162 bool m_bIsPagePreview
: 1; // The preview mustn't print field/footnote/... shadings.
163 bool m_bSelectionInReadonly
: 1; // Determines whether selection is switched on in readonly documents.
165 bool mbBrowseMode
: 1;
166 bool mbBookView
: 1; // View mode for page preview.
167 bool mbViewLayoutBookMode
: 1; // Book view mode for edit view.
168 bool mbHideWhitespaceMode
: 1; // Hide header, footer, and pagebreak.
169 bool m_bShowPlaceHolderFields
: 1; // Only used in printing!
170 mutable bool m_bIdle
;
173 sal_uInt16 m_nZoom
; // In percent.
174 SvxZoomType m_eZoom
; // 'enum' for zoom.
176 sal_uInt8 m_nTableDestination
; // Destination for table background.
179 // Corresponds to statements in ui/config/cfgvw.src.
180 bool m_bTest1
:1; // Test-flag "Layout not loading"
181 bool m_bTest2
:1; // Test-flag "WYSIWYG++"
182 bool m_bTest3
:1; // Test-flag ""
183 bool m_bTest4
:1; // Test-flag "WYSIWYG debug"
184 bool m_bTest5
:1; // Test-flag "No idle format"
185 bool m_bTest6
:1; // Test-flag "No screen adj"
186 bool m_bTest7
:1; // Test-flag "win format"
187 bool m_bTest8
:1; // Test-flag ""
188 bool m_bTest10
:1; // Test-Flag "Format by Input"
192 SwViewOption(); // CTOR
193 SwViewOption(const SwViewOption
&);
196 static void Init( vcl::Window
const *pWin
); // Initializing of static data.
198 ViewOptFlags1
GetCoreOptions() const {return m_nCoreOptions
;}
199 inline void SetUIOptions( const SwViewOption
& );
201 // Options from nCoreOptions
205 // Logically this is a const function since it does not modify the viewoptions
206 // but only effects idle formatting. Of course that member is already implement
207 // in the wrong place here... Also currently there are many const modifying casts in the code
208 // just to call this function on otherwise const objects. Thus declaring it as const now.
209 void SetIdle( bool b
) const
212 bool IsTab(bool bHard
= false) const
213 { return !m_bReadonly
&& (m_nCoreOptions
& ViewOptFlags1::Tab
) &&
214 ((m_nCoreOptions
& ViewOptFlags1::ViewMetachars
)||bHard
); }
215 void SetTab( bool b
)
216 { SetCoreOption(b
, ViewOptFlags1::Tab
); }
218 bool IsBlank(bool bHard
= false) const
219 { return !m_bReadonly
&& (m_nCoreOptions
& ViewOptFlags1::Blank
) &&
220 ((m_nCoreOptions
& ViewOptFlags1::ViewMetachars
)||bHard
); }
221 void SetBlank( bool b
)
222 { SetCoreOption(b
, ViewOptFlags1::Blank
); }
224 bool IsHardBlank() const
225 { return !m_bReadonly
&& (m_nCoreOptions
& ViewOptFlags1::HardBlank
); }
226 void SetHardBlank( bool b
)
227 { SetCoreOption(b
, ViewOptFlags1::HardBlank
); }
229 bool IsParagraph(bool bHard
= false) const
230 { return !m_bReadonly
&& (m_nCoreOptions
& ViewOptFlags1::Paragraph
) &&
231 ((m_nCoreOptions
& ViewOptFlags1::ViewMetachars
)||bHard
); }
232 void SetParagraph( bool b
)
233 { SetCoreOption(b
, ViewOptFlags1::Paragraph
); }
235 bool IsLineBreak(bool bHard
= false) const
236 { return !m_bReadonly
&& (m_nCoreOptions
& ViewOptFlags1::Linebreak
) &&
237 ((m_nCoreOptions
& ViewOptFlags1::ViewMetachars
)||bHard
); }
238 void SetLineBreak( bool b
)
239 { SetCoreOption(b
, ViewOptFlags1::Linebreak
); }
241 void SetPageBreak( bool b
)
242 { SetCoreOption(b
, ViewOptFlags1::Pagebreak
); }
244 void SetColumnBreak( bool b
)
245 { SetCoreOption(b
, ViewOptFlags1::Columnbreak
); }
247 bool IsSoftHyph() const
248 { return !m_bReadonly
&& (m_nCoreOptions
& ViewOptFlags1::SoftHyph
); }
249 void SetSoftHyph( bool b
)
250 { SetCoreOption(b
, ViewOptFlags1::SoftHyph
); }
252 bool IsFieldName() const { return !m_bReadonly
&& (m_nCoreOptions
& ViewOptFlags1::FieldName
); }
253 void SetFieldName( bool b
)
254 { SetCoreOption(b
, ViewOptFlags1::FieldName
); }
256 bool IsPostIts() const
257 { return bool(m_nCoreOptions
& ViewOptFlags1::Postits
); }
258 void SetPostIts( bool b
)
259 { SetCoreOption(b
, ViewOptFlags1::Postits
); }
261 bool IsResolvedPostIts() const
262 { return bool(m_nUIOptions
& ViewOptFlags2::ResolvedPostits
); }
263 void SetResolvedPostIts( bool b
)
264 { SetUIOption(b
, ViewOptFlags2::ResolvedPostits
); }
266 static void PaintPostIts( OutputDevice
*pOut
, const SwRect
&rRect
,
268 static sal_uInt16
GetPostItsWidth( const OutputDevice
*pOut
);
270 //show/hide tooltips on tracked changes
271 bool IsShowInlineTooltips() const
272 { return bool(m_nCoreOptions
& ViewOptFlags1::ShowInlineTooltips
); }
273 void SetShowInlineTooltips( bool b
)
274 { SetCoreOption(b
, ViewOptFlags1::ShowInlineTooltips
); }
276 //show/hide interactive header/footer on top/bottom of pages
277 bool IsUseHeaderFooterMenu() const
278 { return bool(m_nCoreOptions
& ViewOptFlags1::UseHeaderFooterMenu
); }
279 void SetUseHeaderFooterMenu( bool b
)
280 { SetCoreOption(b
, ViewOptFlags1::UseHeaderFooterMenu
); }
282 bool IsShowHiddenChar(bool bHard
= false) const
283 { return !m_bReadonly
&& (m_nCoreOptions
& ViewOptFlags1::CharHidden
) &&
284 ((m_nCoreOptions
& ViewOptFlags1::ViewMetachars
)||bHard
); }
286 void SetShowHiddenChar( bool b
)
287 { SetCoreOption(b
, ViewOptFlags1::CharHidden
); }
289 bool IsShowHiddenField() const
290 { return !m_bReadonly
&& (m_nCoreOptions
& ViewOptFlags1::FieldHidden
); }
291 void SetShowHiddenField( bool b
)
292 { SetCoreOption(b
, ViewOptFlags1::FieldHidden
); }
294 bool IsGraphic() const
295 { return bool(m_nCoreOptions
& ViewOptFlags1::Graphic
); }
296 void SetGraphic( bool b
)
297 { SetCoreOption(b
, ViewOptFlags1::Graphic
); }
299 bool IsPageBack() const
300 { return bool(m_nCoreOptions
& ViewOptFlags1::Pageback
); }
301 void SetPageBack( bool b
)
302 { SetCoreOption(b
, ViewOptFlags1::Pageback
); }
305 { return bool(m_nCoreOptions
& ViewOptFlags1::Table
); }
306 void SetTable( bool b
)
307 { SetCoreOption(b
, ViewOptFlags1::Table
); }
310 { return bool(m_nCoreOptions
& ViewOptFlags1::Draw
); }
311 void SetDraw( bool b
)
312 { SetCoreOption(b
, ViewOptFlags1::Draw
); }
314 bool IsControl() const
315 { return bool(m_nCoreOptions
& ViewOptFlags1::Control
); }
316 void SetControl( bool b
)
317 { SetCoreOption(b
, ViewOptFlags1::Control
); }
320 { return bool(m_nCoreOptions
& ViewOptFlags1::Snap
); }
321 void SetSnap( bool b
)
322 { SetCoreOption(b
, ViewOptFlags1::Snap
); }
324 void SetSnapSize( Size
const &rSz
){ m_aSnapSize
= rSz
; }
325 const Size
&GetSnapSize() const { return m_aSnapSize
; }
327 bool IsGridVisible() const
328 { return !m_bReadonly
&& (m_nCoreOptions
& ViewOptFlags1::GridVisible
); }
329 void SetGridVisible( bool b
)
330 { SetCoreOption(b
, ViewOptFlags1::GridVisible
); }
332 bool IsOnlineSpell() const
333 { return !m_bReadonly
&& (m_nCoreOptions
& ViewOptFlags1::OnlineSpell
); }
334 void SetOnlineSpell( bool b
);
336 bool IsViewMetaChars() const
337 { return !m_bReadonly
&& (m_nCoreOptions
& ViewOptFlags1::ViewMetachars
); }
338 void SetViewMetaChars( bool b
)
339 { SetCoreOption(b
, ViewOptFlags1::ViewMetachars
); }
341 bool IsSynchronize() const
342 { return bool(m_nCoreOptions
& ViewOptFlags1::Synchronize
); }
343 void SetSynchronize( bool b
)
344 { SetCoreOption(b
, ViewOptFlags1::Synchronize
); }
346 bool IsCrossHair() const
347 { return bool(m_nCoreOptions
& ViewOptFlags1::Crosshair
); }
348 void SetCrossHair( bool b
)
349 { SetCoreOption(b
, ViewOptFlags1::Crosshair
); }
351 // Options from nCore2Options
352 bool IsBlackFont() const
353 {return bool(m_nCore2Options
& ViewOptCoreFlags2::BlackFont
); }
355 void SetBlackFont(bool b
)
356 { SetCore2Option(b
, ViewOptCoreFlags2::BlackFont
); }
358 bool IsShowHiddenPara() const
359 {return bool(m_nCore2Options
& ViewOptCoreFlags2::HiddenPara
); }
361 void SetShowHiddenPara(bool b
)
362 { SetCore2Option(b
, ViewOptCoreFlags2::HiddenPara
); }
364 bool IsSmoothScroll() const
365 {return bool(m_nCore2Options
& ViewOptCoreFlags2::SmoothScroll
); }
367 void SetSmoothScroll(bool b
)
368 { SetCore2Option(b
, ViewOptCoreFlags2::SmoothScroll
); }
370 bool IsCursorInProtectedArea() const
371 {return bool(m_nCore2Options
& ViewOptCoreFlags2::CursorInProt
); }
373 void SetCursorInProtectedArea(bool b
)
374 { SetCore2Option(b
, ViewOptCoreFlags2::CursorInProt
); }
376 static bool IsIgnoreProtectedArea();
378 bool IsPDFExport() const
379 {return bool(m_nCore2Options
& ViewOptCoreFlags2::PdfExport
); }
381 void SetPDFExport(bool b
)
382 { SetCore2Option(b
, ViewOptCoreFlags2::PdfExport
); }
384 bool IsPrinting() const
385 {return bool(m_nCore2Options
& ViewOptCoreFlags2::Printing
); }
387 void SetPrinting(bool b
)
388 { SetCore2Option(b
, ViewOptCoreFlags2::Printing
); }
390 void SetCore2Option(bool b
, ViewOptCoreFlags2 f
)
393 m_nCore2Options
|= f
;
395 m_nCore2Options
&= ~f
;
397 void SetCoreOption(bool b
, ViewOptFlags1 f
)
402 m_nCoreOptions
&= ~f
;
405 short GetDivisionX() const { return m_nDivisionX
; }
406 void SetDivisionX( short n
){ m_nDivisionX
= n
; }
407 short GetDivisionY() const { return m_nDivisionY
; }
408 void SetDivisionY( short n
){ m_nDivisionY
= n
; }
410 // Default margin left and above document: 284 twips == 5.0 mm.
411 static constexpr sal_uInt16 defDocumentBorder
= 284;
412 // Default gap between pages: 284 twips == 5.0 mm.
413 static constexpr sal_uInt16 defGapBetweenPages
= 284;
414 // Minimum edge-to-text distance: 22 twips == 0.4 mm.
415 static constexpr sal_uInt16 minGapBetweenPages
= 22;
417 sal_uInt16
GetDocumentBorder() const { return IsWhitespaceHidden() ? minGapBetweenPages
: defDocumentBorder
; }
418 sal_uInt16
GetGapBetweenPages() const { return IsWhitespaceHidden() ? minGapBetweenPages
: defGapBetweenPages
; }
420 sal_uInt8
GetPagePrevRow() const { return m_nPagePreviewRow
; }
421 void SetPagePrevRow( sal_uInt8 n
) { m_nPagePreviewRow
= n
; }
422 sal_uInt8
GetPagePrevCol() const { return m_nPagePreviewCol
; }
423 void SetPagePrevCol( sal_uInt8 n
) { m_nPagePreviewCol
= n
; }
424 bool IsReadonly() const { return m_bReadonly
; }
425 void SetReadonly(bool bSet
) { m_bReadonly
= bSet
; }
427 bool IsSelectionInReadonly() const {return m_bSelectionInReadonly
;}
428 void SetSelectionInReadonly(bool bSet
) {m_bSelectionInReadonly
= bSet
;}
430 bool IsFormView() const { return mbFormView
; }
431 void SetFormView( bool bSet
) { mbFormView
= bSet
; }
433 bool getBrowseMode() const { return mbBrowseMode
; }
434 void setBrowseMode(bool bSet
) { mbBrowseMode
= bSet
; }
435 bool IsPagePrevBookview() const { return mbBookView
; }
436 void SetPagePrevBookview(bool bSet
) { mbBookView
= bSet
; }
438 static bool IsAutoCompleteWords();
440 bool IsViewLayoutBookMode() const { return mbViewLayoutBookMode
; }
441 void SetViewLayoutBookMode( bool bNew
) { mbViewLayoutBookMode
= bNew
; }
442 sal_uInt16
GetViewLayoutColumns() const { return mnViewLayoutColumns
; }
443 void SetViewLayoutColumns( sal_uInt16 nNew
) { mnViewLayoutColumns
= nNew
; }
444 bool IsHideWhitespaceMode() const { return mbHideWhitespaceMode
; }
445 void SetHideWhitespaceMode( bool bMode
) { mbHideWhitespaceMode
= bMode
; }
447 /// The rules that allow for hiding whitespace.
448 bool CanHideWhitespace() const { return !IsMultipageView(); }
449 bool IsWhitespaceHidden() const { return IsHideWhitespaceMode() && !IsMultipageView(); }
450 bool IsMultipageView() const { return IsViewLayoutBookMode() ||
451 GetViewLayoutColumns() == 0; }
454 // Correspond to statements in ui/config/cfgvw.src.
455 bool IsTest1() const { return m_bTest1
; }
456 bool IsTest2() const { return m_bTest2
; }
457 bool IsTest3() const { return m_bTest3
; }
458 bool IsTest4() const { return m_bTest4
; }
459 bool IsTest5() const { return m_bTest5
; }
460 bool IsTest6() const { return m_bTest6
; }
461 bool IsTest7() const { return m_bTest7
; }
462 bool IsTest8() const { return m_bTest8
; }
463 bool IsTest10() const { return m_bTest10
; }
466 sal_uInt16
GetZoom() const { return m_nZoom
; }
467 void SetZoom( sal_uInt16 n
){ m_nZoom
= n
; }
469 static void DrawRect( OutputDevice
* pOut
, const SwRect
&rRect
, ::Color nCol
);
470 static void DrawRectPrinter( OutputDevice
* pOut
, const SwRect
& rRect
);
472 SwViewOption
& operator=( const SwViewOption
&rOpt
);
475 bool IsEqualFlags ( const SwViewOption
&rOpt
) const;
476 inline bool operator == ( const SwViewOption
&rOpt
) const;
477 bool operator != ( const SwViewOption
&rOpt
) const { return !(*this == rOpt
); }
479 // Options from nUIOptions
480 bool IsViewVScrollBar() const
482 #if HAVE_FEATURE_DESKTOP
483 return bool(m_nUIOptions
& ViewOptFlags2::VScrollbar
);
488 bool IsViewHScrollBar() const
490 #if HAVE_FEATURE_DESKTOP
491 return bool(m_nUIOptions
& ViewOptFlags2::HScrollbar
);
496 bool IsKeepRatio() const
497 { return bool(m_nUIOptions
& ViewOptFlags2::KeepAspectRatio
); }
498 bool IsGrfKeepZoom() const
499 { return bool(m_nUIOptions
& ViewOptFlags2::GrfKeepZoom
); }
500 bool IsShowContentTips() const
501 { return bool(m_nUIOptions
& ViewOptFlags2::ContentTips
); }
502 bool IsPrtFormat() const
503 { return bool(m_nUIOptions
& ViewOptFlags2::PrintFormat
); }
504 bool IsShowScrollBarTips() const
505 { return bool(m_nUIOptions
& ViewOptFlags2::ScrollbarTips
); }
507 SvxZoomType
GetZoomType() const { return m_eZoom
; }
509 sal_uInt8
GetTableDest() const { return m_nTableDestination
; }
511 void SetViewVScrollBar(bool b
)
512 { SetUIOption(b
, ViewOptFlags2::VScrollbar
); }
513 void SetViewHScrollBar(bool b
)
514 { SetUIOption(b
, ViewOptFlags2::HScrollbar
); }
515 void SetKeepRatio (bool b
)
516 { SetUIOption(b
, ViewOptFlags2::KeepAspectRatio
); }
517 void SetGrfKeepZoom (bool b
)
518 { SetUIOption(b
, ViewOptFlags2::GrfKeepZoom
); }
519 void SetShowContentTips( bool b
)
520 { SetUIOption(b
, ViewOptFlags2::ContentTips
); }
521 void SetPrtFormat( bool b
)
522 { SetUIOption(b
, ViewOptFlags2::PrintFormat
); }
523 void SetShowScrollBarTips( bool b
)
524 { SetUIOption(b
, ViewOptFlags2::ScrollbarTips
); }
525 void SetUIOption( bool b
, ViewOptFlags2 f
)
533 void SetZoomType (SvxZoomType eZoom_
){ m_eZoom
= eZoom_
; }
534 void SetTableDest( sal_uInt8 nNew
) { m_nTableDestination
= nNew
; }
536 const OUString
& GetSymbolFont() const {return m_sSymbolFont
;}
537 void SetSymbolFont(const OUString
& sSet
) {m_sSymbolFont
= sSet
;}
539 const Color
& GetRetoucheColor() const { return m_aRetouchColor
;}
540 void SetRetoucheColor(const Color
&r
) { m_aRetouchColor
= r
; }
542 bool IsViewAnyRuler() const
544 #if HAVE_FEATURE_DESKTOP
545 return bool(m_nUIOptions
& ViewOptFlags2::AnyRuler
);
550 void SetViewAnyRuler(bool bSet
)
551 { SetUIOption(bSet
, ViewOptFlags2::AnyRuler
);}
553 bool IsViewHRuler(bool bDirect
= false) const
555 #if HAVE_FEATURE_DESKTOP
557 ? bool(m_nUIOptions
& ViewOptFlags2::HRuler
)
558 : !m_bReadonly
&& (m_nUIOptions
& (ViewOptFlags2::AnyRuler
|ViewOptFlags2::HRuler
)) == (ViewOptFlags2::AnyRuler
|ViewOptFlags2::HRuler
);
564 void SetViewHRuler (bool b
)
565 { SetUIOption(b
, ViewOptFlags2::HRuler
); }
567 bool IsViewVRuler(bool bDirect
= false) const
569 #if HAVE_FEATURE_DESKTOP
571 ? bool(m_nUIOptions
& ViewOptFlags2::VRuler
)
572 : !m_bReadonly
&& (m_nUIOptions
& (ViewOptFlags2::AnyRuler
|ViewOptFlags2::VRuler
)) == (ViewOptFlags2::AnyRuler
|ViewOptFlags2::VRuler
);
578 void SetViewVRuler (bool b
)
579 { SetUIOption(b
, ViewOptFlags2::VRuler
); }
581 // ShadowCursor, switch on/off, get/set color/mode.
582 bool IsShadowCursor() const
583 { return bool(m_nUIOptions
& ViewOptFlags2::ShadowCursor
); }
584 void SetShadowCursor(bool b
)
585 { SetUIOption(b
, ViewOptFlags2::ShadowCursor
); }
587 //move vertical ruler to the right
588 bool IsVRulerRight() const
589 { return bool(m_nUIOptions
& ViewOptFlags2::VRulerRight
); }
590 void SetVRulerRight(bool b
)
591 { SetUIOption(b
, ViewOptFlags2::VRulerRight
); }
593 bool IsStarOneSetting() const {return m_bStarOneSetting
; }
594 void SetStarOneSetting(bool bSet
) {m_bStarOneSetting
= bSet
; }
596 bool IsPagePreview() const {return m_bIsPagePreview
; }
597 void SetPagePreview(bool bSet
) { m_bIsPagePreview
= bSet
; }
599 sal_uInt8
GetShdwCursorFillMode() const { return m_nShadowCursorFillMode
; }
600 void SetShdwCursorFillMode( sal_uInt8 nMode
) { m_nShadowCursorFillMode
= nMode
; };
602 bool IsShowPlaceHolderFields() const { return m_bShowPlaceHolderFields
; }
603 void SetShowPlaceHolderFields(bool bSet
) { m_bShowPlaceHolderFields
= bSet
; }
605 static Color
& GetDocColor();
606 static Color
& GetDocBoundariesColor();
607 static Color
& GetAppBackgroundColor();
608 static Color
& GetObjectBoundariesColor();
609 static Color
& GetTableBoundariesColor();
610 static Color
& GetIndexShadingsColor();
611 static Color
& GetLinksColor();
612 static Color
& GetVisitedLinksColor();
613 static Color
& GetDirectCursorColor();
614 static Color
& GetTextGridColor();
615 static Color
& GetSpellColor();
616 static Color
& GetSmarttagColor();
617 static Color
& GetShadowColor();
618 static Color
& GetFontColor();
619 static Color
& GetFieldShadingsColor();
620 static Color
& GetSectionBoundColor();
621 static Color
& GetPageBreakColor();
622 static Color
& GetHeaderFooterMarkColor();
624 static bool IsAppearanceFlag(ViewOptFlags nFlag
);
626 static bool IsDocBoundaries() {return IsAppearanceFlag(ViewOptFlags::DocBoundaries
);}
627 static bool IsObjectBoundaries() {return IsAppearanceFlag(ViewOptFlags::ObjectBoundaries
);}
628 static bool IsTableBoundaries() {return IsAppearanceFlag(ViewOptFlags::TableBoundaries
);}
629 static bool IsIndexShadings() {return IsAppearanceFlag(ViewOptFlags::IndexShadings
);}
630 static bool IsLinks() {return IsAppearanceFlag(ViewOptFlags::Links
);}
631 static bool IsVisitedLinks() {return IsAppearanceFlag(ViewOptFlags::VisitedLinks
);}
632 static bool IsFieldShadings() {return IsAppearanceFlag(ViewOptFlags::FieldShadings
);}
633 static bool IsSectionBoundaries() {return IsAppearanceFlag(ViewOptFlags::SectionBoundaries
);}
634 static bool IsShadow() {return IsAppearanceFlag(ViewOptFlags::Shadow
);}
636 static void SetAppearanceFlag(ViewOptFlags nFlag
, bool bSet
, bool bSaveInConfig
= false);
638 static void SetDocBoundaries(bool bSet
) {SetAppearanceFlag(ViewOptFlags::DocBoundaries
, bSet
);}
640 static void ApplyColorConfigValues(const svtools::ColorConfig
& rConfig
);
643 inline bool SwViewOption::operator==( const SwViewOption
&rOpt
) const
645 return IsEqualFlags( rOpt
) && m_nZoom
== rOpt
.GetZoom();
648 inline void SwViewOption::SetUIOptions( const SwViewOption
& rVOpt
)
650 m_nUIOptions
= rVOpt
.m_nUIOptions
;
651 m_nTableDestination
= rVOpt
.m_nTableDestination
;
652 m_nShadowCursorFillMode
= rVOpt
.m_nShadowCursorFillMode
;
655 // Helper function for checking HTML-capabilities.
656 SW_DLLPUBLIC sal_uInt16
GetHtmlMode(const SwDocShell
*);
660 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */