1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef SC_DRAWVIEW_HXX 29*cdf0e10cSrcweir #define SC_DRAWVIEW_HXX 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include <svx/fmview.hxx> 32*cdf0e10cSrcweir 33*cdf0e10cSrcweir #include "global.hxx" 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace datatransfer { class XTransferable; } } } } 36*cdf0e10cSrcweir 37*cdf0e10cSrcweir class ScDocument; 38*cdf0e10cSrcweir class ScViewData; 39*cdf0e10cSrcweir class ScDrawObjData; 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir class ScDrawView: public FmFormView 42*cdf0e10cSrcweir { 43*cdf0e10cSrcweir ScViewData* pViewData; 44*cdf0e10cSrcweir OutputDevice* pDev; //! noetig ? 45*cdf0e10cSrcweir ScDocument* pDoc; 46*cdf0e10cSrcweir SCTAB nTab; 47*cdf0e10cSrcweir Fraction aScaleX; // Faktor fuer Drawing-MapMode 48*cdf0e10cSrcweir Fraction aScaleY; 49*cdf0e10cSrcweir SdrDropMarkerOverlay* pDropMarker; 50*cdf0e10cSrcweir SdrObject* pDropMarkObj; 51*cdf0e10cSrcweir sal_Bool bInConstruct; 52*cdf0e10cSrcweir //HMHBOOL bDisableHdl; 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir void Construct(); 55*cdf0e10cSrcweir void UpdateBrowser(); 56*cdf0e10cSrcweir 57*cdf0e10cSrcweir protected: 58*cdf0e10cSrcweir virtual void ModelHasChanged(); 59*cdf0e10cSrcweir 60*cdf0e10cSrcweir // add custom handles (used by other apps, e.g. AnchorPos) 61*cdf0e10cSrcweir virtual void AddCustomHdl(); 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir void ImplClearCalcDropMarker(); 64*cdf0e10cSrcweir 65*cdf0e10cSrcweir public: 66*cdf0e10cSrcweir ScDrawView( OutputDevice* pOut, ScViewData* pData ); 67*cdf0e10cSrcweir virtual ~ScDrawView(); 68*cdf0e10cSrcweir 69*cdf0e10cSrcweir virtual void MarkListHasChanged(); 70*cdf0e10cSrcweir virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir virtual void DoConnect(SdrOle2Obj* pOleObj); 73*cdf0e10cSrcweir 74*cdf0e10cSrcweir virtual void MakeVisible( const Rectangle& rRect, Window& rWin ); 75*cdf0e10cSrcweir 76*cdf0e10cSrcweir virtual void DeleteMarked(); 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir void DrawMarks( OutputDevice* pOut ) const; 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir void MarkDropObj( SdrObject* pObj ); 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir //HMHBOOL IsDisableHdl() const { return bDisableHdl; } 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir void SetMarkedToLayer( sal_uInt8 nLayerNo ); 85*cdf0e10cSrcweir 86*cdf0e10cSrcweir void InvalidateAttribs(); 87*cdf0e10cSrcweir void InvalidateDrawTextAttrs(); 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir sal_Bool BeginDrag( Window* pWindow, const Point& rStartPos ); 90*cdf0e10cSrcweir void DoCut(); 91*cdf0e10cSrcweir void DoCopy(); 92*cdf0e10cSrcweir 93*cdf0e10cSrcweir void GetScale( Fraction& rFractX, Fraction& rFractY ) const; 94*cdf0e10cSrcweir void RecalcScale(); 95*cdf0e10cSrcweir void UpdateWorkArea(); 96*cdf0e10cSrcweir SCTAB GetTab() const { return nTab; } 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir void CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const; 99*cdf0e10cSrcweir 100*cdf0e10cSrcweir void SetAnchor( ScAnchorType ); 101*cdf0e10cSrcweir ScAnchorType GetAnchor() const; 102*cdf0e10cSrcweir 103*cdf0e10cSrcweir void VCAddWin( Window* pWin ); 104*cdf0e10cSrcweir void VCRemoveWin( Window* pWin ); 105*cdf0e10cSrcweir 106*cdf0e10cSrcweir void UpdateIMap( SdrObject* pObj ); 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir sal_uInt16 GetPopupMenuId(); 109*cdf0e10cSrcweir void UpdateUserViewOptions(); 110*cdf0e10cSrcweir 111*cdf0e10cSrcweir void SetMarkedOriginalSize(); 112*cdf0e10cSrcweir 113*cdf0e10cSrcweir sal_Bool SelectObject( const String& rName ); 114*cdf0e10cSrcweir //UNUSED2008-05 String GetSelectedChartName() const; 115*cdf0e10cSrcweir bool HasMarkedControl() const; 116*cdf0e10cSrcweir bool HasMarkedInternal() const; 117*cdf0e10cSrcweir 118*cdf0e10cSrcweir FASTBOOL InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong nOptions=0); 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir /** Returns the selected object, if it is the caption object of a cell note. 121*cdf0e10cSrcweir @param ppCaptData (out-param) If not null, returns the pointer to the caption object data. */ 122*cdf0e10cSrcweir SdrObject* GetMarkedNoteCaption( ScDrawObjData** ppCaptData = 0 ); 123*cdf0e10cSrcweir 124*cdf0e10cSrcweir /** Locks/unlocks the specified layer in the draw page. 125*cdf0e10cSrcweir Unlocked layer is required to be able to edit the contained objects. */ 126*cdf0e10cSrcweir void LockCalcLayer( SdrLayerID nLayer, bool bLock = true ); 127*cdf0e10cSrcweir /** Unlocks the specified layer in the draw page. */ 128*cdf0e10cSrcweir inline void UnlockCalcLayer( SdrLayerID nLayer ) { LockCalcLayer( nLayer, false ); } 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir /** Locks/unlocks the background layer that contains background objects. 131*cdf0e10cSrcweir Unlocked layer is required to be able to edit the objects. */ 132*cdf0e10cSrcweir inline void LockBackgroundLayer( bool bLock = true ) { LockCalcLayer( SC_LAYER_BACK, bLock ); } 133*cdf0e10cSrcweir /** Unlocks the background layer that contains background objects. */ 134*cdf0e10cSrcweir inline void UnlockBackgroundLayer() { LockBackgroundLayer( false ); } 135*cdf0e10cSrcweir 136*cdf0e10cSrcweir /** Locks/unlocks the internal layer that contains caption objects of cell notes. 137*cdf0e10cSrcweir Unlocked layer is required to be able to edit the contained objects. */ 138*cdf0e10cSrcweir inline void LockInternalLayer( bool bLock = true ) { LockCalcLayer( SC_LAYER_INTERN, bLock ); } 139*cdf0e10cSrcweir /** Unlocks the internal layer that contains caption objects of cell notes. */ 140*cdf0e10cSrcweir inline void UnlockInternalLayer() { LockInternalLayer( false ); } 141*cdf0e10cSrcweir 142*cdf0e10cSrcweir SdrEndTextEditKind ScEndTextEdit(); // ruft SetDrawTextUndo(0) 143*cdf0e10cSrcweir //UNUSED2009-05 void CaptionTextDirection(sal_uInt16 nSlot); 144*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > CopyToTransferable(); 145*cdf0e10cSrcweir }; 146*cdf0e10cSrcweir 147*cdf0e10cSrcweir 148*cdf0e10cSrcweir 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir #endif 151*cdf0e10cSrcweir 152