LCOV - code coverage report
Current view: top level - sw/inc - viewopt.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 207 237 87.3 %
Date: 2015-06-13 12:38:46 Functions: 118 141 83.7 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      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 .
      18             :  */
      19             : 
      20             : #ifndef INCLUDED_SW_INC_VIEWOPT_HXX
      21             : #define INCLUDED_SW_INC_VIEWOPT_HXX
      22             : 
      23             : #include <config_features.h>
      24             : 
      25             : #include <tools/gen.hxx>
      26             : #include <tools/color.hxx>
      27             : 
      28             : #include <sfx2/zoomitem.hxx>
      29             : #include <svx/svxids.hrc>
      30             : #include "swdllapi.h"
      31             : #include "authratr.hxx"
      32             : 
      33             : class SwRect;
      34             : namespace vcl { class Window; }
      35             : class OutputDevice;
      36             : class SwViewShell;
      37             : class SwDocShell;
      38             : namespace svtools{ class ColorConfig;}
      39             : 
      40             : #define VIEWOPT_1_TAB           0x00000002L
      41             : #define VIEWOPT_1_BLANK         0x00000004L
      42             : #define VIEWOPT_1_HARDBLANK     0x00000008L
      43             : #define VIEWOPT_1_PARAGRAPH     0x00000010L
      44             : #define VIEWOPT_1_LINEBREAK     0x00000020L
      45             : #define VIEWOPT_1_PAGEBREAK     0x00000040L
      46             : #define VIEWOPT_1_COLUMNBREAK   0x00000080L
      47             : #define VIEWOPT_1_SOFTHYPH      0x00000100L
      48             : 
      49             : #define VIEWOPT_1_REF           0x00000400L
      50             : #define VIEWOPT_1_FLDNAME       0x00000800L
      51             : #define VIEWOPT_1_POSTITS       0x00004000L
      52             : #define VIEWOPT_1_FLD_HIDDEN    0x00008000L
      53             : #define VIEWOPT_1_CHAR_HIDDEN   0x00010000L
      54             : #define VIEWOPT_1_GRAPHIC       0x00020000L
      55             : #define VIEWOPT_1_TABLE         0x00040000L
      56             : #define VIEWOPT_1_DRAW          0x00080000L
      57             : #define VIEWOPT_1_CONTROL       0x00100000L
      58             : #define VIEWOPT_1_CROSSHAIR     0x00400000L
      59             : #define VIEWOPT_1_SNAP          0x00800000L
      60             : #define VIEWOPT_1_SYNCHRONIZE   0x01000000L
      61             : #define VIEWOPT_1_GRIDVISIBLE   0x02000000L
      62             : #define VIEWOPT_1_ONLINESPELL   0x04000000L
      63             : #define VIEWOPT_1_VIEWMETACHARS 0x20000000L
      64             : #define VIEWOPT_1_PAGEBACK      0x40000000L
      65             : 
      66             : #define VIEWOPT_CORE2_BLACKFONT         0x00000001L
      67             : #define VIEWOPT_CORE2_HIDDENPARA        0x00000002L
      68             : #define VIEWOPT_CORE2_SMOOTHSCROLL      0x00000004L
      69             : #define VIEWOPT_CORE2_CRSR_IN_PROT      0x00000008L
      70             : #define VIEWOPT_CORE2_PDF_EXPORT        0x00000010L
      71             : #define VIEWOPT_CORE2_PRINTING          0x00000020L
      72             : #define VIEWOPT_CORE2_IGNORE_PROT       0x00000040L
      73             : 
      74             : #define VIEWOPT_2_H_RULER           0x00000400L
      75             : #define VIEWOPT_2_VSCROLLBAR        0x00000800L
      76             : #define VIEWOPT_2_HSCROLLBAR        0x00001000L
      77             : #define VIEWOPT_2_V_RULER           0x00004000L
      78             : #define VIEWOPT_2_ANY_RULER         0x00008000L
      79             : #define VIEWOPT_2_MODIFIED          0x00010000L
      80             : #define VIEWOPT_2_KEEPASPECTRATIO   0x00020000L
      81             : #define VIEWOPT_2_GRFKEEPZOOM       0x00040000L
      82             : #define VIEWOPT_2_CONTENT_TIPS      0x00100000L
      83             : #define VIEWOPT_2_SCROLLBAR_TIPS    0x00400000L
      84             : #define VIEWOPT_2_PRTFORMAT         0x00800000L
      85             : #define VIEWOPT_2_SHADOWCRSR        0x01000000L
      86             : #define VIEWOPT_2_V_RULER_RIGHT     0x02000000L
      87             : 
      88             : // Table background.
      89             : #define TBL_DEST_CELL   0
      90             : #define TBL_DEST_ROW    1
      91             : #define TBL_DEST_TBL    2
      92             : 
      93             : // Appearance flags.
      94             : #define VIEWOPT_DOC_BOUNDARIES      0x0001
      95             : #define VIEWOPT_OBJECT_BOUNDARIES   0x0002
      96             : #define VIEWOPT_TABLE_BOUNDARIES    0x0004
      97             : #define VIEWOPT_INDEX_SHADINGS      0x0008
      98             : #define VIEWOPT_LINKS               0x0010
      99             : #define VIEWOPT_VISITED_LINKS       0x0020
     100             : #define VIEWOPT_FIELD_SHADINGS      0x0040
     101             : #define VIEWOPT_SECTION_BOUNDARIES  0x0080
     102             : #define VIEWOPT_SHADOW              0x0100
     103             : 
     104             : // Implementation in core/text/txtpaint.cxx.
     105             : extern void SyncVout( const OutputDevice *pOut );
     106             : 
     107             : class SW_DLLPUBLIC SwViewOption
     108             : {
     109             :     static Color    aDocColor;  // color of document boundaries
     110             :     static Color    aDocBoundColor;  // color of document boundaries
     111             :     static Color    aObjectBoundColor; // color of object boundaries
     112             :     static Color    aAppBackgroundColor; // application background
     113             :     static Color    aTableBoundColor; // color of table boundaries
     114             :     static Color    aFontColor;
     115             :     static Color    aIndexShadingsColor; // background color of indexes
     116             :     static Color    aLinksColor;
     117             :     static Color    aVisitedLinksColor;
     118             :     static Color    aDirectCursorColor;
     119             :     static Color    aTextGridColor;
     120             :     static Color    aSpellColor;     // mark color of online spell checking
     121             :     static Color    aSmarttagColor;
     122             :     static Color    aFieldShadingsColor;
     123             :     static Color    aSectionBoundColor;
     124             :     static Color    aPageBreakColor;
     125             :     static Color    aScriptIndicatorColor;
     126             :     static Color    aShadowColor;
     127             :     static Color    aHeaderFooterMarkColor;
     128             : 
     129             :     static sal_Int32 nAppearanceFlags;
     130             : protected:
     131             :     static sal_uInt16   nPixelTwips;// 1 Pixel == ? Twips
     132             : 
     133             :     OUString   sSymbolFont;        // Symbolfont.
     134             :     sal_uInt32      nCoreOptions;       // Bits for SwViewShell.
     135             :     sal_uInt32      nCore2Options;      // Bits for SwViewShell.
     136             :     sal_uInt32      nUIOptions;         // UI-Bits
     137             :     Color           aRetoucheColor;     // DefaultBackground for BrowseView
     138             :     Size            aSnapSize;          // Describes horizontal and vertical snap.
     139             :     sal_uInt16          mnViewLayoutColumns;// # columns for edit view
     140             :     short           nDivisionX;         // Grid division.
     141             :     short           nDivisionY;
     142             :     sal_uInt8           nPagePrevRow;       // Page Preview Row/Columns.
     143             :     sal_uInt8           nPagePrevCol;       // Page Preview Row/Columns.
     144             :     sal_uInt8           nShdwCrsrFillMode;  // FillMode for ShadowCrsr.
     145             :     bool            bReadonly : 1;      // Readonly-Doc.
     146             :     bool            bStarOneSetting : 1;// Prevent from UI automatics (no scrollbars in readonly documents).
     147             :     bool            bIsPagePreview : 1; // The preview mustn't print field/footnote/... shadings.
     148             :     bool            bSelectionInReadonly : 1; // Determines whether selection is switched on in readonly documents.
     149             :     bool            mbFormView : 1;
     150             :     bool            mbBrowseMode : 1;
     151             :     bool            mbBookView : 1;      // View mode for page preview.
     152             :     bool            mbViewLayoutBookMode : 1; // Book view mode for edit view.
     153             :     bool        bShowPlaceHolderFields : 1; // Only used in printing!
     154             :     mutable bool    bIdle;
     155             : 
     156             :     // Scale
     157             :     sal_uInt16          nZoom;          // In percent.
     158             :     SvxZoomType     eZoom;              // 'enum' for zoom.
     159             : 
     160             :     sal_uInt8            nTableDest;      // Destination for table background.
     161             : 
     162             : #ifdef DBG_UTIL
     163             :     // Corresponds to statements in ui/config/cfgvw.src.
     164             :     bool  m_bTest1        :1;     // Test-flag  "Layout not loading"
     165             :     bool  m_bTest2        :1;     // Test-flag  "WYSIWYG++"
     166             :     bool  m_bTest3        :1;     // Test-flag  ""
     167             :     bool  m_bTest4        :1;     // Test-flag  "WYSIWYG debug"
     168             :     bool  m_bTest5        :1;     // Test-flag  "No idle format"
     169             :     bool  m_bTest6        :1;     // Test-flag  "No screen adj"
     170             :     bool  m_bTest7        :1;     // Test-flag  "win format"
     171             :     bool  m_bTest8        :1;     // Test-flag  ""
     172             :     static bool  s_bTest9;    // Test-Flag  "DrawingLayerNotLoading"
     173             :     bool  m_bTest10       :1;     // Test-Flag  "Format by Input"
     174             : #endif
     175             : 
     176             : public:
     177             :             SwViewOption();                     // CTOR
     178             :             SwViewOption(const SwViewOption&);
     179             :             ~SwViewOption();
     180             : 
     181             :     static void Init( vcl::Window *pWin );        // Initializing of static data.
     182             : 
     183           0 :     static sal_uInt16 GetPixelTwips() { return nPixelTwips; }
     184             : 
     185           0 :     inline sal_uInt32   GetCoreOptions() const {return nCoreOptions;}
     186             :     inline void     SetUIOptions( const SwViewOption& );
     187             : 
     188             :     // Options from nCoreOptions
     189    26775077 :     inline bool IsIdle() const
     190    26775077 :         { return bIdle; }
     191             : 
     192             :     // Logically this is a const function since it does not modify the viewoptions
     193             :     // but only effects idle formatting. Of course that member is already implement
     194             :     // in the wrong place here... Also currently there are many const modifying casts in the code
     195             :     // just to call this function on otherwise const objects. Thus declaring it as const now.
     196         113 :     inline void SetIdle( bool b ) const
     197         113 :         { bIdle = b; }
     198             : 
     199         554 :     inline bool IsTab(bool bHard = false) const
     200        1107 :                     {   return !bReadonly && (nCoreOptions & VIEWOPT_1_TAB) &&
     201        1653 :                             ((nCoreOptions & VIEWOPT_1_VIEWMETACHARS)||bHard); }
     202         120 :     inline void SetTab( bool b )        {
     203         120 :         b ? (nCoreOptions |= VIEWOPT_1_TAB ) : ( nCoreOptions &= ~VIEWOPT_1_TAB); }
     204             : 
     205       20013 :     inline bool IsBlank(bool bHard = false) const
     206       40020 :                     { return !bReadonly && (nCoreOptions & VIEWOPT_1_BLANK) &&
     207       60020 :                             ((nCoreOptions & VIEWOPT_1_VIEWMETACHARS)||bHard); }
     208         122 :     inline void SetBlank( bool b )
     209         122 :         { b ? (nCoreOptions |= VIEWOPT_1_BLANK ) : ( nCoreOptions &= ~VIEWOPT_1_BLANK); }
     210             : 
     211         207 :     inline bool IsHardBlank() const
     212         207 :                     { return !bReadonly && (nCoreOptions & VIEWOPT_1_HARDBLANK) != 0; }
     213         134 :     inline void SetHardBlank( bool b )
     214         134 :         { b ? (nCoreOptions |= VIEWOPT_1_HARDBLANK ) : ( nCoreOptions &= ~VIEWOPT_1_HARDBLANK); }
     215             : 
     216      118647 :     inline bool IsParagraph(bool bHard = false) const
     217      237304 :                     {   return !bReadonly && (nCoreOptions & VIEWOPT_1_PARAGRAPH) &&
     218      355708 :                             ((nCoreOptions & VIEWOPT_1_VIEWMETACHARS)||bHard); }
     219         122 :     inline void SetParagraph( bool b )
     220         122 :         { b ? (nCoreOptions |= VIEWOPT_1_PARAGRAPH ) : ( nCoreOptions &= ~VIEWOPT_1_PARAGRAPH); }
     221             : 
     222       80142 :     inline bool IsLineBreak(bool bHard = false) const
     223      160282 :                     {   return !bReadonly && (nCoreOptions & VIEWOPT_1_LINEBREAK) &&
     224      240415 :                             ((nCoreOptions & VIEWOPT_1_VIEWMETACHARS)||bHard); }
     225         122 :     inline void SetLineBreak( bool b )
     226         122 :         { b ? (nCoreOptions |= VIEWOPT_1_LINEBREAK ) : ( nCoreOptions &= ~VIEWOPT_1_LINEBREAK); }
     227             : 
     228           1 :     inline void SetPageBreak( bool b )
     229           1 :         { b ? (nCoreOptions |= VIEWOPT_1_PAGEBREAK ) : ( nCoreOptions &= ~VIEWOPT_1_PAGEBREAK); }
     230             : 
     231           1 :     inline void SetColumnBreak( bool b)
     232           1 :         { b ? (nCoreOptions |= VIEWOPT_1_COLUMNBREAK ) : ( nCoreOptions &= ~VIEWOPT_1_COLUMNBREAK); }
     233             : 
     234          12 :     inline bool IsSoftHyph() const
     235          12 :                     { return !bReadonly && (nCoreOptions & VIEWOPT_1_SOFTHYPH) != 0; }
     236         122 :     inline void SetSoftHyph( bool b )
     237         122 :         { b ? (nCoreOptions |= VIEWOPT_1_SOFTHYPH ) : ( nCoreOptions &= ~VIEWOPT_1_SOFTHYPH); }
     238             : 
     239        6518 :     inline bool IsFieldName() const       { return !bReadonly && (nCoreOptions & VIEWOPT_1_FLDNAME) != 0; }
     240         121 :     inline void SetFieldName( bool b )
     241         121 :         { b ? (nCoreOptions |= VIEWOPT_1_FLDNAME ) : ( nCoreOptions &= ~VIEWOPT_1_FLDNAME); }
     242             : 
     243       72027 :     inline bool IsPostIts() const
     244       72027 :         { return (nCoreOptions & VIEWOPT_1_POSTITS) != 0; }
     245         121 :     inline void SetPostIts( bool b )
     246         121 :         { b ? (nCoreOptions |= VIEWOPT_1_POSTITS ) : ( nCoreOptions &= ~VIEWOPT_1_POSTITS); }
     247             :     static void PaintPostIts( OutputDevice *pOut, const SwRect &rRect,
     248             :                               bool bIsScript );
     249             :     static sal_uInt16 GetPostItsWidth( const OutputDevice *pOut = 0 );
     250             : 
     251    48853819 :     inline bool IsShowHiddenChar(bool bHard = false) const
     252    48853879 :         { return !bReadonly && (nCoreOptions & VIEWOPT_1_CHAR_HIDDEN) &&
     253    48853892 :                             ((nCoreOptions & VIEWOPT_1_VIEWMETACHARS)||bHard); }
     254             : 
     255         118 :     inline void SetShowHiddenChar( bool b )
     256         118 :         { b ? (nCoreOptions |= VIEWOPT_1_CHAR_HIDDEN ) : ( nCoreOptions &= ~VIEWOPT_1_CHAR_HIDDEN); }
     257             : 
     258        5451 :     inline bool IsShowHiddenField() const
     259        5451 :         { return !bReadonly && (nCoreOptions & VIEWOPT_1_FLD_HIDDEN) != 0; }
     260         119 :     inline void SetShowHiddenField( bool b )
     261         119 :         { b ? (nCoreOptions |= VIEWOPT_1_FLD_HIDDEN ) : ( nCoreOptions &= ~VIEWOPT_1_FLD_HIDDEN); }
     262             : 
     263        1974 :     inline bool IsGraphic() const
     264        1974 :         { return (nCoreOptions & VIEWOPT_1_GRAPHIC) != 0; }
     265         469 :     inline void SetGraphic( bool b )
     266         469 :         { b ? (nCoreOptions |= VIEWOPT_1_GRAPHIC ) : ( nCoreOptions &= ~VIEWOPT_1_GRAPHIC); }
     267             : 
     268       39069 :     inline bool IsPageBack() const
     269       39069 :         { return (nCoreOptions & VIEWOPT_1_PAGEBACK) != 0; }
     270         348 :     inline void SetPageBack( bool b )
     271         348 :         { b ? (nCoreOptions |= VIEWOPT_1_PAGEBACK) : ( nCoreOptions &= ~VIEWOPT_1_PAGEBACK); }
     272             : 
     273        7403 :     inline bool IsTable() const
     274        7403 :         { return (nCoreOptions & VIEWOPT_1_TABLE) != 0; }
     275         469 :     inline void SetTable( bool b )
     276         469 :         { b ? (nCoreOptions |= VIEWOPT_1_TABLE ) : ( nCoreOptions &= ~VIEWOPT_1_TABLE); }
     277             : 
     278           7 :     inline bool IsDraw() const
     279           7 :         { return (nCoreOptions & VIEWOPT_1_DRAW) != 0; }
     280         469 :     inline void SetDraw( bool b )
     281         469 :         { b ? (nCoreOptions |= VIEWOPT_1_DRAW ) : ( nCoreOptions &= ~VIEWOPT_1_DRAW); }
     282             : 
     283           0 :     inline bool IsControl() const
     284           0 :         { return (nCoreOptions & VIEWOPT_1_CONTROL) != 0; }
     285         348 :     inline void SetControl( bool b )
     286         348 :         { b ? (nCoreOptions |= VIEWOPT_1_CONTROL ) : ( nCoreOptions &= ~VIEWOPT_1_CONTROL); }
     287             : 
     288        4282 :     inline bool IsSnap() const
     289        4282 :         { return (nCoreOptions & VIEWOPT_1_SNAP) != 0; }
     290          61 :     inline void SetSnap( bool b )
     291          61 :         { b ? (nCoreOptions |= VIEWOPT_1_SNAP ) : ( nCoreOptions &= ~VIEWOPT_1_SNAP); }
     292             : 
     293          63 :     inline void SetSnapSize( Size &rSz ){ aSnapSize = rSz; }
     294        4348 :     inline const Size &GetSnapSize() const { return aSnapSize; }
     295             : 
     296        7391 :     inline bool IsGridVisible() const
     297        7391 :         { return !bReadonly && (nCoreOptions & VIEWOPT_1_GRIDVISIBLE) != 0; }
     298          61 :     inline void SetGridVisible( bool b )
     299          61 :         { b ? (nCoreOptions |= VIEWOPT_1_GRIDVISIBLE ) : ( nCoreOptions &= ~VIEWOPT_1_GRIDVISIBLE); }
     300             : 
     301   102097113 :     inline bool IsOnlineSpell() const
     302   102097113 :         { return !bReadonly && (nCoreOptions & VIEWOPT_1_ONLINESPELL) != 0; }
     303        2761 :     inline void SetOnlineSpell( bool b )
     304        2761 :         { b ? (nCoreOptions |= VIEWOPT_1_ONLINESPELL ) : ( nCoreOptions &= ~VIEWOPT_1_ONLINESPELL); }
     305             : 
     306        9691 :     inline bool IsViewMetaChars() const
     307        9691 :         { return !bReadonly && (nCoreOptions & VIEWOPT_1_VIEWMETACHARS) != 0; }
     308         121 :     inline void SetViewMetaChars( bool b)
     309         121 :         { b ? (nCoreOptions |= VIEWOPT_1_VIEWMETACHARS ) : ( nCoreOptions &= ~VIEWOPT_1_VIEWMETACHARS); }
     310             : 
     311           0 :     inline bool IsSynchronize() const
     312           0 :         {  return (nCoreOptions & VIEWOPT_1_SYNCHRONIZE) != 0; }
     313          59 :     inline void SetSynchronize( bool b )
     314          59 :         { b ? (nCoreOptions |= VIEWOPT_1_SYNCHRONIZE ) : ( nCoreOptions &= ~VIEWOPT_1_SYNCHRONIZE); }
     315             : 
     316        4333 :     inline bool IsCrossHair() const
     317        4333 :         { return (nCoreOptions & VIEWOPT_1_CROSSHAIR) != 0; }
     318          59 :     inline void SetCrossHair( bool b )
     319          59 :         { b ? (nCoreOptions |= VIEWOPT_1_CROSSHAIR ) : ( nCoreOptions &= ~VIEWOPT_1_CROSSHAIR); }
     320             : 
     321             :     // Options from nCore2Options
     322         443 :     inline bool IsBlackFont() const
     323         443 :         {return (nCore2Options & VIEWOPT_CORE2_BLACKFONT) != 0; }
     324             : 
     325         348 :     inline void SetBlackFont(bool b)
     326         348 :         { b ? (nCore2Options |= VIEWOPT_CORE2_BLACKFONT) : (nCore2Options &= ~VIEWOPT_CORE2_BLACKFONT);}
     327             : 
     328        2344 :     inline bool IsShowHiddenPara() const
     329        2344 :         {return (nCore2Options & VIEWOPT_CORE2_HIDDENPARA) != 0; }
     330             : 
     331         119 :     inline void SetShowHiddenPara(bool b)
     332         119 :         { b ? (nCore2Options |= VIEWOPT_CORE2_HIDDENPARA) : (nCore2Options &= ~VIEWOPT_CORE2_HIDDENPARA);}
     333             : 
     334         281 :     inline bool IsSmoothScroll() const
     335         281 :         {return (nCore2Options & VIEWOPT_CORE2_SMOOTHSCROLL) != 0; }
     336             : 
     337          62 :     inline void SetSmoothScroll(bool b)
     338          62 :         { b ? (nCore2Options |= VIEWOPT_CORE2_SMOOTHSCROLL) : (nCore2Options &= ~VIEWOPT_CORE2_SMOOTHSCROLL);}
     339             : 
     340        2829 :     inline bool IsCursorInProtectedArea() const
     341        2829 :         {return (nCore2Options & VIEWOPT_CORE2_CRSR_IN_PROT) != 0; }
     342             : 
     343          59 :     inline void SetCursorInProtectedArea(bool b)
     344          59 :         { b ? (nCore2Options |= VIEWOPT_CORE2_CRSR_IN_PROT) : (nCore2Options &= ~VIEWOPT_CORE2_CRSR_IN_PROT);}
     345             : 
     346       18061 :     bool IsIgnoreProtectedArea() const
     347             :     {
     348       18061 :         return (nCore2Options & VIEWOPT_CORE2_IGNORE_PROT) != 0;
     349             :     }
     350             : 
     351          60 :     void SetIgnoreProtectedArea(bool bSet)
     352             :     {
     353          60 :         bSet ? (nCore2Options |= VIEWOPT_CORE2_IGNORE_PROT) : (nCore2Options &= ~VIEWOPT_CORE2_IGNORE_PROT);
     354          60 :     }
     355             : 
     356       27603 :     inline bool IsPDFExport() const
     357       27603 :         {return (nCore2Options & VIEWOPT_CORE2_PDF_EXPORT) != 0; }
     358             : 
     359           4 :     inline void SetPDFExport(bool b)
     360           4 :         { b ? (nCore2Options |= VIEWOPT_CORE2_PDF_EXPORT) : (nCore2Options &= ~VIEWOPT_CORE2_PDF_EXPORT);}
     361             : 
     362           0 :     inline bool IsPrinting() const
     363           0 :         {return (nCore2Options & VIEWOPT_CORE2_PRINTING) != 0; }
     364             : 
     365           1 :     inline void SetPrinting(bool b)
     366           1 :         { b ? (nCore2Options |= VIEWOPT_CORE2_PRINTING) : (nCore2Options &= ~VIEWOPT_CORE2_PRINTING);}
     367             : 
     368        9544 :     inline short GetDivisionX() const   { return nDivisionX; }
     369          61 :     inline void  SetDivisionX( short n ){ nDivisionX = n; }
     370        9540 :     inline short GetDivisionY() const   { return nDivisionY; }
     371          61 :     inline void  SetDivisionY( short n ){ nDivisionY = n; }
     372             : 
     373         981 :     inline sal_uInt8  GetPagePrevRow() const      { return nPagePrevRow; }
     374           0 :     inline void  SetPagePrevRow( sal_uInt8 n ) { nPagePrevRow = n; }
     375         981 :     inline sal_uInt8  GetPagePrevCol() const      { return nPagePrevCol; }
     376           0 :     inline void  SetPagePrevCol( sal_uInt8 n ) { nPagePrevCol = n; }
     377      221280 :     bool         IsReadonly() const { return bReadonly; }
     378        3789 :     void         SetReadonly(bool bSet) { bReadonly = bSet; }
     379             : 
     380          35 :     bool         IsSelectionInReadonly() const {return bSelectionInReadonly;}
     381        2761 :     void         SetSelectionInReadonly(bool bSet) {bSelectionInReadonly = bSet;}
     382             : 
     383      189332 :     bool         IsFormView() const { return mbFormView; }
     384           0 :     void         SetFormView( bool bSet ) { mbFormView = bSet; }
     385             : 
     386    30894462 :     inline bool  getBrowseMode() const { return mbBrowseMode; }
     387        2763 :     inline void  setBrowseMode(bool bSet) { mbBrowseMode = bSet; }
     388           0 :     inline bool  IsPagePrevBookview() const { return mbBookView; }
     389           0 :     inline void  SetPagePrevBookview(bool bSet) { mbBookView = bSet; }
     390             : 
     391             :     static bool IsAutoCompleteWords();
     392             : 
     393      344878 :     bool   IsViewLayoutBookMode() const { return mbViewLayoutBookMode; }
     394         228 :     void   SetViewLayoutBookMode( bool bNew ) { mbViewLayoutBookMode = bNew; }
     395       47708 :     sal_uInt16 GetViewLayoutColumns() const { return mnViewLayoutColumns; }
     396         228 :     void   SetViewLayoutColumns( sal_uInt16 nNew ) { mnViewLayoutColumns = nNew; }
     397             : 
     398             : #ifdef DBG_UTIL
     399             :     // Correspond to statements in ui/config/cfgvw.src.
     400             :     inline bool IsTest1() const     { return m_bTest1; }
     401             :     inline void SetTest1( bool b )  { m_bTest1 = b; }
     402             :     inline bool IsTest2() const     { return m_bTest2; }
     403             :     inline void SetTest2( bool b )  { m_bTest2 = b; }
     404             :     inline bool IsTest3() const     { return m_bTest3; }
     405             :     inline void SetTest3( bool b )  { m_bTest3 = b; }
     406             :     inline bool IsTest4() const     { return m_bTest4; }
     407             :     inline void SetTest4( bool b )  { m_bTest4 = b; }
     408             :     inline bool IsTest5() const     { return m_bTest5; }
     409             :     inline void SetTest5( bool b )  { m_bTest5 = b; }
     410             :     inline bool IsTest6() const     { return m_bTest6; }
     411             :     inline void SetTest6( bool b )  { m_bTest6 = b; }
     412             :     inline bool IsTest7() const     { return m_bTest7; }
     413             :     inline void SetTest7( bool b )  { m_bTest7 = b; }
     414             :     inline bool IsTest8() const     { return m_bTest8; }
     415             :     inline void SetTest8( bool b )  { m_bTest8 = b; }
     416             :     static inline bool IsTest9()            { return s_bTest9; }
     417             :     static inline void SetTest9( bool b )   { s_bTest9 = b; }
     418             :     inline bool IsTest10() const    { return m_bTest10; }
     419             :     inline void SetTest10( bool b ) { m_bTest10 = b; }
     420             : #endif
     421             : 
     422      674077 :     inline sal_uInt16 GetZoom() const    { return nZoom; }
     423         987 :     inline void   SetZoom( sal_uInt16 n ){ nZoom = n; }
     424             : 
     425             :     static void DrawRect( OutputDevice* pOut, const SwRect &rRect, long nCol );
     426             :     static void DrawRectPrinter( OutputDevice* pOut, const SwRect& rRect );
     427             : 
     428             :     SwViewOption& operator=( const SwViewOption &rOpt );
     429             : 
     430             :     // Compare methods.
     431             :     bool IsEqualFlags ( const SwViewOption &rOpt ) const;
     432             :     inline bool operator == ( const SwViewOption &rOpt ) const;
     433           1 :     inline bool operator != ( const SwViewOption &rOpt ) const  { return !(*this == rOpt); }
     434             : 
     435             :     // Options from nUIOptions
     436       16877 :     bool    IsViewVScrollBar() const
     437             :         {
     438             : #if HAVE_FEATURE_DESKTOP
     439       16877 :             return (nUIOptions & VIEWOPT_2_VSCROLLBAR) != 0;
     440             : #else
     441             :             return false;
     442             : #endif
     443             :         }
     444       16877 :     bool    IsViewHScrollBar() const
     445             :         {
     446             : #if HAVE_FEATURE_DESKTOP
     447       16877 :             return (nUIOptions & VIEWOPT_2_HSCROLLBAR) != 0;
     448             : #else
     449             :             return false;
     450             : #endif
     451             :         }
     452           0 :     bool    IsKeepRatio()      const
     453           0 :         { return (nUIOptions & VIEWOPT_2_KEEPASPECTRATIO) != 0; }
     454           0 :     bool    IsGrfKeepZoom()    const
     455           0 :         { return (nUIOptions & VIEWOPT_2_GRFKEEPZOOM) != 0; }
     456           5 :     bool    IsShowContentTips() const
     457           5 :         { return (nUIOptions & VIEWOPT_2_CONTENT_TIPS) != 0; }
     458        1736 :     bool    IsPrtFormat() const
     459        1736 :         { return (nUIOptions & VIEWOPT_2_PRTFORMAT) != 0; }
     460          62 :     bool    IsShowScrollBarTips() const
     461          62 :         { return (nUIOptions & VIEWOPT_2_SCROLLBAR_TIPS) != 0; }
     462             : 
     463       67073 :     SvxZoomType    GetZoomType()      const { return eZoom; }
     464             : 
     465           0 :     sal_uInt8   GetTableDest() const    { return nTableDest; }
     466             : 
     467          62 :     void   SetViewVScrollBar(bool b)
     468          62 :         { b ? (nUIOptions |= VIEWOPT_2_VSCROLLBAR ) : ( nUIOptions &= ~VIEWOPT_2_VSCROLLBAR); }
     469          62 :     void   SetViewHScrollBar(bool b)
     470          62 :         { b ? (nUIOptions |= VIEWOPT_2_HSCROLLBAR ) : ( nUIOptions &= ~VIEWOPT_2_HSCROLLBAR); }
     471           0 :     void   SetKeepRatio     (bool b)
     472           0 :         { b ? (nUIOptions |= VIEWOPT_2_KEEPASPECTRATIO ) : ( nUIOptions &= ~VIEWOPT_2_KEEPASPECTRATIO); }
     473           0 :     void   SetGrfKeepZoom   (bool b)
     474           0 :         { b ? (nUIOptions |= VIEWOPT_2_GRFKEEPZOOM ) : ( nUIOptions &= ~VIEWOPT_2_GRFKEEPZOOM); }
     475         118 :     void SetShowContentTips( bool b)
     476         118 :         { b ? (nUIOptions |= VIEWOPT_2_CONTENT_TIPS) : (nUIOptions &= ~VIEWOPT_2_CONTENT_TIPS); }
     477         347 :     void SetPrtFormat( bool b)
     478         347 :         { b ? (nUIOptions |= VIEWOPT_2_PRTFORMAT) : (nUIOptions &= ~VIEWOPT_2_PRTFORMAT); }
     479          60 :     void SetShowScrollBarTips( bool b)
     480          60 :         { b ? (nUIOptions |= VIEWOPT_2_SCROLLBAR_TIPS) : (nUIOptions &= ~VIEWOPT_2_SCROLLBAR_TIPS); }
     481             : 
     482        1916 :     void            SetZoomType     (SvxZoomType eZoom_){ eZoom = eZoom_;  }
     483           0 :     void            SetTableDest( sal_uInt8 nNew )    { nTableDest = nNew;  }
     484             : 
     485        2874 :     const OUString& GetSymbolFont() const {return sSymbolFont;}
     486        2874 :     void            SetSymbolFont(const OUString& sSet) {sSymbolFont = sSet;}
     487             : 
     488        9447 :     const Color&    GetRetoucheColor() const        { return aRetoucheColor;}
     489           0 :     void            SetRetoucheColor(const Color&r) { aRetoucheColor = r;   }
     490             : 
     491          65 :     bool        IsViewAnyRuler() const
     492             :         {
     493             : #if HAVE_FEATURE_DESKTOP
     494          65 :             return 0 != (nUIOptions & VIEWOPT_2_ANY_RULER);
     495             : #else
     496             :             return false;
     497             : #endif
     498             :         }
     499          62 :     void            SetViewAnyRuler(bool bSet)
     500          62 :                         { bSet ? (nUIOptions |= VIEWOPT_2_ANY_RULER) : (nUIOptions &= ~VIEWOPT_2_ANY_RULER);}
     501             : 
     502        5605 :     bool        IsViewHRuler(bool bDirect = false)     const
     503             :                         {
     504             : #if HAVE_FEATURE_DESKTOP
     505             :                             return bDirect
     506          65 :                                    ? 0 != (nUIOptions & VIEWOPT_2_H_RULER)
     507        5670 :                                    : !bReadonly && (nUIOptions & (VIEWOPT_2_ANY_RULER|VIEWOPT_2_H_RULER)) == (VIEWOPT_2_ANY_RULER|VIEWOPT_2_H_RULER);
     508             : #else
     509             :                             (void) bDirect;
     510             :                             return false;
     511             : #endif
     512             :                         }
     513          62 :     void            SetViewHRuler   (bool b)
     514          62 :                         {    b ? (nUIOptions |= VIEWOPT_2_H_RULER ) : ( nUIOptions &= ~VIEWOPT_2_H_RULER);}
     515             : 
     516        2939 :     bool            IsViewVRuler(bool bDirect = false) const
     517             :                         {
     518             : #if HAVE_FEATURE_DESKTOP
     519             :                             return bDirect
     520          65 :                                    ? 0 != (nUIOptions & VIEWOPT_2_V_RULER)
     521        3004 :                                    : !bReadonly && (nUIOptions & (VIEWOPT_2_ANY_RULER|VIEWOPT_2_V_RULER)) == (VIEWOPT_2_ANY_RULER|VIEWOPT_2_V_RULER);
     522             : #else
     523             :                             (void) bDirect;
     524             :                             return false;
     525             : #endif
     526             :                         }
     527          62 :     void            SetViewVRuler     (bool b)
     528          62 :                         { b ? (nUIOptions |= VIEWOPT_2_V_RULER ) : ( nUIOptions &= ~VIEWOPT_2_V_RULER);}
     529             : 
     530             :     // ShadowCursor, switch on/off, get/set color/mode.
     531           9 :     bool    IsShadowCursor()    const
     532           9 :         { return (nUIOptions & VIEWOPT_2_SHADOWCRSR) != 0; }
     533          59 :     void   SetShadowCursor(bool b)
     534          59 :         { b ? (nUIOptions |= VIEWOPT_2_SHADOWCRSR ) : ( nUIOptions &= ~VIEWOPT_2_SHADOWCRSR); }
     535             : 
     536             :     //move vertical ruler to the right
     537       28004 :     bool    IsVRulerRight()    const
     538       28004 :         { return (nUIOptions & VIEWOPT_2_V_RULER_RIGHT) != 0; }
     539          61 :     void   SetVRulerRight(bool b)
     540          61 :         { b ? (nUIOptions |= VIEWOPT_2_V_RULER_RIGHT ) : ( nUIOptions &= ~VIEWOPT_2_V_RULER_RIGHT); }
     541             : 
     542        2880 :     bool            IsStarOneSetting() const {return bStarOneSetting; }
     543         227 :     void            SetStarOneSetting(bool bSet) {bStarOneSetting = bSet; }
     544             : 
     545       68941 :     bool            IsPagePreview() const {return bIsPagePreview; }
     546           0 :     void            SetPagePreview(bool bSet) { bIsPagePreview= bSet; }
     547             : 
     548           0 :     sal_uInt8           GetShdwCrsrFillMode() const { return nShdwCrsrFillMode; }
     549          59 :     void            SetShdwCrsrFillMode( sal_uInt8 nMode ) { nShdwCrsrFillMode = nMode; };
     550             : 
     551           0 :     bool        IsShowPlaceHolderFields() const { return bShowPlaceHolderFields; }
     552           0 :     void            SetShowPlaceHolderFields(bool bSet) { bShowPlaceHolderFields = bSet; }
     553             : 
     554             :     static Color&   GetDocColor();
     555             :     static Color&   GetDocBoundariesColor();
     556             :     static Color&   GetAppBackgroundColor();
     557             :     static Color&   GetObjectBoundariesColor();
     558             :     static Color&   GetTableBoundariesColor();
     559             :     static Color&   GetIndexShadingsColor();
     560             :     static Color&   GetLinksColor();
     561             :     static Color&   GetVisitedLinksColor();
     562             :     static Color&   GetDirectCursorColor();
     563             :     static Color&   GetTextGridColor();
     564             :     static Color&   GetSpellColor();
     565             :     static Color&   GetSmarttagColor();
     566             :     static Color&   GetShadowColor();
     567             :     static Color&   GetFontColor();
     568             :     static Color&   GetFieldShadingsColor();
     569             :     static Color&   GetSectionBoundColor();
     570             :     static Color&   GetPageBreakColor();
     571             :     static Color&   GetHeaderFooterMarkColor();
     572             : 
     573             :     static bool     IsAppearanceFlag(sal_Int32 nFlag);
     574             : 
     575       34172 :     static bool     IsDocBoundaries()   {return IsAppearanceFlag(VIEWOPT_DOC_BOUNDARIES);}
     576           0 :     static bool     IsObjectBoundaries(){return IsAppearanceFlag(VIEWOPT_OBJECT_BOUNDARIES);}
     577         638 :     static bool     IsTableBoundaries() {return IsAppearanceFlag(VIEWOPT_TABLE_BOUNDARIES );}
     578         446 :     static bool     IsIndexShadings()   {return IsAppearanceFlag(VIEWOPT_INDEX_SHADINGS   );}
     579        2110 :     static bool     IsLinks()           {return IsAppearanceFlag(VIEWOPT_LINKS            );}
     580           0 :     static bool     IsVisitedLinks()    {return IsAppearanceFlag(VIEWOPT_VISITED_LINKS    );}
     581        3756 :     static bool     IsFieldShadings()   {return IsAppearanceFlag(VIEWOPT_FIELD_SHADINGS);}
     582          15 :     static bool     IsSectionBoundaries() {return IsAppearanceFlag(VIEWOPT_SECTION_BOUNDARIES);}
     583        8901 :     static bool     IsShadow()          {return IsAppearanceFlag(VIEWOPT_SHADOW           );}
     584             : 
     585             :     static void     SetAppearanceFlag(sal_Int32 nFlag, bool bSet, bool bSaveInConfig = false);
     586             : 
     587           3 :     static void     SetDocBoundaries(bool bSet)   {SetAppearanceFlag(VIEWOPT_DOC_BOUNDARIES, bSet);}
     588             : 
     589             :     static void     ApplyColorConfigValues(const svtools::ColorConfig& rConfig);
     590             : };
     591             : 
     592        1281 : inline bool SwViewOption::operator==( const SwViewOption &rOpt ) const
     593             : {
     594        1281 :     return IsEqualFlags( rOpt ) && nZoom == rOpt.GetZoom();
     595             : }
     596             : 
     597        4040 : inline void SwViewOption::SetUIOptions( const SwViewOption& rVOpt )
     598             : {
     599        4040 :     nUIOptions = rVOpt.nUIOptions;
     600        4040 :     nTableDest = rVOpt.nTableDest;
     601        4040 :     nShdwCrsrFillMode = rVOpt.nShdwCrsrFillMode;
     602        4040 : }
     603             : 
     604             : // Helper function for checking HTML-capabilities.
     605             : SW_DLLPUBLIC sal_uInt16     GetHtmlMode(const SwDocShell*);
     606             : 
     607             : #endif
     608             : 
     609             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11