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