LCOV - code coverage report
Current view: top level - sw/inc - viewsh.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 56 58 96.6 %
Date: 2015-06-13 12:38:46 Functions: 40 42 95.2 %
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             : #ifndef INCLUDED_SW_INC_VIEWSH_HXX
      20             : #define INCLUDED_SW_INC_VIEWSH_HXX
      21             : 
      22             : #include <com/sun/star/embed/XClassifiedObject.hpp>
      23             : #include <com/sun/star/embed/XEmbeddedObject.hpp>
      24             : #include <tools/rtti.hxx>
      25             : #include "swdllapi.h"
      26             : #include <swtypes.hxx>
      27             : #include <ring.hxx>
      28             : #include <swrect.hxx>
      29             : #include <boost/shared_ptr.hpp>
      30             : #include <stack>
      31             : #include <vcl/mapmod.hxx>
      32             : #include <vcl/print.hxx>
      33             : #include <vcl/vclptr.hxx>
      34             : #define LOK_USE_UNSTABLE_API
      35             : #include <LibreOfficeKit/LibreOfficeKitTypes.h>
      36             : 
      37             : namespace com { namespace sun { namespace star { namespace accessibility {
      38             :            class XAccessible; } } } }
      39             : 
      40             : class SwDoc;
      41             : class IDocumentSettingAccess;
      42             : class IDocumentDeviceAccess;
      43             : class IDocumentMarkAccess;
      44             : class IDocumentDrawModelAccess;
      45             : class IDocumentRedlineAccess;
      46             : class IDocumentLayoutAccess;
      47             : class IDocumentFieldsAccess;
      48             : class IDocumentContentOperations;
      49             : class IDocumentStylePoolAccess;
      50             : class IDocumentStatistics;
      51             : class IDocumentUndoRedo;
      52             : class IDocumentListItems;
      53             : class IDocumentOutlineNodes;
      54             : class SfxPrinter;
      55             : class SfxProgress;
      56             : class SwRootFrm;
      57             : class SwNodes;
      58             : class SdrView;
      59             : class SfxItemPool;
      60             : class SfxViewShell;
      61             : class SwViewOption;
      62             : class SwViewShellImp;
      63             : class SwPrintData;
      64             : class SwPagePreviewPrtData;
      65             : namespace vcl { class Window; }
      66             : class OutputDevice;
      67             : class SwLayIdle;
      68             : struct ShellResource;
      69             : class SwRegionRects;
      70             : class SwFrm;
      71             : class SvtAccessibilityOptions;
      72             : class SwPagePreviewLayout;
      73             : class SwTextFrm;
      74             : class BitmapEx;
      75             : 
      76             : struct SwAccessibilityOptions;
      77             : namespace vcl { class Region; }
      78             : class SwPostItMgr;
      79             : class SdrPaintWindow;
      80             : class SwAccessibleMap;
      81             : 
      82             : namespace vcl
      83             : {
      84             :     typedef OutputDevice RenderContext;
      85             :     class OldStylePrintAdaptor;
      86             : }
      87             : 
      88             : enum FrameControlType
      89             : {
      90             :     PageBreak,
      91             :     Header,
      92             :     Footer
      93             : };
      94             : 
      95             : // Define for flags needed in ctor or layers below.
      96             : // Currently the Preview flag is needed for DrawPage.
      97             : #define VSHELLFLAG_ISPREVIEW            ((long)0x1)
      98             : #define VSHELLFLAG_SHARELAYOUT          ((long)0x2)
      99             : typedef boost::shared_ptr<SwRootFrm> SwRootFrmPtr;
     100             : 
     101             : class SwViewShell;
     102             : class SW_DLLPUBLIC SwViewShell : public sw::Ring<SwViewShell>
     103             : {
     104             :     friend void SetOutDev( SwViewShell *pSh, OutputDevice *pOut );
     105             :     friend void SetOutDevAndWin( SwViewShell *pSh, OutputDevice *pOut,
     106             :                                  vcl::Window *pWin, sal_uInt16 nZoom );
     107             : 
     108             :     friend class SwViewShellImp;
     109             :     friend class SwLayIdle;
     110             : 
     111             :     // For setting visible area for page preview paint.
     112             :     friend class SwPagePreviewLayout;
     113             : 
     114             :     // Set SwVisArea in order to enable clean formatting before printing.
     115             :     friend void SetSwVisArea( SwViewShell *pSh, const SwRect & );
     116             : 
     117             :     static BitmapEx*    mpReplaceBmp;    ///< replaced display of still loaded images
     118             :     static BitmapEx*    mpErrorBmp;      ///< error display of missed images
     119             : 
     120             :     static bool mbLstAct;        // true if EndAction of last Shell
     121             :                                     // i.e. if the EndActions of the other
     122             :                                     // Shells on the document are through.
     123             : 
     124             :     Point         maPrtOffst;         // Ofst for Printer,
     125             :                                      // non-printable margin.
     126             :      Size         maBrowseBorder;     // Border for frame documents.
     127             :     SwRect        maInvalidRect;
     128             : 
     129             :     SfxViewShell *mpSfxViewShell;
     130             :     SwViewShellImp *mpImp;           // Core-internals of SwViewShell.
     131             :                                      // The pointer is never 0.
     132             : 
     133             :     VclPtr<vcl::Window>   mpWin;     ///< = 0 during printing or pdf export
     134             :     VclPtr<OutputDevice>  mpOut;     ///< Window, Printer, VirtDev, ...
     135             :     VclPtr<OutputDevice>  mpTmpRef;  // Temporariy reference device. Is used
     136             :                                      // during (printer depending) prospect
     137             :                                      // and page preview printing
     138             :                                      // (because a scaling has to be set at
     139             :                                      // the original printer)
     140             : 
     141             :     SwViewOption *mpOpt;
     142             :     SwAccessibilityOptions* mpAccOptions;
     143             : 
     144             :     bool  mbDocSizeChgd     :1;  // For DocChgNotify(): Announce new DocSize
     145             :                                     // at EndAction to DocMDI.
     146             :     bool  mbPaintWorks      :1;  // Normal Painting if true,
     147             :                                     // remember Paint if false.
     148             :     bool  mbPaintInProgress :1;  // Block any double paint.
     149             :     bool  mbViewLocked      :1;  // Lock visible range;
     150             :                                     // in this case MakeVisible is ineffectual.
     151             :     bool  mbInEndAction     :1;  // Avoid problems, cf. viewsh.cxx.
     152             :     bool  mbPreview         :1;  // If true it is a Preview-SwViewShell.
     153             :     bool  mbFrameView       :1;  // If true it is a  (HTML-)Frame.
     154             :     bool  mbEnableSmooth    :1;  // Disable SmoothScroll, e.g. for drag
     155             :                                     // of scrollbars.
     156             :     bool  mbEndActionByVirDev:1; // Paints from EndAction always via virtual device
     157             :                                     // (e.g. when browsing).
     158             :     bool      mbShowHeaderSeparator:1; ///< Flag to say that we are showing the header control
     159             :     bool      mbShowFooterSeparator:1; ///< Flag to say that we are showing the footer control
     160             :     bool      mbHeaderFooterEdit:1;  ///< Flag to say that we are editing header or footer (according to the bShow(Header|Footer)Separator above)
     161             : 
     162             :     // boolean, indicating that class in constructor.
     163             :     bool mbInConstructor:1;
     164             : 
     165             :     SdrPaintWindow*         mpTargetPaintWindow;
     166             :     VclPtr<OutputDevice>    mpBufferedOut;
     167             : 
     168             :     SwRootFrmPtr            mpLayout;
     169             : 
     170             :     // Initialization; called by the diverse constructors.
     171             :     SAL_DLLPRIVATE void Init( const SwViewOption *pNewOpt );
     172             : 
     173             :     inline void ResetInvalidRect();
     174             : 
     175             :     SAL_DLLPRIVATE void Reformat();          // Invalidates complete Layout (ApplyViewOption).
     176             : 
     177             :     SAL_DLLPRIVATE void PaintDesktop(vcl::RenderContext& rRenderContext, const SwRect&);  // Collect values for painting of desktop
     178             :                                                         // and calling.
     179             :     // PaintDesktop split. This pars is also used by PreviewPage.
     180             :     SAL_DLLPRIVATE void _PaintDesktop(vcl::RenderContext& rRenderContext, const SwRegionRects &rRegion);
     181             : 
     182             :     SAL_DLLPRIVATE bool CheckInvalidForPaint( const SwRect & );  // Direct Paint or rather
     183             :                                                                     // trigger an action.
     184             : 
     185             :     SAL_DLLPRIVATE void PrepareForPrint( const SwPrintData &rOptions );
     186             : 
     187             :     SAL_DLLPRIVATE void ImplApplyViewOptions( const SwViewOption &rOpt );
     188             : 
     189             : protected:
     190             :     static ShellResource*      mpShellRes;      ///< Resources for the Shell.
     191             :     static VclPtr<vcl::Window> mpCareWindow;    ///< Avoid this window.
     192             : 
     193             :     SwRect                  maVisArea;       ///< The modern version of VisArea.
     194             :     SwDoc                   *mpDoc;          ///< The document; never 0.
     195             : 
     196             :     sal_uInt16 mnStartAction; ///< != 0 if at least one Action is active.
     197             :     sal_uInt16 mnLockPaint;   ///< != 0 if Paint is locked.
     198             :     bool      mbSelectAll; ///< Special select all mode: whole document selected, even if doc starts with table.
     199             : 
     200             :     bool mbInLibreOfficeKitCallback;
     201             : 
     202             : public:
     203             :     TYPEINFO();
     204             : 
     205   135160700 :           SwViewShellImp *Imp() { return mpImp; }
     206      486175 :     const SwViewShellImp *Imp() const { return mpImp; }
     207             : 
     208             :     const SwNodes& GetNodes() const;
     209             : 
     210             :     // After change of printer; by Doc.
     211             :     void            InitPrt( OutputDevice *pOutDev );
     212             : 
     213             :     // Bracketing of actions belonging together.
     214             :     inline void StartAction();
     215             :            void ImplStartAction();
     216             :     inline void EndAction( const bool bIdleEnd = false );
     217             :            void ImplEndAction( const bool bIdleEnd = false );
     218         175 :     sal_uInt16 ActionCount() const { return mnStartAction; }
     219    27058795 :     bool ActionPend() const { return mnStartAction != 0; }
     220        9764 :     bool IsInEndAction() const { return mbInEndAction; }
     221             : 
     222       42384 :     void SetEndActionByVirDev( bool b ) { mbEndActionByVirDev = b; }
     223       25421 :     bool IsEndActionByVirDev()          { return mbEndActionByVirDev; }
     224             : 
     225             :     // The ActionCount for all Shells is temporarily set to zero and then
     226             :     // restored at the RootFrame via UNO.
     227             :     void    SetRestoreActions(sal_uInt16 nSet);
     228             :     sal_uInt16  GetRestoreActions() const;
     229             : 
     230           0 :     inline bool HasInvalidRect() const { return maInvalidRect.HasArea(); }
     231           1 :     void ChgHyphenation() { Reformat(); }
     232             :     void ChgNumberDigits();
     233             : 
     234             :     bool AddPaintRect( const SwRect &rRect );
     235             : 
     236             :     void InvalidateWindows( const SwRect &rRect );
     237             : 
     238             :     // #i72754# set of Pre/PostPaints with lock counter and initial target OutDev
     239             : protected:
     240             :     std::stack<vcl::Region> mPrePostPaintRegions; // acts also as a lock counter (empty == not locked)
     241             :     VclPtr<OutputDevice>    mpPrePostOutDev;
     242             :     MapMode                 maPrePostMapMode;
     243             : public:
     244             :     void PrePaint();
     245             :     void DLPrePaint2(const vcl::Region& rRegion);
     246             :     void DLPostPaint2(bool bPaintFormLayer);
     247         592 :     const MapMode& getPrePostMapMode() const { return maPrePostMapMode; }
     248             : 
     249             :     virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRect);
     250             : 
     251             :     /** Paint tile.
     252             : 
     253             :         Sets the pOut so that the rRect is always painted over the entire
     254             :         pOut, ie. starts in 0,0 and ends in width/height.
     255             :     */
     256             :     void PaintTile(VirtualDevice &rDevice, int contextWidth, int contextHeight, int tilePosX, int tilePosY, long tileWidth, long tileHeight);
     257             : 
     258        5104 :     bool IsPaintInProgress() const { return mbPaintInProgress; }
     259         474 :     bool IsDrawingLayerPaintInProgress() const { return !mPrePostPaintRegions.empty(); }
     260             : 
     261             :     // Notification that visible area has been changed.
     262             :     // VisArea is reset, after that scrolling takes place.
     263             :     // The passed rect is situated on pixel borders
     264             :     // in order to avoid pixel errors when scrolling.
     265             :     virtual void VisPortChgd( const SwRect & );
     266             :     bool SmoothScroll( long lXDiff, long lYDiff, const Rectangle* );//Browser
     267    53555458 :     void EnableSmooth( bool b ) { mbEnableSmooth = b; }
     268             : 
     269   134317821 :     const SwRect& VisArea() const { return maVisArea; }
     270             : 
     271             :     // If necessary scroll until passed Rect is situated in visible sector.
     272             :     void MakeVisible( const SwRect & );
     273             : 
     274             :     // At nearest occasion pass new document size to UI.
     275             :     void SizeChgNotify();
     276             :     void UISizeNotify();            // Passing of current size.
     277             : 
     278             :     Point GetPagePos( sal_uInt16 nPageNum ) const;
     279             : 
     280             :     sal_uInt16 GetNumPages();   // Ask count of current pages from layout.
     281             :     bool   IsDummyPage( sal_uInt16 nPageNum ) const;  // An empty page?
     282             : 
     283             :     // Invalidate first visible page for all Shells in ring.
     284             :     void SetFirstVisPageInvalid();
     285             : 
     286             :     SwRootFrm   *GetLayout() const;
     287             :     bool         IsNewLayout() const; // Has Layout been loaded or created?
     288             : 
     289             :      Size GetDocSize() const;   // Get document size.
     290             : 
     291             :     virtual void CalcLayout();  // Force complete formatting of layout.
     292             : 
     293             :     sal_uInt16 GetPageCount() const;
     294             : 
     295             :     const Size GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const;
     296             : 
     297   255977930 :     inline SwDoc *GetDoc()  const { return mpDoc; }  //Never 0.
     298             : 
     299             :     /** Provides access to the document setting interface
     300             :      */
     301             :     const IDocumentSettingAccess* getIDocumentSettingAccess() const;
     302             :           IDocumentSettingAccess* getIDocumentSettingAccess();
     303             : 
     304             :     /** Provides access to the document device interface
     305             :      */
     306             :     const IDocumentDeviceAccess* getIDocumentDeviceAccess() const;
     307             :           IDocumentDeviceAccess* getIDocumentDeviceAccess();
     308             : 
     309             :     /** Provides access to the document bookmark interface
     310             :      */
     311             :     const IDocumentMarkAccess* getIDocumentMarkAccess() const;
     312             :           IDocumentMarkAccess* getIDocumentMarkAccess();
     313             : 
     314             :     /** Provides access to the document draw model interface
     315             :      */
     316             :     const IDocumentDrawModelAccess* getIDocumentDrawModelAccess() const;
     317             :           IDocumentDrawModelAccess* getIDocumentDrawModelAccess();
     318             : 
     319             :     /** Provides access to the document redline interface
     320             :      */
     321             :     const IDocumentRedlineAccess* getIDocumentRedlineAccess() const;
     322             :           IDocumentRedlineAccess* getIDocumentRedlineAccess();
     323             : 
     324             :     /** Provides access to the document layout interface
     325             :      */
     326             :     const IDocumentLayoutAccess* getIDocumentLayoutAccess() const;
     327             :           IDocumentLayoutAccess* getIDocumentLayoutAccess();
     328             : 
     329             :     /** Provides access to the content operations interface
     330             :      */
     331             :     IDocumentContentOperations* getIDocumentContentOperations();
     332             : 
     333             :     /** Provides access to the document style pool interface
     334             :      */
     335             :     IDocumentStylePoolAccess* getIDocumentStylePoolAccess();
     336             : 
     337             :     /** Provides access to the document statistics interface
     338             :      */
     339             :     const IDocumentStatistics* getIDocumentStatistics() const;
     340             : 
     341             :     /** Provides access to the document undo/redo interface
     342             :      */
     343             :     IDocumentUndoRedo const& GetIDocumentUndoRedo() const;
     344             :     IDocumentUndoRedo      & GetIDocumentUndoRedo();
     345             : 
     346             :     const IDocumentListItems* getIDocumentListItemsAccess() const;
     347             :     const IDocumentOutlineNodes* getIDocumentOutlineNodesAccess() const;
     348             : 
     349             :     // 1. GetRefDev:   Either the printer or the virtual device from the doc
     350             :     // 2. GetWin:      Available if we not printing
     351             :     // 3. GetOut:      Printer, Window or Virtual device
     352             :     vcl::RenderContext& GetRefDev() const;
     353    57650734 :     inline vcl::Window* GetWin()    const { return mpWin; }
     354     1327272 :     inline vcl::RenderContext* GetOut()     const { return mpOut; }
     355             : 
     356           0 :     void SetWin(vcl::Window* win) { mpWin = win; }
     357        2454 :     static inline bool IsLstEndAction() { return SwViewShell::mbLstAct; }
     358             : 
     359             :     // Change of all page descriptors.
     360             :     void   ChgAllPageOrientation( Orientation eOri );
     361             :     void   ChgAllPageSize( Size &rSz );
     362             : 
     363             :     // Printing of one page.
     364             :     // bIsPDFExport == true is: do PDF Export (no printing!)
     365             :     bool PrintOrPDFExport( OutputDevice *pOutDev,
     366             :             SwPrintData const& rPrintData,
     367             :             sal_Int32 nRenderer /* offset in vector of pages to print */ );
     368             : 
     369             :     // Printing of one brochure page.
     370             :     void PrintProspect( OutputDevice *pOutDev, const SwPrintData &rPrintData,
     371             :             sal_Int32 nRenderer /* offset in vector of page pairs for prospect printing */ );
     372             : 
     373             :     // Printing for OLE 2.0.
     374             :     static void PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintData& rOptions,
     375             :                          OutputDevice* pOleOut, const Rectangle& rRect );
     376             : 
     377             :     // Fill temporary doc with selected text for Print or PDF export.
     378             :     SwDoc * FillPrtDoc( SwDoc* pPrtDoc, const SfxPrinter* pPrt );
     379             : 
     380             :     // Called internally for Shell. Formats pages.
     381             :     void CalcPagesForPrint( sal_uInt16 nMax );
     382             : 
     383             :     // All about fields.
     384             :     void UpdateFields(bool bCloseDB = false);
     385             :     bool IsAnyFieldInDoc() const;
     386             :     // Update all charts, for that exists any table.
     387             :     void UpdateAllCharts();
     388             :     bool HasCharts() const;
     389             : 
     390             :     // DOCUMENT COMPATIBILITY FLAGS START
     391             : 
     392             :     // Add or maximize paragraph spacing?
     393             :     void SetParaSpaceMax( bool bNew );
     394             : 
     395             :     // Add or maximize paragraph spacing?
     396             :     void SetParaSpaceMaxAtPages( bool bNew );
     397             : 
     398             :     // Compatible behaviour of tabs.
     399             :     void SetTabCompat( bool bNew );
     400             : 
     401             :     // Font metric attribute "External Leading" should be considered.
     402             :     void SetAddExtLeading( bool bNew );
     403             : 
     404             :     // Formatting by virtual device or printer.
     405             :     void SetUseVirDev( bool nNew );
     406             : 
     407             :     // Adding paragraph and table spacing at bottom
     408             :     // of table cells.
     409             :     void SetAddParaSpacingToTableCells( bool _bAddParaSpacingToTableCells );
     410             : 
     411             :     // Former formatting of text lines with
     412             :     // proportional line spacing or not.
     413             :     void SetUseFormerLineSpacing( bool _bUseFormerLineSpacing );
     414             : 
     415             :     // Former object positioning.
     416             :     void SetUseFormerObjectPositioning( bool _bUseFormerObjPos );
     417             : 
     418             :     void SetConsiderWrapOnObjPos( bool _bConsiderWrapOnObjPos );
     419             : 
     420             :     void SetUseFormerTextWrapping( bool _bUseFormerTextWrapping );
     421             : 
     422             :     void SetDoNotJustifyLinesWithManualBreak( bool _bDoNotJustifyLinesWithManualBreak );
     423             : 
     424             :     // DOCUMENT COMPATIBILITY FLAGS END
     425             : 
     426             :     // Calls Idle-formatter of Layout.
     427             :     void LayoutIdle();
     428             : 
     429   258865478 :     inline const SwViewOption *GetViewOptions() const { return mpOpt; }
     430             :     virtual void  ApplyViewOptions( const SwViewOption &rOpt );
     431             :            void  SetUIOptions( const SwViewOption &rOpt );
     432             :     virtual void  SetReadonlyOption(bool bSet);          // Set readonly-bit of ViewOptions.
     433             :            void  SetPDFExportOption(bool bSet);         // Set/reset PDF export mode.
     434             :            void  SetPrtFormatOption(bool bSet);         // Set PrtFormat-Bit of ViewOptions.
     435             :            void  SetReadonlySelectionOption(bool bSet); // Change the selection mode in readonly docs.
     436             : 
     437       20876 :     const SwAccessibilityOptions* GetAccessibilityOptions() const { return mpAccOptions;}
     438             : 
     439         118 :     static void           SetShellRes( ShellResource* pRes ) { mpShellRes = pRes; }
     440             :     static ShellResource* GetShellRes();
     441             : 
     442             :     static void           SetCareWin( vcl::Window* pNew );
     443       35353 :     static vcl::Window*   GetCareWin(SwViewShell& rVSh)
     444       35353 :                           { return mpCareWindow ? mpCareWindow.get() : CareChildWin(rVSh); }
     445             :     static vcl::Window*   CareChildWin(SwViewShell& rVSh);
     446             : 
     447       44123 :     inline SfxViewShell   *GetSfxViewShell() { return mpSfxViewShell; }
     448        2761 :     inline void           SetSfxViewShell(SfxViewShell *pNew) { mpSfxViewShell = pNew; }
     449             : 
     450             :     // Selection of  Draw Engine has been changed.
     451             :     virtual void DrawSelChanged();
     452             : 
     453             :     SwPagePreviewLayout* PagePreviewLayout();
     454             : 
     455             :     /** adjust view options for page preview
     456             : 
     457             :         Because page preview should show the document as it is printed -
     458             :         page preview is print preview -, the view options are adjusted to the
     459             :         same as for printing.
     460             : 
     461             :         @param _rPrintOptions
     462             :         input parameter - constant reference to print options, to which the
     463             :         view option will be adjusted.
     464             :     */
     465             :     void AdjustOptionsForPagePreview( SwPrintData const& rPrintOptions );
     466             : 
     467       32287 :     bool IsViewLocked() const { return mbViewLocked; }
     468       60938 :     void LockView( bool b )   { mbViewLocked = b;    }
     469             : 
     470             :     inline void LockPaint();
     471             :            void ImplLockPaint();
     472             :     inline void UnlockPaint( bool bVirDev = false );
     473             :            void ImplUnlockPaint( bool bVirDev );
     474       98740 :            bool IsPaintLocked() const { return mnLockPaint != 0; }
     475             : 
     476             :     // Get/set DrawView and PageView.
     477             :     bool HasDrawView() const;
     478             :     void MakeDrawView();
     479             : 
     480             :     // DrawView may be used at UI.
     481             :           SdrView *GetDrawView();
     482      198484 :     const SdrView *GetDrawView() const { return const_cast<SwViewShell*>(this)->GetDrawView(); }
     483             : 
     484             :     // Take care that MarkList is up-to-date in any case (Bug 57153).
     485             :     SdrView *GetDrawViewWithValidMarkList();
     486             : 
     487             :     // Query attribute pool.
     488             :     inline const SfxItemPool& GetAttrPool() const;
     489             :                  SfxItemPool& GetAttrPool();
     490             : 
     491      148258 :     bool IsPreview() const { return mbPreview; }
     492             : 
     493         448 :     bool IsFrameView()  const { return mbFrameView; }
     494             :     void SetFrameView( const Size& rBrowseBorder )
     495             :            { mbFrameView = true; maBrowseBorder = rBrowseBorder; }
     496             : 
     497             :     // Makes the necessary invalidations:
     498             :     // If BrowseMode has changed bBrowseChgd == true
     499             :     // or bBrowseChgd == false in BrowseMode
     500             :     // if proportions have changed.
     501             :     void CheckBrowseView( bool bBrowseChgd );
     502             : 
     503             :     const Size& GetBrowseBorder() const;
     504             :     sal_Int32 GetBrowseWidth() const;
     505             :     void SetBrowseBorder( const Size& rNew );
     506             : 
     507             :     ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
     508             : 
     509             :     ::com::sun::star::uno::Reference<
     510             :         ::com::sun::star::accessibility::XAccessible >
     511             :             CreateAccessiblePreview();
     512             : 
     513             :     void ShowPreviewSelection( sal_uInt16 nSelPage );
     514             :     void InvalidateAccessibleFocus();
     515             : 
     516             :     // Apply Accessiblity options.
     517             :     void ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions);
     518             : 
     519             :     /** invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
     520             : 
     521             :         @author OD
     522             : 
     523             :         @param _pFromTextFrm
     524             :         input parameter - paragraph frame, for which the relation CONTENT_FLOWS_FROM
     525             :         has to be invalidated.
     526             :         If NULL, no CONTENT_FLOWS_FROM relation has to be invalidated
     527             : 
     528             :         @param _pToTextFrm
     529             :         input parameter - paragraph frame, for which the relation CONTENT_FLOWS_TO
     530             :         has to be invalidated.
     531             :         If NULL, no CONTENT_FLOWS_TO relation has to be invalidated
     532             :     */
     533             :     void InvalidateAccessibleParaFlowRelation( const SwTextFrm* _pFromTextFrm,
     534             :                                                const SwTextFrm* _pToTextFrm );
     535             : 
     536             :     /** invalidate text selection for paragraphs
     537             : 
     538             :         @author OD
     539             :     */
     540             :     void InvalidateAccessibleParaTextSelection();
     541             : 
     542             :     /** invalidate attributes for paragraphs and paragraph's characters
     543             : 
     544             :         usage also for changes of the attributes of
     545             :         paragraph's characters.
     546             : 
     547             :         @author OD
     548             : 
     549             :         @param rTextFrm
     550             :         input parameter - paragraph frame, whose attributes have changed
     551             :     */
     552             :     void InvalidateAccessibleParaAttrs( const SwTextFrm& rTextFrm );
     553             : 
     554             :     SwAccessibleMap* GetAccessibleMap();
     555             : 
     556             :     SwViewShell( SwViewShell&, vcl::Window *pWin = 0, OutputDevice *pOut = 0,
     557             :                 long nFlags = 0 );
     558             :     SwViewShell( SwDoc& rDoc, vcl::Window *pWin,
     559             :                const SwViewOption *pOpt = 0, OutputDevice *pOut = 0,
     560             :                long nFlags = 0 );
     561             :     virtual ~SwViewShell();
     562             : 
     563             :     sal_Int32 GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const SwRect& rRect ) const;
     564             : 
     565       46245 :     inline bool IsInConstructor() const { return mbInConstructor; }
     566             : 
     567             :     static const BitmapEx& GetReplacementBitmap( bool bIsErrorState );
     568             :     static void DeleteReplacementBitmaps();
     569             : 
     570       74857 :     const SwPostItMgr* GetPostItMgr() const { return (const_cast<SwViewShell*>(this))->GetPostItMgr(); }
     571             :     SwPostItMgr* GetPostItMgr();
     572             : 
     573             :     /// Acts both for headers / footers, depending on the bShow(Header|Footer)Separator flags
     574             :     void ToggleHeaderFooterEdit();
     575             :     /// Acts both for headers / footers, depending on the bShow(Header|Footer)Separator flags
     576        9160 :     bool IsHeaderFooterEdit() const { return mbHeaderFooterEdit; }
     577       21640 :     bool IsShowHeaderFooterSeparator( FrameControlType eControl ) { return (eControl == Header)? mbShowHeaderSeparator: mbShowFooterSeparator; }
     578           4 :     virtual void SetShowHeaderFooterSeparator( FrameControlType eControl, bool bShow ) { if ( eControl == Header ) mbShowHeaderSeparator = bShow; else mbShowFooterSeparator = bShow; }
     579         381 :     bool IsSelectAll() { return mbSelectAll; }
     580             : 
     581             :     /// The actual implementation of the vcl::ITiledRenderable::registerCallback() API for Writer.
     582             :     void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData);
     583             :     /// Invokes the registered callback, if there are any.
     584             :     void libreOfficeKitCallback(int nType, const char* pPayload) const;
     585             :     /// Set if we are doing tiled rendering.
     586             :     void setTiledRendering(bool bTiledRendering);
     587             :     /// Are we doing tiled rendering?
     588             :     bool isTiledRendering() const;
     589             : 
     590             : };
     591             : 
     592             : // manages global ShellPointer
     593             : class CurrShell
     594             : {
     595             : public:
     596             :     SwViewShell *pPrev;
     597             :     SwRootFrm *pRoot;
     598             : 
     599             :     CurrShell( SwViewShell *pNew );
     600             :     ~CurrShell();
     601             : };
     602             : 
     603        2130 : inline void SwViewShell::ResetInvalidRect()
     604             : {
     605        2130 :    maInvalidRect.Clear();
     606        2130 : }
     607             : 
     608       62979 : inline void SwViewShell::StartAction()
     609             : {
     610       62979 :     if ( !mnStartAction++ )
     611       41254 :         ImplStartAction();
     612       62979 : }
     613       62979 : inline void SwViewShell::EndAction( const bool bIdleEnd )
     614             : {
     615       62979 :     if( 0 == (mnStartAction - 1) )
     616       41254 :         ImplEndAction( bIdleEnd );
     617       62979 :     --mnStartAction;
     618       62979 : }
     619             : 
     620       15208 : inline void SwViewShell::LockPaint()
     621             : {
     622       15208 :     if ( !mnLockPaint++ )
     623       14996 :         ImplLockPaint();
     624       15208 : }
     625       15208 : inline void SwViewShell::UnlockPaint( bool bVirDev )
     626             : {
     627       15208 :     if ( 0 == --mnLockPaint )
     628       14996 :         ImplUnlockPaint( bVirDev );
     629       15208 : }
     630             : inline const SfxItemPool& SwViewShell::GetAttrPool() const
     631             : {
     632             :     return const_cast<SwViewShell*>(this)->GetAttrPool();
     633             : }
     634             : 
     635             : #endif // INCLUDED_SW_INC_VIEWSH_HXX
     636             : 
     637             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11