LCOV - code coverage report
Current view: top level - sc/inc - drwlayer.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 5 5 100.0 %
Date: 2014-11-03 Functions: 5 5 100.0 %
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_SC_INC_DRWLAYER_HXX
      21             : #define INCLUDED_SC_INC_DRWLAYER_HXX
      22             : 
      23             : #include <vcl/graph.hxx>
      24             : #include <svx/fmmodel.hxx>
      25             : #include <svx/svdundo.hxx>
      26             : #include "global.hxx"
      27             : 
      28             : class ScDocument;
      29             : class SfxObjectShell;
      30             : class ScDrawObjData;
      31             : class ScIMapInfo;
      32             : class ScMacroInfo;
      33             : class IMapObject;
      34             : class ScMarkData;
      35             : class ScRange;
      36             : class ScAddress;
      37             : 
      38             : class ScTabDeletedHint : public SfxHint
      39             : {
      40             : private:
      41             :     SCTAB   nTab;
      42             : public:
      43             :             ScTabDeletedHint( SCTAB nTabNo = SCTAB_MAX );
      44             :     virtual ~ScTabDeletedHint();
      45             : 
      46          36 :     SCTAB   GetTab() const { return nTab; }
      47             : };
      48             : 
      49             : class ScTabSizeChangedHint : public SfxHint
      50             : {
      51             : private:
      52             :     SCTAB   nTab;
      53             : public:
      54             :             ScTabSizeChangedHint( SCTAB nTabNo = SCTAB_MAX );
      55             :     virtual ~ScTabSizeChangedHint();
      56             : 
      57        1706 :     SCTAB   GetTab() const  { return nTab; }
      58             : };
      59             : 
      60             : //  Adjusting of detective UserData and draw undo's both have to be in SdrUndoGroup;
      61             : //  therefore derived from SdrUndoAction
      62             : 
      63             : class ScUndoObjData : public SdrUndoObj
      64             : {
      65             : private:
      66             :     ScAddress   aOldStt;
      67             :     ScAddress   aOldEnd;
      68             :     ScAddress   aNewStt;
      69             :     ScAddress   aNewEnd;
      70             : public:
      71             :                 ScUndoObjData( SdrObject* pObj, const ScAddress& rOS, const ScAddress& rOE,
      72             :                                                 const ScAddress& rNS, const ScAddress& rNE );
      73             :                 virtual ~ScUndoObjData();
      74             : 
      75             :     virtual void     Undo() SAL_OVERRIDE;
      76             :     virtual void     Redo() SAL_OVERRIDE;
      77             : };
      78             : 
      79             : class SC_DLLPUBLIC ScDrawLayer : public FmFormModel
      80             : {
      81             : private:
      82             :     OUString        aName;
      83             :     ScDocument*     pDoc;
      84             :     SdrUndoGroup*   pUndoGroup;
      85             :     bool            bRecording;
      86             :     bool            bAdjustEnabled;
      87             :     bool            bHyphenatorSet;
      88             : 
      89             : private:
      90             :     void            MoveCells( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2,
      91             :                                 SCsCOL nDx,SCsROW nDy, bool bUpdateNoteCaptionPos );
      92             : 
      93             :     void            RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegativePage, bool bUpdateNoteCaptionPos );
      94             :     void            ResizeLastRectFromAnchor( SdrObject* pObj, ScDrawObjData& rData, bool bUseLogicRect, bool bNegativePage, bool bCanResize, bool bHiddenAsZero = true );
      95             : 
      96             : public:
      97             :                     ScDrawLayer( ScDocument* pDocument, const OUString& rName );
      98             :     virtual         ~ScDrawLayer();
      99             : 
     100             :     virtual SdrPage*  AllocPage(bool bMasterPage) SAL_OVERRIDE;
     101             :     virtual SdrModel* AllocModel() const SAL_OVERRIDE;
     102             :     virtual void    SetChanged( bool bFlg = true ) SAL_OVERRIDE;
     103             : 
     104             :     virtual SdrLayerID GetControlExportLayerId( const SdrObject & ) const SAL_OVERRIDE;
     105             : 
     106             :     bool            HasObjects() const;
     107             : 
     108             :     bool            ScAddPage( SCTAB nTab );
     109             :     void            ScRemovePage( SCTAB nTab );
     110             :     void            ScRenamePage( SCTAB nTab, const OUString& rNewName );
     111             :     void            ScMovePage( sal_uInt16 nOldPos, sal_uInt16 nNewPos );
     112             :     void            ScCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos);
     113             :     void            ResetTab( SCTAB nStart, SCTAB nEnd );
     114             : 
     115          36 :     ScDocument*     GetDocument() const { return pDoc; }
     116             : 
     117             :     void            UseHyphenator();
     118             : 
     119             :     bool            GetPrintArea( ScRange& rRange, bool bSetHor, bool bSetVer ) const;
     120             : 
     121             :                     //      automatic adjustments
     122             : 
     123         356 :     void            EnableAdjust( bool bSet = true )    { bAdjustEnabled = bSet; }
     124             : 
     125             :     void            BeginCalcUndo(bool bDisableTextEditUsesCommonUndoManager);
     126             :     SdrUndoGroup*   GetCalcUndo();
     127         220 :     bool            IsRecording() const         { return bRecording; }
     128             :     void            AddCalcUndo( SdrUndoAction* pUndo );
     129             : 
     130             :     void            MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2,
     131             :                                 SCsCOL nDx,SCsROW nDy, bool bInsDel, bool bUpdateNoteCaptionPos = true );
     132             : 
     133             :     bool            HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow );
     134             : 
     135             :     void            DeleteObjectsInArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1,
     136             :                                             SCCOL nCol2,SCROW nRow2 );
     137             :     void            DeleteObjectsInSelection( const ScMarkData& rMark );
     138             : 
     139             :     void            CopyToClip( ScDocument* pClipDoc, SCTAB nTab, const Rectangle& rRange );
     140             :     void            CopyFromClip( ScDrawLayer* pClipModel,
     141             :                                     SCTAB nSourceTab, const Rectangle& rSourceRange,
     142             :                                     const ScAddress& rDestPos, const Rectangle& rDestRange );
     143             : 
     144             :     void            SetPageSize( sal_uInt16 nPageNo, const Size& rSize, bool bUpdateNoteCaptionPos = true );
     145             : 
     146             :                     //  mirror or move between positive and negative positions for RTL
     147             :     void            MirrorRTL( SdrObject* pObj );
     148             :     static void     MirrorRectRTL( Rectangle& rRect );      // for bounding rectangles etc.
     149             : 
     150             :     /** Returns the rectangle for the passed cell address in 1/100 mm.
     151             :         @param bMergedCell  True = regards merged cells. False = use single column/row size. */
     152             :     static Rectangle GetCellRect( ScDocument& rDoc, const ScAddress& rPos, bool bMergedCell );
     153             : 
     154             :                     //  GetVisibleName: name for navigator etc: GetPersistName or GetName
     155             :                     //  (ChartListenerCollection etc. must use GetPersistName directly)
     156             :     static OUString GetVisibleName( SdrObject* pObj );
     157             : 
     158             :     SdrObject*      GetNamedObject( const OUString& rName, sal_uInt16 nId, SCTAB& rFoundTab ) const;
     159             :                     // if pnCounter != NULL, the search for a name starts with this index + 1,
     160             :                     // and the index really used is returned.
     161             :     OUString        GetNewGraphicName( long* pnCounter = NULL ) const;
     162             :     void            EnsureGraphicNames();
     163             : 
     164             :     static bool IsCellAnchored( const SdrObject& rObj );
     165             :     static void             SetPageAnchored( SdrObject& );
     166             :     static void             SetCellAnchored( SdrObject&, const ScDrawObjData &rAnchor );
     167             :     static void             SetVisualCellAnchored( SdrObject&, const ScDrawObjData &rAnchor );
     168             :     // Updates rAnchor based on position of rObj
     169             :     static void             GetCellAnchorFromPosition( SdrObject &rObj, ScDrawObjData &rAnchor, const ScDocument &rDoc, SCTAB nTab, bool bUseLogicRect = true, bool bHiddenAsZero = true );
     170             :     static void             SetCellAnchoredFromPosition( SdrObject &rObj, const ScDocument &rDoc, SCTAB nTab );
     171             :     static void             UpdateCellAnchorFromPositionEnd( SdrObject &rObj, ScDrawObjData &rAnchor, const ScDocument &rDoc, SCTAB nTab, bool bUseLogicRect = true );
     172             :     static ScAnchorType     GetAnchorType( const SdrObject& );
     173             : 
     174             :     // positions for detektive lines
     175             :     static ScDrawObjData* GetObjData( SdrObject* pObj, bool bCreate=false );
     176             :     static ScDrawObjData* GetNonRotatedObjData( SdrObject* pObj, bool bCreate=false );
     177             : 
     178             :     // The sheet information in ScDrawObjData isn't updated when sheets are inserted/deleted.
     179             :     // Use this method to get an object with positions on the specified sheet (should be the
     180             :     // sheet on which the object is inserted).
     181             :     static ScDrawObjData* GetObjDataTab( SdrObject* pObj, SCTAB nTab );
     182             : 
     183             :     /** Returns true, if the passed object is the caption of a cell note. */
     184             :     static bool     IsNoteCaption( SdrObject* pObj );
     185             : 
     186             :     /** Returns the object data, if the passed object is a cell note caption. */
     187             :     static ScDrawObjData* GetNoteCaptionData( SdrObject* pObj, SCTAB nTab );
     188             : 
     189             :     // Image-Map
     190             :     static ScIMapInfo* GetIMapInfo( SdrObject* pObj );
     191             : 
     192             :     static IMapObject* GetHitIMapObject( SdrObject* pObject,
     193             :                             const Point& rWinPoint, const vcl::Window& rCmpWnd );
     194             : 
     195             :     static ScMacroInfo* GetMacroInfo( SdrObject* pObj, bool bCreate = false );
     196             : 
     197             :     virtual ImageMap* GetImageMapForObject(SdrObject* pObj) SAL_OVERRIDE;
     198             :     virtual sal_Int32 GetHyperlinkCount(SdrObject* pObj) SAL_OVERRIDE;
     199             : 
     200             : private:
     201             :     static SfxObjectShell* pGlobalDrawPersist;          // for AllocModel
     202             : public:
     203             :     static void     SetGlobalDrawPersist(SfxObjectShell* pPersist);
     204             : protected:
     205             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel() SAL_OVERRIDE;
     206             : };
     207             : 
     208             : #endif
     209             : 
     210             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10