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