2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2013-04-05 00:15:06 +03:00
|
|
|
|
2013-11-05 02:17:53 +01:00
|
|
|
#ifndef INCLUDED_SW_INC_VIEWOPT_HXX
|
|
|
|
#define INCLUDED_SW_INC_VIEWOPT_HXX
|
2013-04-05 00:15:06 +03:00
|
|
|
|
|
|
|
#include <config_features.h>
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <tools/gen.hxx>
|
2004-01-06 17:13:42 +00:00
|
|
|
#include <tools/color.hxx>
|
2004-08-23 07:42:25 +00:00
|
|
|
|
2012-06-12 19:04:05 +02:00
|
|
|
#include <sfx2/zoomitem.hxx>
|
|
|
|
#include <svx/svxids.hrc>
|
2004-08-23 07:42:25 +00:00
|
|
|
#include "swdllapi.h"
|
2000-09-18 16:15:01 +00:00
|
|
|
#include "authratr.hxx"
|
|
|
|
|
|
|
|
class SwRect;
|
2014-09-23 11:20:40 +02:00
|
|
|
namespace vcl { class Window; }
|
2000-09-18 16:15:01 +00:00
|
|
|
class OutputDevice;
|
2013-10-26 19:50:13 +02:00
|
|
|
class SwViewShell;
|
2000-09-18 16:15:01 +00:00
|
|
|
class SwDocShell;
|
2003-03-27 14:45:43 +00:00
|
|
|
namespace svtools{ class ColorConfig;}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2016-05-13 13:56:17 +02:00
|
|
|
enum class ViewOptFlags1 {
|
|
|
|
Tab = 0x00000002,
|
|
|
|
Blank = 0x00000004,
|
|
|
|
HardBlank = 0x00000008,
|
|
|
|
Paragraph = 0x00000010,
|
|
|
|
Linebreak = 0x00000020,
|
|
|
|
Pagebreak = 0x00000040,
|
|
|
|
Columnbreak = 0x00000080,
|
|
|
|
SoftHyph = 0x00000100,
|
|
|
|
Ref = 0x00000400,
|
|
|
|
FieldName = 0x00000800,
|
|
|
|
Postits = 0x00004000,
|
|
|
|
FieldHidden = 0x00008000,
|
|
|
|
CharHidden = 0x00010000,
|
|
|
|
Graphic = 0x00020000,
|
|
|
|
Table = 0x00040000,
|
|
|
|
Draw = 0x00080000,
|
|
|
|
Control = 0x00100000,
|
|
|
|
Crosshair = 0x00400000,
|
|
|
|
Snap = 0x00800000,
|
|
|
|
Synchronize = 0x01000000,
|
|
|
|
GridVisible = 0x02000000,
|
|
|
|
OnlineSpell = 0x04000000,
|
|
|
|
ViewMetachars = 0x20000000,
|
|
|
|
Pageback = 0x40000000
|
|
|
|
};
|
|
|
|
namespace o3tl {
|
|
|
|
template<> struct typed_flags<ViewOptFlags1> : is_typed_flags<ViewOptFlags1, 0x67dfcdfe> {};
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2016-05-13 12:19:33 +02:00
|
|
|
enum class ViewOptCoreFlags2 {
|
|
|
|
BlackFont = 0x0001,
|
|
|
|
HiddenPara = 0x0002,
|
|
|
|
SmoothScroll = 0x0004,
|
|
|
|
CursorInProt = 0x0008,
|
|
|
|
PdfExport = 0x0010,
|
|
|
|
Printing = 0x0020,
|
|
|
|
};
|
|
|
|
namespace o3tl {
|
|
|
|
template<> struct typed_flags<ViewOptCoreFlags2> : is_typed_flags<ViewOptCoreFlags2, 0x007f> {};
|
|
|
|
};
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2016-05-13 12:07:34 +02:00
|
|
|
enum class ViewOptFlags2 {
|
|
|
|
HRuler = 0x00000400,
|
|
|
|
VScrollbar = 0x00000800,
|
|
|
|
HScrollbar = 0x00001000,
|
|
|
|
VRuler = 0x00004000,
|
|
|
|
AnyRuler = 0x00008000,
|
|
|
|
Modified = 0x00010000,
|
|
|
|
KeepAspectRatio = 0x00020000,
|
|
|
|
GrfKeepZoom = 0x00040000,
|
|
|
|
ContentTips = 0x00100000,
|
|
|
|
ScrollbarTips = 0x00400000,
|
|
|
|
PrintFormat = 0x00800000,
|
|
|
|
ShadowCursor = 0x01000000,
|
|
|
|
VRulerRight = 0x02000000
|
|
|
|
};
|
|
|
|
namespace o3tl {
|
|
|
|
template<> struct typed_flags<ViewOptFlags2> : is_typed_flags<ViewOptFlags2, 0x03d7dc00> {};
|
|
|
|
};
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-04-25 22:51:51 +02:00
|
|
|
// Table background.
|
2000-09-18 16:15:01 +00:00
|
|
|
#define TBL_DEST_CELL 0
|
|
|
|
#define TBL_DEST_ROW 1
|
|
|
|
#define TBL_DEST_TBL 2
|
|
|
|
|
2011-04-25 22:51:51 +02:00
|
|
|
// Appearance flags.
|
2016-05-13 10:08:49 +02:00
|
|
|
enum class ViewOptFlags {
|
|
|
|
NONE = 0x0000,
|
|
|
|
DocBoundaries = 0x0001,
|
|
|
|
ObjectBoundaries = 0x0002,
|
|
|
|
TableBoundaries = 0x0004,
|
|
|
|
IndexShadings = 0x0008,
|
|
|
|
Links = 0x0010,
|
|
|
|
VisitedLinks = 0x0020,
|
|
|
|
FieldShadings = 0x0040,
|
|
|
|
SectionBoundaries = 0x0080,
|
|
|
|
Shadow = 0x0100,
|
|
|
|
};
|
|
|
|
namespace o3tl {
|
|
|
|
template<> struct typed_flags<ViewOptFlags> : is_typed_flags<ViewOptFlags, 0x01ff> {};
|
|
|
|
}
|
2002-04-25 13:00:16 +00:00
|
|
|
|
2015-04-07 09:17:41 +02:00
|
|
|
class SW_DLLPUBLIC SwViewOption
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2015-11-12 08:35:21 +01:00
|
|
|
static Color m_aDocColor; // color of document boundaries
|
|
|
|
static Color m_aDocBoundColor; // color of document boundaries
|
|
|
|
static Color m_aObjectBoundColor; // color of object boundaries
|
|
|
|
static Color m_aAppBackgroundColor; // application background
|
|
|
|
static Color m_aTableBoundColor; // color of table boundaries
|
|
|
|
static Color m_aFontColor;
|
|
|
|
static Color m_aIndexShadingsColor; // background color of indexes
|
|
|
|
static Color m_aLinksColor;
|
|
|
|
static Color m_aVisitedLinksColor;
|
|
|
|
static Color m_aDirectCursorColor;
|
|
|
|
static Color m_aTextGridColor;
|
|
|
|
static Color m_aSpellColor; // mark color of online spell checking
|
|
|
|
static Color m_aSmarttagColor;
|
|
|
|
static Color m_aFieldShadingsColor;
|
|
|
|
static Color m_aSectionBoundColor;
|
|
|
|
static Color m_aPageBreakColor;
|
|
|
|
static Color m_aScriptIndicatorColor;
|
|
|
|
static Color m_aShadowColor;
|
|
|
|
static Color m_aHeaderFooterMarkColor;
|
|
|
|
|
2016-05-13 10:08:49 +02:00
|
|
|
static ViewOptFlags m_nAppearanceFlags;
|
2000-09-18 16:15:01 +00:00
|
|
|
protected:
|
2015-11-12 08:35:21 +01:00
|
|
|
static sal_uInt16 m_nPixelTwips;// 1 Pixel == ? Twips
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-11-02 09:10:53 +01:00
|
|
|
OUString m_sSymbolFont; // Symbolfont.
|
2016-05-13 13:56:17 +02:00
|
|
|
ViewOptFlags1 m_nCoreOptions; // Bits for SwViewShell.
|
|
|
|
ViewOptCoreFlags2 m_nCore2Options; // Bits for SwViewShell.
|
2016-05-13 12:07:34 +02:00
|
|
|
ViewOptFlags2 m_nUIOptions; // UI-Bits
|
2016-05-13 13:56:17 +02:00
|
|
|
Color m_aRetouchColor; // DefaultBackground for BrowseView
|
2015-11-02 09:10:53 +01:00
|
|
|
Size m_aSnapSize; // Describes horizontal and vertical snap.
|
2016-05-13 13:56:17 +02:00
|
|
|
sal_uInt16 mnViewLayoutColumns; // # columns for edit view
|
2015-11-02 09:10:53 +01:00
|
|
|
short m_nDivisionX; // Grid division.
|
|
|
|
short m_nDivisionY;
|
|
|
|
sal_uInt8 m_nPagePreviewRow; // Page Preview Row/Columns.
|
|
|
|
sal_uInt8 m_nPagePreviewCol; // Page Preview Row/Columns.
|
2015-11-25 06:03:10 -05:00
|
|
|
sal_uInt8 m_nShadowCursorFillMode; // FillMode for ShadowCursor.
|
2015-11-02 09:10:53 +01:00
|
|
|
bool m_bReadonly : 1; // Readonly-Doc.
|
|
|
|
bool m_bStarOneSetting : 1;// Prevent from UI automatics (no scrollbars in readonly documents).
|
|
|
|
bool m_bIsPagePreview : 1; // The preview mustn't print field/footnote/... shadings.
|
|
|
|
bool m_bSelectionInReadonly : 1; // Determines whether selection is switched on in readonly documents.
|
2014-04-25 14:00:35 +02:00
|
|
|
bool mbFormView : 1;
|
|
|
|
bool mbBrowseMode : 1;
|
|
|
|
bool mbBookView : 1; // View mode for page preview.
|
|
|
|
bool mbViewLayoutBookMode : 1; // Book view mode for edit view.
|
2015-07-13 23:32:28 -04:00
|
|
|
bool mbHideWhitespaceMode : 1; // Hide header, footer, and pagebreak.
|
2015-11-02 09:10:53 +01:00
|
|
|
bool m_bShowPlaceHolderFields : 1; // Only used in printing!
|
|
|
|
mutable bool m_bIdle;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-04-25 22:51:51 +02:00
|
|
|
// Scale
|
2015-11-02 09:10:53 +01:00
|
|
|
sal_uInt16 m_nZoom; // In percent.
|
|
|
|
SvxZoomType m_eZoom; // 'enum' for zoom.
|
2008-03-07 13:49:37 +00:00
|
|
|
|
2015-11-02 09:10:53 +01:00
|
|
|
sal_uInt8 m_nTableDestination; // Destination for table background.
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-11-24 00:52:00 +01:00
|
|
|
#ifdef DBG_UTIL
|
2011-04-25 22:51:51 +02:00
|
|
|
// Corresponds to statements in ui/config/cfgvw.src.
|
2011-11-24 00:52:00 +01:00
|
|
|
bool m_bTest1 :1; // Test-flag "Layout not loading"
|
|
|
|
bool m_bTest2 :1; // Test-flag "WYSIWYG++"
|
|
|
|
bool m_bTest3 :1; // Test-flag ""
|
|
|
|
bool m_bTest4 :1; // Test-flag "WYSIWYG debug"
|
|
|
|
bool m_bTest5 :1; // Test-flag "No idle format"
|
|
|
|
bool m_bTest6 :1; // Test-flag "No screen adj"
|
|
|
|
bool m_bTest7 :1; // Test-flag "win format"
|
|
|
|
bool m_bTest8 :1; // Test-flag ""
|
2015-11-12 08:35:21 +01:00
|
|
|
static bool m_bTest9; // Test-Flag "DrawingLayerNotLoading"
|
2011-11-24 00:52:00 +01:00
|
|
|
bool m_bTest10 :1; // Test-Flag "Format by Input"
|
2000-09-18 16:15:01 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
public:
|
|
|
|
SwViewOption(); // CTOR
|
2011-04-25 22:51:51 +02:00
|
|
|
SwViewOption(const SwViewOption&);
|
|
|
|
~SwViewOption();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-05-04 10:29:18 +02:00
|
|
|
static void Init( vcl::Window *pWin ); // Initializing of static data.
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2016-05-13 13:56:17 +02:00
|
|
|
inline ViewOptFlags1 GetCoreOptions() const {return m_nCoreOptions;}
|
2000-09-18 16:15:01 +00:00
|
|
|
inline void SetUIOptions( const SwViewOption& );
|
|
|
|
|
2014-05-25 21:26:51 -04:00
|
|
|
// Options from nCoreOptions
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsIdle() const
|
2015-11-02 09:10:53 +01:00
|
|
|
{ return m_bIdle; }
|
2009-11-25 16:52:25 +00:00
|
|
|
|
2011-04-25 22:51:51 +02:00
|
|
|
// Logically this is a const function since it does not modify the viewoptions
|
2009-11-25 16:52:25 +00:00
|
|
|
// but only effects idle formatting. Of course that member is already implement
|
|
|
|
// in the wrong place here... Also currently there are many const modifying casts in the code
|
|
|
|
// just to call this function on otherwise const objects. Thus declaring it as const now.
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetIdle( bool b ) const
|
2015-11-02 09:10:53 +01:00
|
|
|
{ m_bIdle = b; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsTab(bool bHard = false) const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return !m_bReadonly && (m_nCoreOptions & ViewOptFlags1::Tab) &&
|
|
|
|
((m_nCoreOptions & ViewOptFlags1::ViewMetachars)||bHard); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetTab( bool b ) {
|
2016-05-13 13:56:17 +02:00
|
|
|
b ? (m_nCoreOptions |= ViewOptFlags1::Tab ) : ( m_nCoreOptions &= ~ViewOptFlags1::Tab); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsBlank(bool bHard = false) const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return !m_bReadonly && (m_nCoreOptions & ViewOptFlags1::Blank) &&
|
|
|
|
((m_nCoreOptions & ViewOptFlags1::ViewMetachars)||bHard); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetBlank( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::Blank ) : ( m_nCoreOptions &= ~ViewOptFlags1::Blank); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsHardBlank() const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return !m_bReadonly && (m_nCoreOptions & ViewOptFlags1::HardBlank); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetHardBlank( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::HardBlank ) : ( m_nCoreOptions &= ~ViewOptFlags1::HardBlank); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsParagraph(bool bHard = false) const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return !m_bReadonly && (m_nCoreOptions & ViewOptFlags1::Paragraph) &&
|
|
|
|
((m_nCoreOptions & ViewOptFlags1::ViewMetachars)||bHard); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetParagraph( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::Paragraph ) : ( m_nCoreOptions &= ~ViewOptFlags1::Paragraph); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsLineBreak(bool bHard = false) const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return !m_bReadonly && (m_nCoreOptions & ViewOptFlags1::Linebreak) &&
|
|
|
|
((m_nCoreOptions & ViewOptFlags1::ViewMetachars)||bHard); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetLineBreak( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::Linebreak ) : ( m_nCoreOptions &= ~ViewOptFlags1::Linebreak); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetPageBreak( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::Pagebreak ) : ( m_nCoreOptions &= ~ViewOptFlags1::Pagebreak); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetColumnBreak( bool b)
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::Columnbreak ) : ( m_nCoreOptions &= ~ViewOptFlags1::Columnbreak); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsSoftHyph() const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return !m_bReadonly && (m_nCoreOptions & ViewOptFlags1::SoftHyph); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetSoftHyph( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::SoftHyph ) : ( m_nCoreOptions &= ~ViewOptFlags1::SoftHyph); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2016-05-13 13:56:17 +02:00
|
|
|
inline bool IsFieldName() const { return !m_bReadonly && (m_nCoreOptions & ViewOptFlags1::FieldName); }
|
2015-05-20 13:05:49 +02:00
|
|
|
inline void SetFieldName( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::FieldName ) : ( m_nCoreOptions &= ~ViewOptFlags1::FieldName); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsPostIts() const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return bool(m_nCoreOptions & ViewOptFlags1::Postits); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetPostIts( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::Postits ) : ( m_nCoreOptions &= ~ViewOptFlags1::Postits); }
|
2015-05-04 10:29:18 +02:00
|
|
|
static void PaintPostIts( OutputDevice *pOut, const SwRect &rRect,
|
|
|
|
bool bIsScript );
|
2016-08-18 14:34:31 +02:00
|
|
|
static sal_uInt16 GetPostItsWidth( const OutputDevice *pOut );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsShowHiddenChar(bool bHard = false) const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return !m_bReadonly && (m_nCoreOptions & ViewOptFlags1::CharHidden) &&
|
|
|
|
((m_nCoreOptions & ViewOptFlags1::ViewMetachars)||bHard); }
|
2004-02-26 14:24:58 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetShowHiddenChar( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::CharHidden ) : ( m_nCoreOptions &= ~ViewOptFlags1::CharHidden); }
|
2004-02-26 14:24:58 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsShowHiddenField() const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return !m_bReadonly && (m_nCoreOptions & ViewOptFlags1::FieldHidden); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetShowHiddenField( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::FieldHidden ) : ( m_nCoreOptions &= ~ViewOptFlags1::FieldHidden); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsGraphic() const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return bool(m_nCoreOptions & ViewOptFlags1::Graphic); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetGraphic( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::Graphic ) : ( m_nCoreOptions &= ~ViewOptFlags1::Graphic); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsPageBack() const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return bool(m_nCoreOptions & ViewOptFlags1::Pageback); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetPageBack( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::Pageback) : ( m_nCoreOptions &= ~ViewOptFlags1::Pageback); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsTable() const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return bool(m_nCoreOptions & ViewOptFlags1::Table); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetTable( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::Table ) : ( m_nCoreOptions &= ~ViewOptFlags1::Table); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsDraw() const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return bool(m_nCoreOptions & ViewOptFlags1::Draw); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetDraw( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::Draw ) : ( m_nCoreOptions &= ~ViewOptFlags1::Draw); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsControl() const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return bool(m_nCoreOptions & ViewOptFlags1::Control); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetControl( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::Control ) : ( m_nCoreOptions &= ~ViewOptFlags1::Control); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsSnap() const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return bool(m_nCoreOptions & ViewOptFlags1::Snap); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetSnap( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::Snap ) : ( m_nCoreOptions &= ~ViewOptFlags1::Snap); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-11-02 09:10:53 +01:00
|
|
|
inline void SetSnapSize( Size &rSz ){ m_aSnapSize = rSz; }
|
|
|
|
inline const Size &GetSnapSize() const { return m_aSnapSize; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsGridVisible() const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return !m_bReadonly && (m_nCoreOptions & ViewOptFlags1::GridVisible); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetGridVisible( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::GridVisible ) : ( m_nCoreOptions &= ~ViewOptFlags1::GridVisible); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsOnlineSpell() const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return !m_bReadonly && (m_nCoreOptions & ViewOptFlags1::OnlineSpell); }
|
2015-10-06 11:13:54 +02:00
|
|
|
void SetOnlineSpell( bool b );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsViewMetaChars() const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return !m_bReadonly && (m_nCoreOptions & ViewOptFlags1::ViewMetachars); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetViewMetaChars( bool b)
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::ViewMetachars ) : ( m_nCoreOptions &= ~ViewOptFlags1::ViewMetachars); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsSynchronize() const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return bool(m_nCoreOptions & ViewOptFlags1::Synchronize); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetSynchronize( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::Synchronize ) : ( m_nCoreOptions &= ~ViewOptFlags1::Synchronize); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsCrossHair() const
|
2016-05-13 13:56:17 +02:00
|
|
|
{ return bool(m_nCoreOptions & ViewOptFlags1::Crosshair); }
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetCrossHair( bool b )
|
2016-05-13 13:56:17 +02:00
|
|
|
{ b ? (m_nCoreOptions |= ViewOptFlags1::Crosshair ) : ( m_nCoreOptions &= ~ViewOptFlags1::Crosshair); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-05-25 21:26:51 -04:00
|
|
|
// Options from nCore2Options
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsBlackFont() const
|
2016-05-13 12:19:33 +02:00
|
|
|
{return bool(m_nCore2Options & ViewOptCoreFlags2::BlackFont); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetBlackFont(bool b)
|
2016-05-13 12:19:33 +02:00
|
|
|
{ b ? (m_nCore2Options |= ViewOptCoreFlags2::BlackFont) : (m_nCore2Options &= ~ViewOptCoreFlags2::BlackFont);}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsShowHiddenPara() const
|
2016-05-13 12:19:33 +02:00
|
|
|
{return bool(m_nCore2Options & ViewOptCoreFlags2::HiddenPara); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetShowHiddenPara(bool b)
|
2016-05-13 12:19:33 +02:00
|
|
|
{ b ? (m_nCore2Options |= ViewOptCoreFlags2::HiddenPara) : (m_nCore2Options &= ~ViewOptCoreFlags2::HiddenPara);}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsSmoothScroll() const
|
2016-05-13 12:19:33 +02:00
|
|
|
{return bool(m_nCore2Options & ViewOptCoreFlags2::SmoothScroll); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetSmoothScroll(bool b)
|
2016-05-13 12:19:33 +02:00
|
|
|
{ b ? (m_nCore2Options |= ViewOptCoreFlags2::SmoothScroll) : (m_nCore2Options &= ~ViewOptCoreFlags2::SmoothScroll);}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsCursorInProtectedArea() const
|
2016-05-13 12:19:33 +02:00
|
|
|
{return bool(m_nCore2Options & ViewOptCoreFlags2::CursorInProt); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetCursorInProtectedArea(bool b)
|
2016-05-13 12:19:33 +02:00
|
|
|
{ b ? (m_nCore2Options |= ViewOptCoreFlags2::CursorInProt) : (m_nCore2Options &= ~ViewOptCoreFlags2::CursorInProt);}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2016-11-18 22:41:13 +03:00
|
|
|
static bool IsIgnoreProtectedArea();
|
2015-04-07 09:17:41 +02:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsPDFExport() const
|
2016-05-13 12:19:33 +02:00
|
|
|
{return bool(m_nCore2Options & ViewOptCoreFlags2::PdfExport); }
|
2002-11-12 13:29:14 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetPDFExport(bool b)
|
2016-05-13 12:19:33 +02:00
|
|
|
{ b ? (m_nCore2Options |= ViewOptCoreFlags2::PdfExport) : (m_nCore2Options &= ~ViewOptCoreFlags2::PdfExport);}
|
2002-11-12 13:29:14 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsPrinting() const
|
2016-05-13 12:19:33 +02:00
|
|
|
{return bool(m_nCore2Options & ViewOptCoreFlags2::Printing); }
|
2009-12-03 15:25:10 +01:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SetPrinting(bool b)
|
2016-05-13 12:19:33 +02:00
|
|
|
{ b ? (m_nCore2Options |= ViewOptCoreFlags2::Printing) : (m_nCore2Options &= ~ViewOptCoreFlags2::Printing);}
|
2009-12-03 15:25:10 +01:00
|
|
|
|
2015-11-02 09:10:53 +01:00
|
|
|
inline short GetDivisionX() const { return m_nDivisionX; }
|
|
|
|
inline void SetDivisionX( short n ){ m_nDivisionX = n; }
|
|
|
|
inline short GetDivisionY() const { return m_nDivisionY; }
|
|
|
|
inline void SetDivisionY( short n ){ m_nDivisionY = n; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-08-29 21:02:39 -04:00
|
|
|
// Default margin left and above document: 284 twips == 5.0 mm.
|
|
|
|
static SAL_CONSTEXPR sal_uInt16 GetDefDocumentBorder() { return 284; }
|
|
|
|
// Default gap between pages: 284 twips == 5.0 mm.
|
|
|
|
static SAL_CONSTEXPR sal_uInt16 GetDefGapBetweenPages() { return 284; }
|
2015-08-30 22:52:03 -04:00
|
|
|
// Minimum edge-to-text distance: 22 twips == 0.4 mm.
|
|
|
|
static SAL_CONSTEXPR sal_uInt16 GetMinGapBetweenPages() { return 22; }
|
2015-08-29 21:02:39 -04:00
|
|
|
|
2015-08-30 22:52:03 -04:00
|
|
|
inline sal_uInt16 GetDocumentBorder() const { return IsWhitespaceHidden() ? GetMinGapBetweenPages() : GetDefDocumentBorder(); }
|
|
|
|
inline sal_uInt16 GetGapBetweenPages() const { return IsWhitespaceHidden() ? GetMinGapBetweenPages() : GetDefGapBetweenPages(); }
|
2015-08-29 21:02:39 -04:00
|
|
|
|
2015-11-02 09:10:53 +01:00
|
|
|
inline sal_uInt8 GetPagePrevRow() const { return m_nPagePreviewRow; }
|
|
|
|
inline void SetPagePrevRow( sal_uInt8 n ) { m_nPagePreviewRow = n; }
|
|
|
|
inline sal_uInt8 GetPagePrevCol() const { return m_nPagePreviewCol; }
|
|
|
|
inline void SetPagePrevCol( sal_uInt8 n ) { m_nPagePreviewCol = n; }
|
|
|
|
bool IsReadonly() const { return m_bReadonly; }
|
|
|
|
void SetReadonly(bool bSet) { m_bReadonly = bSet; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-11-02 09:10:53 +01:00
|
|
|
bool IsSelectionInReadonly() const {return m_bSelectionInReadonly;}
|
|
|
|
void SetSelectionInReadonly(bool bSet) {m_bSelectionInReadonly = bSet;}
|
2002-08-01 10:45:42 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
bool IsFormView() const { return mbFormView; }
|
|
|
|
void SetFormView( bool bSet ) { mbFormView = bSet; }
|
2004-11-16 09:20:10 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool getBrowseMode() const { return mbBrowseMode; }
|
|
|
|
inline void setBrowseMode(bool bSet) { mbBrowseMode = bSet; }
|
|
|
|
inline bool IsPagePrevBookview() const { return mbBookView; }
|
|
|
|
inline void SetPagePrevBookview(bool bSet) { mbBookView = bSet; }
|
2004-04-21 08:39:25 +00:00
|
|
|
|
2015-05-04 10:29:18 +02:00
|
|
|
static bool IsAutoCompleteWords();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2008-03-07 13:49:37 +00:00
|
|
|
bool IsViewLayoutBookMode() const { return mbViewLayoutBookMode; }
|
|
|
|
void SetViewLayoutBookMode( bool bNew ) { mbViewLayoutBookMode = bNew; }
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 GetViewLayoutColumns() const { return mnViewLayoutColumns; }
|
|
|
|
void SetViewLayoutColumns( sal_uInt16 nNew ) { mnViewLayoutColumns = nNew; }
|
2015-07-13 23:32:28 -04:00
|
|
|
bool IsHideWhitespaceMode() const { return mbHideWhitespaceMode; }
|
|
|
|
void SetHideWhitespaceMode( bool bMode ) { mbHideWhitespaceMode = bMode; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-08-30 22:52:03 -04:00
|
|
|
/// The rules that allow for hiding whitespace.
|
|
|
|
bool CanHideWhitespace() const { return !IsMultipageView(); }
|
|
|
|
bool IsWhitespaceHidden() const { return IsHideWhitespaceMode() && !IsMultipageView(); }
|
2015-08-29 21:02:39 -04:00
|
|
|
bool IsMultipageView() const { return IsViewLayoutBookMode() ||
|
|
|
|
GetViewLayoutColumns() == 0; }
|
|
|
|
|
2011-11-24 00:52:00 +01:00
|
|
|
#ifdef DBG_UTIL
|
2011-04-25 22:51:51 +02:00
|
|
|
// Correspond to statements in ui/config/cfgvw.src.
|
2011-11-24 00:52:00 +01:00
|
|
|
inline bool IsTest1() const { return m_bTest1; }
|
|
|
|
inline bool IsTest2() const { return m_bTest2; }
|
|
|
|
inline bool IsTest3() const { return m_bTest3; }
|
|
|
|
inline bool IsTest4() const { return m_bTest4; }
|
|
|
|
inline bool IsTest5() const { return m_bTest5; }
|
|
|
|
inline bool IsTest6() const { return m_bTest6; }
|
|
|
|
inline bool IsTest7() const { return m_bTest7; }
|
|
|
|
inline bool IsTest8() const { return m_bTest8; }
|
|
|
|
inline bool IsTest10() const { return m_bTest10; }
|
2000-09-18 16:15:01 +00:00
|
|
|
#endif
|
|
|
|
|
2015-11-02 09:10:53 +01:00
|
|
|
inline sal_uInt16 GetZoom() const { return m_nZoom; }
|
|
|
|
inline void SetZoom( sal_uInt16 n ){ m_nZoom = n; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-05-04 10:29:18 +02:00
|
|
|
static void DrawRect( OutputDevice* pOut, const SwRect &rRect, long nCol );
|
|
|
|
static void DrawRectPrinter( OutputDevice* pOut, const SwRect& rRect );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
SwViewOption& operator=( const SwViewOption &rOpt );
|
2011-04-25 22:51:51 +02:00
|
|
|
|
|
|
|
// Compare methods.
|
2013-01-10 00:02:56 +09:00
|
|
|
bool IsEqualFlags ( const SwViewOption &rOpt ) const;
|
|
|
|
inline bool operator == ( const SwViewOption &rOpt ) const;
|
|
|
|
inline bool operator != ( const SwViewOption &rOpt ) const { return !(*this == rOpt); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-05-25 21:26:51 -04:00
|
|
|
// Options from nUIOptions
|
2014-04-25 14:00:35 +02:00
|
|
|
bool IsViewVScrollBar() const
|
2013-04-05 00:15:06 +03:00
|
|
|
{
|
2013-10-17 20:45:17 +03:00
|
|
|
#if HAVE_FEATURE_DESKTOP
|
2016-05-13 12:07:34 +02:00
|
|
|
return bool(m_nUIOptions & ViewOptFlags2::VScrollbar);
|
2013-04-05 00:15:06 +03:00
|
|
|
#else
|
2014-11-08 14:19:22 +01:00
|
|
|
return false;
|
2013-04-05 00:15:06 +03:00
|
|
|
#endif
|
|
|
|
}
|
2014-04-25 14:00:35 +02:00
|
|
|
bool IsViewHScrollBar() const
|
2013-04-05 00:15:06 +03:00
|
|
|
{
|
2013-10-17 20:45:17 +03:00
|
|
|
#if HAVE_FEATURE_DESKTOP
|
2016-05-13 12:07:34 +02:00
|
|
|
return bool(m_nUIOptions & ViewOptFlags2::HScrollbar);
|
2013-04-05 00:15:06 +03:00
|
|
|
#else
|
2014-11-08 14:19:22 +01:00
|
|
|
return false;
|
2013-04-05 00:15:06 +03:00
|
|
|
#endif
|
|
|
|
}
|
2014-04-25 14:00:35 +02:00
|
|
|
bool IsKeepRatio() const
|
2016-05-13 12:07:34 +02:00
|
|
|
{ return bool(m_nUIOptions & ViewOptFlags2::KeepAspectRatio); }
|
2014-04-25 14:00:35 +02:00
|
|
|
bool IsGrfKeepZoom() const
|
2016-05-13 12:07:34 +02:00
|
|
|
{ return bool(m_nUIOptions & ViewOptFlags2::GrfKeepZoom); }
|
2014-04-25 14:00:35 +02:00
|
|
|
bool IsShowContentTips() const
|
2016-05-13 12:07:34 +02:00
|
|
|
{ return bool(m_nUIOptions & ViewOptFlags2::ContentTips); }
|
2014-04-25 14:00:35 +02:00
|
|
|
bool IsPrtFormat() const
|
2016-05-13 12:07:34 +02:00
|
|
|
{ return bool(m_nUIOptions & ViewOptFlags2::PrintFormat); }
|
2014-04-25 14:00:35 +02:00
|
|
|
bool IsShowScrollBarTips() const
|
2016-05-13 12:07:34 +02:00
|
|
|
{ return bool(m_nUIOptions & ViewOptFlags2::ScrollbarTips); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-11-02 09:10:53 +01:00
|
|
|
SvxZoomType GetZoomType() const { return m_eZoom; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-11-02 09:10:53 +01:00
|
|
|
sal_uInt8 GetTableDest() const { return m_nTableDestination; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
void SetViewVScrollBar(bool b)
|
2016-05-13 12:07:34 +02:00
|
|
|
{ b ? (m_nUIOptions |= ViewOptFlags2::VScrollbar ) : ( m_nUIOptions &= ~ViewOptFlags2::VScrollbar); }
|
2014-04-25 14:00:35 +02:00
|
|
|
void SetViewHScrollBar(bool b)
|
2016-05-13 12:07:34 +02:00
|
|
|
{ b ? (m_nUIOptions |= ViewOptFlags2::HScrollbar ) : ( m_nUIOptions &= ~ViewOptFlags2::HScrollbar); }
|
2014-04-25 14:00:35 +02:00
|
|
|
void SetKeepRatio (bool b)
|
2016-05-13 12:07:34 +02:00
|
|
|
{ b ? (m_nUIOptions |= ViewOptFlags2::KeepAspectRatio ) : ( m_nUIOptions &= ~ViewOptFlags2::KeepAspectRatio); }
|
2014-04-25 14:00:35 +02:00
|
|
|
void SetGrfKeepZoom (bool b)
|
2016-05-13 12:07:34 +02:00
|
|
|
{ b ? (m_nUIOptions |= ViewOptFlags2::GrfKeepZoom ) : ( m_nUIOptions &= ~ViewOptFlags2::GrfKeepZoom); }
|
2014-04-25 14:00:35 +02:00
|
|
|
void SetShowContentTips( bool b)
|
2016-05-13 12:07:34 +02:00
|
|
|
{ b ? (m_nUIOptions |= ViewOptFlags2::ContentTips) : (m_nUIOptions &= ~ViewOptFlags2::ContentTips); }
|
2014-04-25 14:00:35 +02:00
|
|
|
void SetPrtFormat( bool b)
|
2016-05-13 12:07:34 +02:00
|
|
|
{ b ? (m_nUIOptions |= ViewOptFlags2::PrintFormat) : (m_nUIOptions &= ~ViewOptFlags2::PrintFormat); }
|
2014-04-25 14:00:35 +02:00
|
|
|
void SetShowScrollBarTips( bool b)
|
2016-05-13 12:07:34 +02:00
|
|
|
{ b ? (m_nUIOptions |= ViewOptFlags2::ScrollbarTips) : (m_nUIOptions &= ~ViewOptFlags2::ScrollbarTips); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-11-02 09:10:53 +01:00
|
|
|
void SetZoomType (SvxZoomType eZoom_){ m_eZoom = eZoom_; }
|
|
|
|
void SetTableDest( sal_uInt8 nNew ) { m_nTableDestination = nNew; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-11-02 09:10:53 +01:00
|
|
|
const OUString& GetSymbolFont() const {return m_sSymbolFont;}
|
|
|
|
void SetSymbolFont(const OUString& sSet) {m_sSymbolFont = sSet;}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-11-02 09:10:53 +01:00
|
|
|
const Color& GetRetoucheColor() const { return m_aRetouchColor;}
|
|
|
|
void SetRetoucheColor(const Color&r) { m_aRetouchColor = r; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
bool IsViewAnyRuler() const
|
2013-04-05 00:15:06 +03:00
|
|
|
{
|
2013-10-17 20:45:17 +03:00
|
|
|
#if HAVE_FEATURE_DESKTOP
|
2016-05-13 12:07:34 +02:00
|
|
|
return bool(m_nUIOptions & ViewOptFlags2::AnyRuler);
|
2013-04-05 00:15:06 +03:00
|
|
|
#else
|
2014-11-08 14:19:22 +01:00
|
|
|
return false;
|
2013-04-05 00:15:06 +03:00
|
|
|
#endif
|
|
|
|
}
|
2014-04-25 14:00:35 +02:00
|
|
|
void SetViewAnyRuler(bool bSet)
|
2016-05-13 12:07:34 +02:00
|
|
|
{ bSet ? (m_nUIOptions |= ViewOptFlags2::AnyRuler) : (m_nUIOptions &= ~ViewOptFlags2::AnyRuler);}
|
2002-09-20 11:10:10 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
bool IsViewHRuler(bool bDirect = false) const
|
2002-09-20 11:10:10 +00:00
|
|
|
{
|
2013-10-17 20:45:17 +03:00
|
|
|
#if HAVE_FEATURE_DESKTOP
|
2014-11-08 14:19:22 +01:00
|
|
|
return bDirect
|
2016-05-13 12:07:34 +02:00
|
|
|
? bool(m_nUIOptions & ViewOptFlags2::HRuler)
|
2016-05-18 23:44:00 +03:00
|
|
|
: !m_bReadonly && (m_nUIOptions & (ViewOptFlags2::AnyRuler|ViewOptFlags2::HRuler)) == (ViewOptFlags2::AnyRuler|ViewOptFlags2::HRuler);
|
2013-04-05 00:15:06 +03:00
|
|
|
#else
|
|
|
|
(void) bDirect;
|
2014-11-08 14:19:22 +01:00
|
|
|
return false;
|
2013-04-05 00:15:06 +03:00
|
|
|
#endif
|
2002-09-20 11:10:10 +00:00
|
|
|
}
|
2014-04-25 14:00:35 +02:00
|
|
|
void SetViewHRuler (bool b)
|
2016-05-13 12:07:34 +02:00
|
|
|
{ b ? (m_nUIOptions |= ViewOptFlags2::HRuler ) : ( m_nUIOptions &= ~ViewOptFlags2::HRuler);}
|
2002-09-20 11:10:10 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
bool IsViewVRuler(bool bDirect = false) const
|
2002-09-20 11:10:10 +00:00
|
|
|
{
|
2013-10-17 20:45:17 +03:00
|
|
|
#if HAVE_FEATURE_DESKTOP
|
2014-11-08 14:19:22 +01:00
|
|
|
return bDirect
|
2016-05-13 12:07:34 +02:00
|
|
|
? bool(m_nUIOptions & ViewOptFlags2::VRuler)
|
2016-05-18 23:44:00 +03:00
|
|
|
: !m_bReadonly && (m_nUIOptions & (ViewOptFlags2::AnyRuler|ViewOptFlags2::VRuler)) == (ViewOptFlags2::AnyRuler|ViewOptFlags2::VRuler);
|
2013-04-05 00:15:06 +03:00
|
|
|
#else
|
|
|
|
(void) bDirect;
|
2014-11-08 14:19:22 +01:00
|
|
|
return false;
|
2013-04-05 00:15:06 +03:00
|
|
|
#endif
|
2002-09-20 11:10:10 +00:00
|
|
|
}
|
2014-04-25 14:00:35 +02:00
|
|
|
void SetViewVRuler (bool b)
|
2016-05-13 12:07:34 +02:00
|
|
|
{ b ? (m_nUIOptions |= ViewOptFlags2::VRuler ) : ( m_nUIOptions &= ~ViewOptFlags2::VRuler);}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-04-25 22:51:51 +02:00
|
|
|
// ShadowCursor, switch on/off, get/set color/mode.
|
2014-04-25 14:00:35 +02:00
|
|
|
bool IsShadowCursor() const
|
2016-05-13 12:07:34 +02:00
|
|
|
{ return bool(m_nUIOptions & ViewOptFlags2::ShadowCursor); }
|
2014-04-25 14:00:35 +02:00
|
|
|
void SetShadowCursor(bool b)
|
2016-05-13 12:07:34 +02:00
|
|
|
{ b ? (m_nUIOptions |= ViewOptFlags2::ShadowCursor ) : ( m_nUIOptions &= ~ViewOptFlags2::ShadowCursor); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2002-03-07 07:57:28 +00:00
|
|
|
//move vertical ruler to the right
|
2014-04-25 14:00:35 +02:00
|
|
|
bool IsVRulerRight() const
|
2016-05-13 12:07:34 +02:00
|
|
|
{ return bool(m_nUIOptions & ViewOptFlags2::VRulerRight); }
|
2014-04-25 14:00:35 +02:00
|
|
|
void SetVRulerRight(bool b)
|
2016-05-13 12:07:34 +02:00
|
|
|
{ b ? (m_nUIOptions |= ViewOptFlags2::VRulerRight ) : ( m_nUIOptions &= ~ViewOptFlags2::VRulerRight); }
|
2002-03-07 07:57:28 +00:00
|
|
|
|
2015-11-02 09:10:53 +01:00
|
|
|
bool IsStarOneSetting() const {return m_bStarOneSetting; }
|
|
|
|
void SetStarOneSetting(bool bSet) {m_bStarOneSetting = bSet; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-11-02 09:10:53 +01:00
|
|
|
bool IsPagePreview() const {return m_bIsPagePreview; }
|
|
|
|
void SetPagePreview(bool bSet) { m_bIsPagePreview= bSet; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-11-25 06:03:10 -05:00
|
|
|
sal_uInt8 GetShdwCursorFillMode() const { return m_nShadowCursorFillMode; }
|
|
|
|
void SetShdwCursorFillMode( sal_uInt8 nMode ) { m_nShadowCursorFillMode = nMode; };
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2015-11-02 09:10:53 +01:00
|
|
|
bool IsShowPlaceHolderFields() const { return m_bShowPlaceHolderFields; }
|
|
|
|
void SetShowPlaceHolderFields(bool bSet) { m_bShowPlaceHolderFields = bSet; }
|
2007-11-26 16:28:22 +00:00
|
|
|
|
2002-04-25 13:00:16 +00:00
|
|
|
static Color& GetDocColor();
|
|
|
|
static Color& GetDocBoundariesColor();
|
|
|
|
static Color& GetAppBackgroundColor();
|
|
|
|
static Color& GetObjectBoundariesColor();
|
|
|
|
static Color& GetTableBoundariesColor();
|
|
|
|
static Color& GetIndexShadingsColor();
|
|
|
|
static Color& GetLinksColor();
|
|
|
|
static Color& GetVisitedLinksColor();
|
|
|
|
static Color& GetDirectCursorColor();
|
|
|
|
static Color& GetTextGridColor();
|
2002-04-12 09:39:11 +00:00
|
|
|
static Color& GetSpellColor();
|
2007-06-27 12:15:07 +00:00
|
|
|
static Color& GetSmarttagColor();
|
2011-03-08 08:43:28 +01:00
|
|
|
static Color& GetShadowColor();
|
2015-04-07 09:17:41 +02:00
|
|
|
static Color& GetFontColor();
|
2002-04-25 13:00:16 +00:00
|
|
|
static Color& GetFieldShadingsColor();
|
|
|
|
static Color& GetSectionBoundColor();
|
2002-07-31 11:53:43 +00:00
|
|
|
static Color& GetPageBreakColor();
|
2011-08-18 14:33:48 +02:00
|
|
|
static Color& GetHeaderFooterMarkColor();
|
2002-04-25 13:00:16 +00:00
|
|
|
|
2016-05-13 10:08:49 +02:00
|
|
|
static bool IsAppearanceFlag(ViewOptFlags nFlag);
|
2002-04-25 13:00:16 +00:00
|
|
|
|
2016-05-13 10:08:49 +02:00
|
|
|
static bool IsDocBoundaries() {return IsAppearanceFlag(ViewOptFlags::DocBoundaries);}
|
|
|
|
static bool IsObjectBoundaries() {return IsAppearanceFlag(ViewOptFlags::ObjectBoundaries);}
|
|
|
|
static bool IsTableBoundaries() {return IsAppearanceFlag(ViewOptFlags::TableBoundaries );}
|
|
|
|
static bool IsIndexShadings() {return IsAppearanceFlag(ViewOptFlags::IndexShadings );}
|
|
|
|
static bool IsLinks() {return IsAppearanceFlag(ViewOptFlags::Links );}
|
|
|
|
static bool IsVisitedLinks() {return IsAppearanceFlag(ViewOptFlags::VisitedLinks );}
|
|
|
|
static bool IsFieldShadings() {return IsAppearanceFlag(ViewOptFlags::FieldShadings);}
|
|
|
|
static bool IsSectionBoundaries() {return IsAppearanceFlag(ViewOptFlags::SectionBoundaries);}
|
|
|
|
static bool IsShadow() {return IsAppearanceFlag(ViewOptFlags::Shadow );}
|
2002-04-25 13:00:16 +00:00
|
|
|
|
2016-05-13 10:08:49 +02:00
|
|
|
static void SetAppearanceFlag(ViewOptFlags nFlag, bool bSet, bool bSaveInConfig = false);
|
2002-04-25 13:00:16 +00:00
|
|
|
|
2016-05-13 10:08:49 +02:00
|
|
|
static void SetDocBoundaries(bool bSet) {SetAppearanceFlag(ViewOptFlags::DocBoundaries, bSet);}
|
2002-04-25 13:00:16 +00:00
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
static void ApplyColorConfigValues(const svtools::ColorConfig& rConfig);
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
|
|
|
|
2013-01-10 00:02:56 +09:00
|
|
|
inline bool SwViewOption::operator==( const SwViewOption &rOpt ) const
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2015-11-02 09:10:53 +01:00
|
|
|
return IsEqualFlags( rOpt ) && m_nZoom == rOpt.GetZoom();
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void SwViewOption::SetUIOptions( const SwViewOption& rVOpt )
|
|
|
|
{
|
2015-11-02 09:10:53 +01:00
|
|
|
m_nUIOptions = rVOpt.m_nUIOptions;
|
|
|
|
m_nTableDestination = rVOpt.m_nTableDestination;
|
2015-11-25 06:03:10 -05:00
|
|
|
m_nShadowCursorFillMode = rVOpt.m_nShadowCursorFillMode;
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
2011-04-25 22:51:51 +02:00
|
|
|
// Helper function for checking HTML-capabilities.
|
2011-01-17 15:06:54 +01:00
|
|
|
SW_DLLPUBLIC sal_uInt16 GetHtmlMode(const SwDocShell*);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
#endif
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|