xref: /aoo41x/main/sc/source/ui/inc/drawview.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_DRAWVIEW_HXX
25cdf0e10cSrcweir #define SC_DRAWVIEW_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svx/fmview.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include "global.hxx"
30cdf0e10cSrcweir 
31cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace datatransfer { class XTransferable; } } } }
32cdf0e10cSrcweir 
33cdf0e10cSrcweir class ScDocument;
34cdf0e10cSrcweir class ScViewData;
35cdf0e10cSrcweir class ScDrawObjData;
36cdf0e10cSrcweir 
37cdf0e10cSrcweir class ScDrawView: public FmFormView
38cdf0e10cSrcweir {
39cdf0e10cSrcweir 	ScViewData*				pViewData;
40cdf0e10cSrcweir 	OutputDevice*			pDev;					//! noetig ?
41cdf0e10cSrcweir 	ScDocument*				pDoc;
42cdf0e10cSrcweir 	SCTAB					nTab;
43cdf0e10cSrcweir 	Fraction				aScaleX;				// Faktor fuer Drawing-MapMode
44cdf0e10cSrcweir 	Fraction				aScaleY;
45cdf0e10cSrcweir 	SdrDropMarkerOverlay*	pDropMarker;
46cdf0e10cSrcweir 	SdrObject*				pDropMarkObj;
47cdf0e10cSrcweir 	sal_Bool					bInConstruct;
48cdf0e10cSrcweir 	//HMHBOOL					bDisableHdl;
49cdf0e10cSrcweir 
50cdf0e10cSrcweir 	void			Construct();
51cdf0e10cSrcweir 	void			UpdateBrowser();
52cdf0e10cSrcweir 
53cdf0e10cSrcweir protected:
54cdf0e10cSrcweir 	virtual void	ModelHasChanged();
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 	// add custom handles (used by other apps, e.g. AnchorPos)
57cdf0e10cSrcweir     virtual void AddCustomHdl();
58cdf0e10cSrcweir 
59cdf0e10cSrcweir 	void ImplClearCalcDropMarker();
60cdf0e10cSrcweir 
61cdf0e10cSrcweir public:
62cdf0e10cSrcweir 					ScDrawView( OutputDevice* pOut, ScViewData* pData );
63cdf0e10cSrcweir 	virtual			~ScDrawView();
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 	virtual void	MarkListHasChanged();
66cdf0e10cSrcweir 	virtual void	Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
67cdf0e10cSrcweir 
68cdf0e10cSrcweir     virtual void    DoConnect(SdrOle2Obj* pOleObj);
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	virtual void	MakeVisible( const Rectangle& rRect, Window& rWin );
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     virtual void    DeleteMarked();
73cdf0e10cSrcweir 
74cdf0e10cSrcweir 	void			DrawMarks( OutputDevice* pOut ) const;
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 	void			MarkDropObj( SdrObject* pObj );
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 	//HMHBOOL			IsDisableHdl() const 	{ return bDisableHdl; }
79cdf0e10cSrcweir 
80cdf0e10cSrcweir 	void			SetMarkedToLayer( sal_uInt8 nLayerNo );
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 	void			InvalidateAttribs();
83cdf0e10cSrcweir 	void			InvalidateDrawTextAttrs();
84cdf0e10cSrcweir 
85cdf0e10cSrcweir 	sal_Bool			BeginDrag( Window* pWindow, const Point& rStartPos );
86cdf0e10cSrcweir 	void			DoCut();
87cdf0e10cSrcweir 	void			DoCopy();
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 	void			GetScale( Fraction& rFractX, Fraction& rFractY ) const;
90cdf0e10cSrcweir 	void			RecalcScale();
91cdf0e10cSrcweir 	void			UpdateWorkArea();
92cdf0e10cSrcweir 	SCTAB			GetTab() const		{ return nTab; }
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 	void			CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const;
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 	void			SetAnchor( ScAnchorType );
97cdf0e10cSrcweir 	ScAnchorType	GetAnchor() const;
98cdf0e10cSrcweir 
99cdf0e10cSrcweir 	void			VCAddWin( Window* pWin );
100cdf0e10cSrcweir 	void			VCRemoveWin( Window* pWin );
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 	void 			UpdateIMap( SdrObject* pObj );
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 	sal_uInt16			GetPopupMenuId();
105cdf0e10cSrcweir 	void			UpdateUserViewOptions();
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 	void			SetMarkedOriginalSize();
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 	sal_Bool			SelectObject( const String& rName );
110cdf0e10cSrcweir //UNUSED2008-05  String			GetSelectedChartName() const;
111cdf0e10cSrcweir     bool            HasMarkedControl() const;
112cdf0e10cSrcweir     bool            HasMarkedInternal() const;
113cdf0e10cSrcweir 
114cdf0e10cSrcweir 	FASTBOOL		InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong nOptions=0);
115cdf0e10cSrcweir 
116cdf0e10cSrcweir     /** Returns the selected object, if it is the caption object of a cell note.
117cdf0e10cSrcweir         @param ppCaptData  (out-param) If not null, returns the pointer to the caption object data. */
118cdf0e10cSrcweir     SdrObject*      GetMarkedNoteCaption( ScDrawObjData** ppCaptData = 0 );
119cdf0e10cSrcweir 
120cdf0e10cSrcweir     /** Locks/unlocks the specified layer in the draw page.
121cdf0e10cSrcweir         Unlocked layer is required to be able to edit the contained objects. */
122cdf0e10cSrcweir     void            LockCalcLayer( SdrLayerID nLayer, bool bLock = true );
123cdf0e10cSrcweir     /** Unlocks the specified layer in the draw page. */
124cdf0e10cSrcweir     inline void     UnlockCalcLayer( SdrLayerID nLayer ) { LockCalcLayer( nLayer, false ); }
125cdf0e10cSrcweir 
126cdf0e10cSrcweir     /** Locks/unlocks the background layer that contains background objects.
127cdf0e10cSrcweir         Unlocked layer is required to be able to edit the objects. */
128cdf0e10cSrcweir     inline void     LockBackgroundLayer( bool bLock = true ) { LockCalcLayer( SC_LAYER_BACK, bLock ); }
129cdf0e10cSrcweir     /** Unlocks the background layer that contains background objects. */
130cdf0e10cSrcweir     inline void     UnlockBackgroundLayer() { LockBackgroundLayer( false ); }
131cdf0e10cSrcweir 
132cdf0e10cSrcweir     /** Locks/unlocks the internal layer that contains caption objects of cell notes.
133cdf0e10cSrcweir         Unlocked layer is required to be able to edit the contained objects. */
134cdf0e10cSrcweir     inline void     LockInternalLayer( bool bLock = true ) { LockCalcLayer( SC_LAYER_INTERN, bLock ); }
135cdf0e10cSrcweir     /** Unlocks the internal layer that contains caption objects of cell notes. */
136cdf0e10cSrcweir     inline void     UnlockInternalLayer() { LockInternalLayer( false ); }
137cdf0e10cSrcweir 
138cdf0e10cSrcweir 	SdrEndTextEditKind	ScEndTextEdit();	// ruft SetDrawTextUndo(0)
139cdf0e10cSrcweir //UNUSED2009-05 void                    CaptionTextDirection(sal_uInt16 nSlot);
140cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > CopyToTransferable();
141cdf0e10cSrcweir };
142cdf0e10cSrcweir 
143cdf0e10cSrcweir 
144cdf0e10cSrcweir 
145cdf0e10cSrcweir 
146cdf0e10cSrcweir #endif
147cdf0e10cSrcweir 
148