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: DrawViewWrapper.hxx,v $
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 ************************************************************************/
30 #ifndef _CHART2_DRAW_VIEW_WRAPPER_HXX
31 #define _CHART2_DRAW_VIEW_WRAPPER_HXX
33 #include <svx/view3d.hxx>
34 #include <com/sun/star/drawing/XShape.hpp>
35 #include <com/sun/star/frame/XModel.hpp>
39 //.............................................................................
42 //.............................................................................
44 //-----------------------------------------------------------------------------
45 /** The DrawViewWrapper should help us to reduce effort if the underlying DrawingLayer changes.
46 Another task is to hide functionality we do not need, for example more than one page.
49 class MarkHandleProvider
52 virtual bool getMarkHandles( SdrHdlList
& rHdlList
) =0;
53 virtual bool getFrameDragSingles() =0;
56 class DrawViewWrapper
: public E3dView
59 DrawViewWrapper(SdrModel
* pModel
, OutputDevice
* pOut
, bool bPaintPageForEditMode
);
60 virtual ~DrawViewWrapper();
62 //triggers the use of an updated first page
65 /// tries to get an OutputDevice from the XParent of the model to use as reference device
66 void attachParentReferenceDevice(
67 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> & xChartModel
);
69 //fill list of selection handles 'aHdl'
70 virtual void SetMarkHandles();
72 SdrPageView
* GetPageView() const;
74 SdrObject
* getHitObject( const Point
& rPnt
) const;
75 //BOOL PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions, SdrObject** ppRootObj, ULONG* pnMarkNum=NULL, USHORT* pnPassNum=NULL) const;
76 //BOOL PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions=0) const;
77 //BOOL PickObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions=0) const { return PickObj(rPnt,nHitTolLog,rpObj,rpPV,nOptions); }
79 //void MarkObj(SdrObject* pObj, SdrPageView* pPV, BOOL bUnmark=FALSE, BOOL bImpNoSetMarkHdl=FALSE);
80 void MarkObject( SdrObject
* pObj
);
82 //----------------------
83 //pMarkHandleProvider can be NULL; ownership is not taken
84 void setMarkHandleProvider( MarkHandleProvider
* pMarkHandleProvider
);
85 void CompleteRedraw(OutputDevice
* pOut
, const Region
& rReg
, sdr::contact::ViewObjectContactRedirector
* pRedirector
= 0);
87 SdrObject
* getSelectedObject() const;
88 SdrObject
* getTextEditObject() const;
89 SdrOutliner
* getOutliner() const;
91 SfxItemSet
getPositionAndSizeItemSetFromMarkedObject() const;
93 SdrObject
* getNamedSdrObject( const rtl::OUString
& rName
) const;
94 bool IsObjectHit( SdrObject
* pObj
, const Point
& rPnt
) const;
96 virtual void Notify(SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
98 static SdrObject
* getSdrObject( const ::com::sun::star::uno::Reference
<
99 ::com::sun::star::drawing::XShape
>& xShape
);
102 mutable MarkHandleProvider
* m_pMarkHandleProvider
;
104 ::std::auto_ptr
< SdrOutliner
> m_apOutliner
;
106 // #i79965# scroll back view when ending text edit
107 bool m_bRestoreMapMode
;
108 MapMode m_aMapModeToRestore
;
111 //.............................................................................
113 //.............................................................................