LCOV - code coverage report
Current view: top level - sw/source/uibase/inc - view.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 28 53 52.8 %
Date: 2014-11-03 Functions: 25 44 56.8 %
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_SOURCE_UIBASE_INC_VIEW_HXX
      20             : #define INCLUDED_SW_SOURCE_UIBASE_INC_VIEW_HXX
      21             : 
      22             : #include <vcl/timer.hxx>
      23             : #include <vcl/field.hxx>
      24             : #include <vcl/floatwin.hxx>
      25             : #include <svtools/htmlcfg.hxx>
      26             : #include <sfx2/viewfac.hxx>
      27             : #include <sfx2/viewsh.hxx>
      28             : #include <sfx2/objsh.hxx>
      29             : #include <editeng/svxenum.hxx>
      30             : #include <sfx2/zoomitem.hxx>
      31             : #include <svx/svxids.hrc>
      32             : #include <svx/fmshell.hxx>
      33             : #include <editeng/editstat.hxx>
      34             : #include "swdllapi.h"
      35             : #include <swtypes.hxx>
      36             : #include <shellid.hxx>
      37             : #include <IMark.hxx>
      38             : 
      39             : class Button;
      40             : class ImageButton;
      41             : class SwTxtFmtColl;
      42             : class SwPageDesc;
      43             : class SwFrmFmt;
      44             : class SwCharFmt;
      45             : class SwNumRule;
      46             : class SwGlossaryHdl;
      47             : class SwDrawBase;
      48             : class SvxRuler;
      49             : class SvxLRSpaceItem;
      50             : class SwDocShell;
      51             : class SwScrollbar;
      52             : class SvBorder;
      53             : class Ruler;
      54             : class SvxSearchItem;
      55             : class SearchAttrItemList;
      56             : class SvxSearchDialog;
      57             : class SdrView;
      58             : class Dialog;
      59             : class SdrObject;
      60             : class SdrPageView;
      61             : class SwHlpImageButton;
      62             : class SwView;
      63             : class SwEditWin;
      64             : class SwWrtShell;
      65             : class SwView_Impl;
      66             : struct SwSearchOptions;
      67             : class CommandEvent;
      68             : class InsCaptionOpt;
      69             : class SvGlobalName;
      70             : class SvtAccessibilityOptions;
      71             : class SwTransferable;
      72             : class SwMailMergeConfigItem;
      73             : class SwTxtNode; // #i23726#
      74             : class SwFormatClipboard;
      75             : struct SwConversionArgs;
      76             : class Graphic;
      77             : class GraphicFilter;
      78             : class SwPostItMgr;
      79             : 
      80             : namespace com{ namespace sun { namespace star {
      81             :     namespace view{ class XSelectionSupplier; }
      82             : }}}
      83             : namespace sfx2 { class FileDialogHelper; }
      84             : 
      85             : const long nLeftOfst = -370;
      86             : const long nScrollX  =   30;
      87             : const long nScrollY  =   30;
      88             : 
      89             : #define MINZOOM 20
      90             : #define MAXZOOM 600
      91             : 
      92             : #define MAX_MARKS 5
      93             : 
      94             : #define CHILDWIN_LABEL      1
      95             : #define CHILDWIN_MAILMERGE  2
      96             : 
      97             : enum ShellModes
      98             : {
      99             :     SHELL_MODE_TEXT,
     100             :     SHELL_MODE_FRAME,
     101             :     SHELL_MODE_GRAPHIC,
     102             :     SHELL_MODE_OBJECT,
     103             :     SHELL_MODE_DRAW,
     104             :     SHELL_MODE_DRAW_CTRL,
     105             :     SHELL_MODE_DRAW_FORM,
     106             :     SHELL_MODE_DRAWTEXT,
     107             :     SHELL_MODE_BEZIER,
     108             :     SHELL_MODE_LIST_TEXT,
     109             :     SHELL_MODE_TABLE_TEXT,
     110             :     SHELL_MODE_TABLE_LIST_TEXT,
     111             :     SHELL_MODE_MEDIA,
     112             :     SHELL_MODE_EXTRUDED_CUSTOMSHAPE,
     113             :     SHELL_MODE_FONTWORK,
     114             :     SHELL_MODE_POSTIT,
     115             :     SHELL_MODE_NAVIGATION
     116             : };
     117             : 
     118             : // apply a template
     119             : struct SwApplyTemplate
     120             : {
     121             :     union
     122             :     {
     123             :         SwTxtFmtColl* pTxtColl;
     124             :         SwPageDesc*   pPageDesc;
     125             :         SwFrmFmt*     pFrmFmt;
     126             :         SwCharFmt*    pCharFmt;
     127             :         SwNumRule*    pNumRule;
     128             :     } aColl;
     129             : 
     130             :     int eType;
     131             :     sal_uInt16 nColor;
     132             :     SwFormatClipboard* m_pFormatClipboard;
     133             :     bool bUndo;
     134             : 
     135           0 :     SwApplyTemplate() :
     136             :         eType(0),
     137             :         nColor(0),
     138             :         m_pFormatClipboard(0),
     139           0 :         bUndo(false)
     140             :     {
     141           0 :         aColl.pTxtColl = 0;
     142           0 :     }
     143             : };
     144             : 
     145             : // view of a document
     146             : class SW_DLLPUBLIC SwView: public SfxViewShell
     147             : {
     148             :     friend class SwHHCWrapper;
     149             :     friend class SwHyphWrapper;
     150             :     friend class SwView_Impl;
     151             :     friend class SwClipboardChangeListener;
     152             : 
     153             :     // search & replace
     154             :     static SvxSearchDialog *m_pSrchDlg;
     155             :     static SvxSearchItem   *m_pSrchItem;
     156             : 
     157             :     static sal_uInt16           m_nInsertCtrlState;
     158             :     static sal_uInt16           m_nWebInsertCtrlState;
     159             :     static sal_uInt16           m_nInsertObjectCtrlState;
     160             :     static sal_uInt16           m_nInsertFieldCtrlState;
     161             :     static sal_uInt16           m_nMoveType; // for buttons below the scrollbar (viewmdi)
     162             :     static sal_Int32        m_nActMark; // current jump mark for unknown mark
     163             : 
     164             :     static bool             m_bExtra;
     165             :     static bool             m_bFound;
     166             :     static bool             m_bJustOpened;
     167             : 
     168             :     static SearchAttrItemList* m_pSrchList;
     169             :     static SearchAttrItemList* m_pReplList;
     170             : 
     171             :     SvxHtmlOptions      m_aHTMLOpt;
     172             :     Timer               m_aTimer;         // for delayed ChgLnks during an action
     173             :     OUString            m_sSwViewData,
     174             :     //and the new cursor position if the user double click in the PagePreview
     175             :                         m_sNewCrsrPos;
     176             :     // to support keyboard the number of the page to go to can be set too
     177             :     sal_uInt16              m_nNewPage;
     178             : 
     179             :     sal_uInt16          m_nOldPageNum;
     180             :     OUString            m_sOldSectionName;
     181             : 
     182             :     Point               m_aTabColFromDocPos;  // moving table colmns out of the document
     183             :     SwTxtNode           * m_pNumRuleNodeFromDoc; // Moving indent of numrule #i23726#
     184             : 
     185             :     Size                m_aDocSz;         // current document size
     186             :     Rectangle           m_aVisArea;       // visible region
     187             : 
     188             :     SwEditWin           *m_pEditWin;
     189             :     SwWrtShell          *m_pWrtShell;
     190             : 
     191             :     SfxShell            *m_pShell;        // current SubShell at the dispatcher
     192             :     FmFormShell         *m_pFormShell;    // DB-FormShell
     193             : 
     194             :     SwView_Impl         *m_pViewImpl;     // Impl-data for UNO + Basic
     195             : 
     196             :     SwScrollbar         *m_pHScrollbar,   // MDI control elements
     197             :                         *m_pVScrollbar;
     198             : 
     199             :     bool                m_bHScrollbarEnabled;
     200             :     bool                m_bVScrollbarEnabled;
     201             : 
     202             :     ::vcl::Window       *m_pScrollFill;   // dummy window for filling the lower right edge
     203             :                                         // when both scrollbars are active
     204             : 
     205             :     SvxRuler            *m_pHRuler,
     206             :                         *m_pVRuler;
     207             :     ImageButton         *m_pTogglePageBtn;
     208             : 
     209             :     SwHlpImageButton    *m_pPageUpBtn,
     210             :                         *m_pPageDownBtn;
     211             : 
     212             :     SwGlossaryHdl       *m_pGlosHdl;          // handle text block
     213             :     SwDrawBase          *m_pDrawActual;
     214             : 
     215             :     const SwFrmFmt      *m_pLastTableFormat;
     216             : 
     217             :     SwFormatClipboard   *m_pFormatClipboard; //holds data for format paintbrush
     218             : 
     219             :     SwPostItMgr         *m_pPostItMgr;
     220             : 
     221             :     int                 m_nSelectionType;
     222             :     FloatingWindow      *m_pFieldPopup;
     223             : 
     224             :     static const int m_nMASTERENUMCOMMANDS = 6;
     225             : 
     226             :     OUString            m_aCurrShapeEnumCommand[ m_nMASTERENUMCOMMANDS ];
     227             : 
     228             :     sal_uInt16          m_nPageCnt;
     229             : 
     230             :     // current draw mode
     231             :     sal_uInt16          m_nDrawSfxId;
     232             :     OUString            m_sDrawCustom; //some drawing types are marked with strings!
     233             :     sal_uInt16          m_nFormSfxId;
     234             :     sal_uInt16          m_nLastPasteDestination;
     235             : 
     236             :     // save the border distance status from SwView::StateTabWin to re-use it in SwView::ExecTabWin()
     237             :     sal_uInt16          m_nLeftBorderDistance;
     238             :     sal_uInt16          m_nRightBorderDistance;
     239             : 
     240             :     bool m_bWheelScrollInProgress;
     241             : 
     242             :     bool            m_bCenterCrsr : 1,
     243             :                     m_bTopCrsr : 1,
     244             :                     m_bAlwaysShowSel : 1,
     245             :                     m_bTabColFromDoc : 1,
     246             :                     m_bNumIndentFromDoc : 1, // #i23726#
     247             :                     m_bTabRowFromDoc : 1,
     248             :                     m_bSetTabColFromDoc : 1 ,
     249             :                     m_bSetTabRowFromDoc : 1,
     250             :                     m_bAttrChgNotified : 1,
     251             :                     m_bAttrChgNotifiedWithRegistrations : 1,
     252             :                     m_bVerbsActive : 1,
     253             :                     m_bDrawRotate : 1,
     254             :                     m_bDrawSelMode : 1,
     255             :                     m_bShowAtResize : 1,
     256             :                     m_bInOuterResizePixel : 1,
     257             :                     m_bInInnerResizePixel : 1,
     258             :                     m_bPasteState : 1,
     259             :                     m_bPasteSpecialState : 1,
     260             :                     m_bInMailMerge : 1,
     261             :                     m_bInDtor : 1, //detect destructor to prevent creating of sub shells while closing
     262             :                     m_bOldShellWasPagePreview : 1,
     263             :                     m_bIsPreviewDoubleClick : 1, // #i114045#
     264             :                     m_bMakeSelectionVisible : 1, // transport the bookmark selection
     265             :                     m_bAnnotationMode; ///< The real cursor position is inside an annotation.
     266             : 
     267             :     // methods for searching
     268             :     // set search context
     269             :     SAL_DLLPRIVATE bool              SearchAndWrap(bool bApi = false);
     270             :     SAL_DLLPRIVATE bool          SearchAll(sal_uInt16* pFound = 0);
     271             :     SAL_DLLPRIVATE sal_uLong         FUNC_Search( const SwSearchOptions& rOptions );
     272             :     SAL_DLLPRIVATE void          Replace();
     273             : 
     274             :     bool                        IsDocumentBorder();
     275             : 
     276             :     SAL_DLLPRIVATE bool          IsTextTool() const;
     277             : 
     278             :     // create control elements
     279             :     SAL_DLLPRIVATE void          CreateBtns();
     280             :     SAL_DLLPRIVATE DECL_LINK( BtnPage, Button * );
     281             : 
     282             :     SAL_DLLPRIVATE DECL_LINK( TimeoutHdl, void* );
     283             :     SAL_DLLPRIVATE DECL_LINK( UpdatePercentHdl, GraphicFilter* );
     284             : 
     285             :     SAL_DLLPRIVATE DECL_LINK( FieldPopupModeEndHdl, void* );
     286             : 
     287             :     inline long     GetXScroll() const;
     288             :     inline long     GetYScroll() const;
     289             :     SAL_DLLPRIVATE  Point    AlignToPixel(const Point& rPt) const;
     290             :     SAL_DLLPRIVATE   void        CalcPt( Point* pPt,const Rectangle& rRect,
     291             :                             sal_uInt16 nRangeX = USHRT_MAX,
     292             :                             sal_uInt16 nRangeY = USHRT_MAX);
     293             : 
     294             :     SAL_DLLPRIVATE bool          GetPageScrollUpOffset(SwTwips& rOff) const;
     295             :     SAL_DLLPRIVATE bool          GetPageScrollDownOffset(SwTwips& rOff) const;
     296             : 
     297             :     // scrollbar movements
     298             :     SAL_DLLPRIVATE long          PageUp();
     299             :     SAL_DLLPRIVATE long          PageDown();
     300             :     SAL_DLLPRIVATE long          PageUpCrsr(bool bSelect);
     301             :     SAL_DLLPRIVATE long          PageDownCrsr(bool bSelect);
     302             :     SAL_DLLPRIVATE long          PhyPageUp();
     303             :     SAL_DLLPRIVATE long          PhyPageDown();
     304             : 
     305             :     SAL_DLLPRIVATE int               _CreateScrollbar( bool bHori );
     306             :     SAL_DLLPRIVATE DECL_LINK( ScrollHdl, SwScrollbar * );
     307             :     SAL_DLLPRIVATE DECL_LINK( EndScrollHdl, SwScrollbar * );
     308             :     SAL_DLLPRIVATE bool          UpdateScrollbars();
     309             :     SAL_DLLPRIVATE DECL_LINK( WindowChildEventListener, VclSimpleEvent* );
     310             :     SAL_DLLPRIVATE void          CalcVisArea( const Size &rPixelSz );
     311             : 
     312             :     SAL_DLLPRIVATE void            CreatePageButtons(bool bShow);
     313             : 
     314             :     // linguistics functions
     315             :     SAL_DLLPRIVATE void          HyphenateDocument();
     316             :     SAL_DLLPRIVATE bool          IsDrawTextHyphenate();
     317             :     SAL_DLLPRIVATE void          HyphenateDrawText();
     318             :     SAL_DLLPRIVATE void          StartThesaurus();
     319             : 
     320             :     // text conversion
     321             :     SAL_DLLPRIVATE void          StartTextConversion( LanguageType nSourceLang, LanguageType nTargetLang, const vcl::Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive );
     322             : 
     323             :     // used for spell checking and text conversion
     324             :     SAL_DLLPRIVATE void          SpellStart( SvxSpellArea eSpell, bool bStartDone,
     325             :                                         bool bEndDone, SwConversionArgs *pConvArgs = 0 );
     326             :     SAL_DLLPRIVATE void          SpellEnd( SwConversionArgs *pConvArgs = 0 );
     327             : 
     328             :     SAL_DLLPRIVATE void          HyphStart( SvxSpellArea eSpell );
     329             :     SAL_DLLPRIVATE bool          CheckSpecialCntnt();
     330           0 :     SAL_DLLPRIVATE void          SpellKontext(bool bOn = true)
     331           0 :                                  { m_bCenterCrsr = bOn; m_bAlwaysShowSel = bOn; }
     332             : 
     333             :     // methods for printing
     334             :     SAL_DLLPRIVATE virtual SfxPrinter*       GetPrinter( bool bCreate = false ) SAL_OVERRIDE;
     335             :     SAL_DLLPRIVATE virtual bool              HasPrintOptionsPage() const SAL_OVERRIDE;
     336             :     SAL_DLLPRIVATE virtual SfxTabPage*       CreatePrintOptionsPage( vcl::Window* pParent,
     337             :                                                     const SfxItemSet& rSet) SAL_OVERRIDE;
     338             :     // for readonly switching
     339             :     SAL_DLLPRIVATE virtual void  Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
     340             :     SAL_DLLPRIVATE void          _CheckReadonlyState();
     341             :     SAL_DLLPRIVATE void          _CheckReadonlySelection();
     342             : 
     343             :     // method for rotating PageDesc
     344             :     SAL_DLLPRIVATE void          SwapPageMargin(const SwPageDesc&, SvxLRSpaceItem& rLR);
     345             : 
     346             :     SAL_DLLPRIVATE void          _SetZoom( const Size &rEditSz,
     347             :                               SvxZoomType eZoomType,
     348             :                               short nFactor = 100,
     349             :                               bool bViewOnly = false);
     350             :     SAL_DLLPRIVATE void          CalcAndSetBorderPixel( SvBorder &rToFill, bool bInner );
     351             : 
     352             :     SAL_DLLPRIVATE void          ShowAtResize();
     353             : 
     354             :     SAL_DLLPRIVATE virtual void  Move() SAL_OVERRIDE;
     355             : 
     356             :     SAL_DLLPRIVATE void          DocumentStatsChanged();
     357             : 
     358             : public: // #i123922# Needs to be called from a 2nd place now as a helper method
     359             :     SAL_DLLPRIVATE bool          InsertGraphicDlg( SfxRequest& );
     360             : 
     361             : protected:
     362             : 
     363       28531 :     SwView_Impl*    GetViewImpl() {return m_pViewImpl;}
     364             : 
     365             :     void ImpSetVerb( int nSelType );
     366             : 
     367           8 :     int             GetSelectionType() const { return m_nSelectionType; }
     368           4 :     void            SetSelectionType(int nSet) { m_nSelectionType = nSet;}
     369             : 
     370             :     // for SwWebView
     371           4 :     void            SetShell( SfxShell* pS )            { m_pShell = pS; }
     372           4 :     void            SetFormShell( FmFormShell* pSh )    { m_pFormShell = pSh; }
     373             : 
     374             :     virtual void    SelectShell();
     375             : 
     376             :     virtual void    Activate(bool) SAL_OVERRIDE;
     377             :     virtual void    Deactivate(bool) SAL_OVERRIDE;
     378             :     virtual void    InnerResizePixel( const Point &rOfs, const Size &rSize ) SAL_OVERRIDE;
     379             :     virtual void    OuterResizePixel( const Point &rOfs, const Size &rSize ) SAL_OVERRIDE;
     380             : 
     381             :     void            SetImageButtonColor(Color& rColor);
     382             : 
     383           0 :     const SwFrmFmt* GetLastTblFrmFmt() const {return m_pLastTableFormat;}
     384           8 :     void            SetLastTblFrmFmt(const SwFrmFmt* pSet) {m_pLastTableFormat = pSet;}
     385             : 
     386             :     // form letter execution
     387             :     void    GenerateFormLetter(bool bUseCurrentDocument);
     388             : 
     389             :     using SfxShell::GetDispatcher;
     390             : 
     391             : public:
     392         182 :     SFX_DECL_VIEWFACTORY(SwView);
     393         298 :     SFX_DECL_INTERFACE(SW_VIEWSHELL)
     394             :     TYPEINFO_OVERRIDE();
     395             : 
     396             : private:
     397             :     /// SfxInterface initializer.
     398             :     static void InitInterface_Impl();
     399             : 
     400             : public:
     401             :     SfxDispatcher   &GetDispatcher();
     402             : 
     403             :     void                    GotFocus() const;
     404             :     virtual SdrView*        GetDrawView() const SAL_OVERRIDE;
     405             :     virtual bool            HasUIFeature( sal_uInt32 nFeature ) SAL_OVERRIDE;
     406             :     virtual void            ShowCursor( bool bOn = true ) SAL_OVERRIDE;
     407             :     virtual ErrCode         DoVerb( long nVerb ) SAL_OVERRIDE;
     408             : 
     409             :     virtual sal_uInt16          SetPrinter( SfxPrinter* pNew,
     410             :                                         sal_uInt16 nDiff = SFX_PRINTER_ALL, bool bIsAPI=false) SAL_OVERRIDE;
     411             :     ShellModes              GetShellMode();
     412             : 
     413             :     com::sun::star::view::XSelectionSupplier*       GetUNOObject();
     414             : 
     415             :     OUString                GetSelectionTextParam( bool bCompleteWords,
     416             :                                                    bool bEraseTrail );
     417             :     virtual bool            HasSelection( bool bText ) const SAL_OVERRIDE;
     418             :     virtual OUString        GetSelectionText( bool bCompleteWords = false ) SAL_OVERRIDE;
     419             :     virtual bool            PrepareClose( bool bUI = true ) SAL_OVERRIDE;
     420             :     virtual void            MarginChanged() SAL_OVERRIDE;
     421             : 
     422             :     // replace word/selection with text from the thesaurus
     423             :     // (this code has special handling for "in word" character)
     424             :     void                    InsertThesaurusSynonym( const OUString &rSynonmText, const OUString &rLookUpText, bool bValidSelection );
     425             :     bool                    IsValidSelectionForThesaurus() const;
     426             :     OUString                GetThesaurusLookUpText( bool bSelection ) const;
     427             : 
     428             :     // immediately switch shell -> for GetSelectionObject
     429             :     void        StopShellTimer();
     430             : 
     431      189072 :     inline SwWrtShell&      GetWrtShell   () const { return *m_pWrtShell; }
     432       56715 :     inline SwWrtShell*      GetWrtShellPtr() const { return  m_pWrtShell; }
     433             : 
     434      276688 :     inline       SwEditWin &GetEditWin()        { return *m_pEditWin; }
     435      105232 :     inline const SwEditWin &GetEditWin () const { return *m_pEditWin; }
     436             : 
     437             : #if defined WNT || defined UNX
     438             :     void ScannerEventHdl( const ::com::sun::star::lang::EventObject& rEventObject );
     439             : #endif
     440             : 
     441             :     // hand the handler for text blocks to the shell; create if applicable
     442             :     SwGlossaryHdl*          GetGlosHdl();
     443             : 
     444       20292 :     inline const Rectangle& GetVisArea() const { return m_aVisArea; }
     445             : 
     446             :     bool            IsScroll(const Rectangle& rRect) const;
     447             :     void            Scroll( const Rectangle& rRect,
     448             :                             sal_uInt16 nRangeX = USHRT_MAX,
     449             :                             sal_uInt16 nRangeY = USHRT_MAX);
     450             : 
     451             :     long        SetVScrollMax(long lMax);
     452             :     long        SetHScrollMax(long lMax);
     453             : 
     454             :     void SpellError(LanguageType eLang);
     455             :     bool            ExecSpellPopup( const Point& rPt );
     456             :     void                ExecFieldPopup( const Point& rPt, sw::mark::IFieldmark *fieldBM );
     457             :     bool            ExecSmartTagPopup( const Point& rPt );
     458             : 
     459             :     DECL_LINK( OnlineSpellCallback, SpellCallbackInfo*);
     460             :     bool            ExecDrwTxtSpellPopup(const Point& rPt);
     461             : 
     462           0 :     void            SetTabColFromDocPos( const Point &rPt ) { m_aTabColFromDocPos = rPt; }
     463           0 :     void            SetTabColFromDoc( bool b ) { m_bTabColFromDoc = b; }
     464        4578 :     bool            IsTabColFromDoc() const    { return m_bTabColFromDoc; }
     465           0 :     void            SetTabRowFromDoc( bool b ) { m_bTabRowFromDoc = b; }
     466        2282 :     bool            IsTabRowFromDoc() const    { return m_bTabRowFromDoc; }
     467             : 
     468             :     // -> #i23726#
     469           0 :     void            SetNumRuleNodeFromDoc( SwTxtNode * pNumRuleNode )
     470           0 :                     { m_pNumRuleNodeFromDoc = pNumRuleNode; }
     471             :     void            SetNumIndentFromDoc(bool b) { m_bNumIndentFromDoc = b; }
     472             :     bool            IsNumIndentFromDoc() const { return NULL != m_pNumRuleNodeFromDoc; }
     473             :     // <- #i23726#
     474             : 
     475             :     void    DocSzChgd( const Size& rNewSize );
     476        1390 :     const   Size&   GetDocSz() const { return m_aDocSz; }
     477             :     virtual void    SetVisArea( const Rectangle&, bool bUpdateScrollbar = true);
     478             :             void    SetVisArea( const Point&, bool bUpdateScrollbar = true);
     479             :             void    CheckVisArea();
     480             : 
     481             :     void RecheckBrowseMode();
     482             :     static SvxSearchDialog* GetSearchDialog();
     483             : 
     484             :     static sal_uInt16   GetMoveType();
     485             :     static void     SetMoveType(sal_uInt16 nSet);
     486             :     DECL_STATIC_LINK( SwView, MoveNavigationHdl, bool* ); // #i75416#
     487             :     static void     SetActMark(sal_Int32 nSet);
     488             : 
     489             :     bool            HandleWheelCommands( const CommandEvent& );
     490             : 
     491             :     // insert frames
     492             :     void            InsFrmMode(sal_uInt16 nCols);
     493             : 
     494             :     void            SetZoom( SvxZoomType eZoomType, short nFactor = 100, bool bViewOnly = false);
     495             :     virtual void    SetZoomFactor( const Fraction &rX, const Fraction & ) SAL_OVERRIDE;
     496             : 
     497             :     void            SetViewLayout( sal_uInt16 nColumns, bool bBookMode, bool bViewOnly = false );
     498             : 
     499             :     void            ShowHScrollbar(bool bShow);
     500             :     bool        IsHScrollbarVisible()const;
     501             : 
     502             :     void            ShowVScrollbar(bool bShow);
     503             :     bool        IsVScrollbarVisible()const;
     504             : 
     505             :     void            EnableHScrollbar(bool bEnable);
     506             :     void            EnableVScrollbar(bool bEnable);
     507             : 
     508             :     int             CreateVRuler();
     509             :     int             KillVRuler();
     510             :     int             CreateTab();
     511             :     int             KillTab();
     512             : 
     513           0 :     bool            StatVRuler() const { return ((vcl::Window*)m_pVRuler)->IsVisible(); }
     514             :     void            ChangeVRulerMetric(FieldUnit eUnit);
     515             :     void            GetVRulerMetric(FieldUnit& rToFill) const;
     516             : 
     517             :     bool            StatTab() const { return ((vcl::Window*)m_pHRuler)->IsVisible(); }
     518           0 :     SvxRuler&       GetHRuler()    { return *m_pHRuler; }
     519           0 :     SvxRuler&       GetVRuler()    { return *m_pVRuler; }
     520             :     void            InvalidateRulerPos();
     521             :     void            ChangeTabMetric(FieldUnit eUnit);
     522             :     void            GetHRulerMetric(FieldUnit& rToFill) const;
     523             : 
     524             :     // Handler
     525             :     void            Execute(SfxRequest&);
     526             :     void            ExecPageMove(SfxRequest&);
     527             :     void            ExecStyle(SfxRequest&);
     528             :     void            ExecLingu(SfxRequest&);
     529             :     void            ExecDataBase(SfxRequest&);
     530             :     void            ExecDlg(SfxRequest&);
     531             :     void            ExecDlgExt(SfxRequest&);
     532             :     void            ExecDBDlg(SfxRequest &);
     533             :     void            ExecColl(SfxRequest&);
     534             :     void            ExecutePrint(SfxRequest&);
     535             :     void            ExecDraw(SfxRequest&);
     536             :     void            ExecTabWin(SfxRequest&);
     537             :     void            ExecuteStatusLine(SfxRequest&);
     538             :     DECL_LINK( ExecRulerClick, Ruler * );
     539             :     void            ExecSearch(SfxRequest&, bool bNoMessage = false);
     540             :     void            ExecViewOptions(SfxRequest &);
     541             : 
     542             :     void            StateViewOptions(SfxItemSet &);
     543             :     void            StateSearch(SfxItemSet &);
     544             :     void            GetState(SfxItemSet&);
     545             :     void            StateStatusLine(SfxItemSet&);
     546             : 
     547             :     // functions for drawing
     548             :     void            SetDrawFuncPtr(SwDrawBase* pFuncPtr);
     549        7526 :     inline SwDrawBase* GetDrawFuncPtr() const  { return m_pDrawActual; }
     550             :     void            GetDrawState(SfxItemSet &rSet);
     551             :     void            ExitDraw();
     552           0 :     inline bool     IsDrawRotate()      { return m_bDrawRotate; }
     553           0 :     inline void     FlipDrawRotate()    { m_bDrawRotate = !m_bDrawRotate; }
     554           0 :     inline bool     IsDrawSelMode()     { return m_bDrawSelMode; }
     555             :     void            SetSelDrawSlot();
     556           0 :     inline void     FlipDrawSelMode()   { m_bDrawSelMode = !m_bDrawSelMode; }
     557             :     void            NoRotate();     // turn off rotate mode
     558             :     bool            EnterDrawTextMode(const Point& aDocPos);
     559           0 :     void            LeaveDrawCreate()   { m_nDrawSfxId = m_nFormSfxId = USHRT_MAX; m_sDrawCustom = "";}
     560       33736 :     bool            IsDrawMode()        { return (m_nDrawSfxId != USHRT_MAX || m_nFormSfxId != USHRT_MAX); }
     561             :     bool            IsFormMode() const;
     562             :     bool            IsBezierEditMode();
     563             :     bool            AreOnlyFormsSelected() const;
     564             :     bool            HasDrwObj(SdrObject *pSdrObj) const;
     565             :     bool            HasOnlyObj(SdrObject *pSdrObj, sal_uInt32 eObjInventor) const;
     566             :     bool            BeginTextEdit(  SdrObject* pObj, SdrPageView* pPV=NULL,
     567             :                                     vcl::Window* pWin=NULL, bool bIsNewObj=false, bool bSetSelectionToStart=false );
     568             : 
     569             :     void            StateTabWin(SfxItemSet&);
     570             : 
     571             :     // attributes have changed
     572             :     DECL_LINK( AttrChangedNotify, void* );
     573             : 
     574             :     // form control has been activated
     575             :     DECL_LINK( FormControlActivated, void* );
     576             : 
     577             :     // edit links
     578             :     void            EditLinkDlg();
     579             :     void            AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId = 0);
     580             :     void            InsertCaption(const InsCaptionOpt *pOpt);
     581             : 
     582             :     // Async call by Core
     583             :     void        UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr);
     584             : 
     585             :     OUString    GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr);
     586             : 
     587             :     // hand over Shell
     588       10800 :                  SfxShell       *GetCurShell()  { return m_pShell; }
     589             :                  SwDocShell     *GetDocShell();
     590             :     inline const SwDocShell     *GetDocShell() const;
     591         254 :     inline virtual       FmFormShell    *GetFormShell()       SAL_OVERRIDE { return m_pFormShell; }
     592           0 :     inline virtual const FmFormShell    *GetFormShell() const SAL_OVERRIDE { return m_pFormShell; }
     593             : 
     594             :     // so that in the SubShells' DTors m_pShell can be reset if applicable
     595        4706 :     void ResetSubShell()    { m_pShell = 0; }
     596             : 
     597             :     virtual void    WriteUserData(OUString &, bool bBrowse = false) SAL_OVERRIDE;
     598             :     virtual void    ReadUserData(const OUString &, bool bBrowse = false) SAL_OVERRIDE;
     599             :     virtual void    ReadUserDataSequence ( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, bool bBrowse ) SAL_OVERRIDE;
     600             :     virtual void    WriteUserDataSequence ( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, bool bBrowse ) SAL_OVERRIDE;
     601             : 
     602           0 :     void SetCrsrAtTop( bool bFlag, bool bCenter = false )
     603           0 :         { m_bTopCrsr = bFlag, m_bCenterCrsr = bCenter; }
     604           0 :     bool IsCrsrAtTop() const                    { return m_bTopCrsr; }
     605           0 :     bool IsCrsrAtCenter() const                 { return m_bCenterCrsr; }
     606             : 
     607             :     bool JumpToSwMark( const OUString& rMark );
     608             : 
     609             :     long InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName,
     610             :                     const OUString& rFilterName, sal_Int16 nVersion = 0 );
     611             : 
     612             :     void ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem );
     613             :     long InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVersion );
     614             :     DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper * );
     615             : 
     616             :     // status methods for clipboard.
     617             :     // Status changes now notified from the clipboard.
     618             :     bool IsPasteAllowed();
     619             :     bool IsPasteSpecialAllowed();
     620             : 
     621             :     // Enable mail merge - mail merge field dialog enabled
     622             :     void EnableMailMerge(bool bEnable = true);
     623             :     //apply Accessiblity options
     624             :     void ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions);
     625             : 
     626             :     SwView(SfxViewFrame* pFrame, SfxViewShell*);
     627             :     virtual ~SwView();
     628             : 
     629             :     void NotifyDBChanged();
     630             : 
     631             :     SfxObjectShellLock CreateTmpSelectionDoc();
     632             : 
     633             :     void        AddTransferable(SwTransferable& rTransferable);
     634             : 
     635             :     // store MailMerge data while "Back to Mail Merge Wizard" FloatingWindow is active
     636             :     // or to support printing
     637             :     void   SetMailMergeConfigItem(SwMailMergeConfigItem*  pConfigItem, sal_uInt16 nRestart, bool bIsSource);
     638             :     SwMailMergeConfigItem*  GetMailMergeConfigItem();
     639             :     sal_uInt16              GetMailMergeRestartPage() const;
     640             :     bool                IsMailMergeSourceView() const;
     641             : 
     642             :     void ExecFormatPaintbrush(SfxRequest &);
     643             :     void StateFormatPaintbrush(SfxItemSet &);
     644             : 
     645             :     //public fuer D&D
     646             :     int     InsertGraphic( const OUString &rPath, const OUString &rFilter,
     647             :                             bool bLink = true, GraphicFilter *pFlt = 0,
     648             :                             Graphic* pPreviewGrf = 0,
     649             :                             bool bRule = false );
     650             : 
     651             :     void ExecuteScan( SfxRequest& rReq );
     652             : 
     653      348996 :     SwPostItMgr* GetPostItMgr() { return m_pPostItMgr;}
     654             :     const SwPostItMgr* GetPostItMgr() const { return m_pPostItMgr;}
     655             : 
     656             :     // exhibition hack (MA,MBA)
     657             :     void SelectShellForDrop();
     658             : 
     659             :     void UpdateDocStats();
     660             :     /// Where is the real cursor: in the annotation or in the main document?
     661             :     void SetAnnotationMode(bool bMode);
     662             : };
     663             : 
     664        3348 : inline long SwView::GetXScroll() const
     665             : {
     666        3348 :     return m_aVisArea.GetWidth() * nScrollX / 100L;
     667             : }
     668             : 
     669        3348 : inline long SwView::GetYScroll() const
     670             : {
     671        3348 :     return m_aVisArea.GetHeight() * nScrollY / 100L;
     672             : }
     673             : 
     674        2339 : inline const SwDocShell *SwView::GetDocShell() const
     675             : {
     676        2339 :     return ((SwView*)this)->GetDocShell();
     677             : }
     678             : 
     679             : SfxTabPage* CreatePrintOptionsPage( vcl::Window *pParent,
     680             :                                     const SfxItemSet &rOptions,
     681             :                                     bool bPreview);
     682             : 
     683             : #endif
     684             : 
     685             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10