xref: /aoo41x/main/sw/source/core/inc/dview.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _DVIEW_HXX
28 #define	_DVIEW_HXX
29 
30 
31 #include <svx/fmview.hxx>
32 
33 class OutputDevice;
34 class SwViewImp;
35 class SwFrm;
36 class SwFlyFrm;
37 class SwAnchoredObject;
38 
39 class SwDrawView : public FmFormView
40 {
41 	//Fuer den Anker
42 	Point			aAnchorPoint;		//Ankerposition
43 	SwViewImp	   &rImp;				//Die View gehoert immer zu einer Shell
44 
45 	const SwFrm *CalcAnchor();
46 
47     /** determine maximal order number for a 'child' object of given 'parent' object
48 
49         OD 2004-08-20 #110810#
50         The maximal order number will be determined on the current object
51         order hierarchy. It's the order number of the 'child' object with the
52         highest order number. The calculation can be influenced by parameter
53         <_pExclChildObj> - this 'child' object won't be considered.
54 
55         @param <_rParentObj>
56         input parameter - 'parent' object, for which the maximal order number
57         for its 'childs' will be determined.
58 
59         @param <_pExclChildObj>
60         optional input parameter - 'child' object, which will not be considered
61         on the calculation of the maximal order number
62 
63         @author OD
64     */
65     sal_uInt32 _GetMaxChildOrdNum( const SwFlyFrm& _rParentObj,
66                                    const SdrObject* _pExclChildObj = 0L ) const;
67 
68     /** method to move 'repeated' objects of the given moved object to the
69         according level
70 
71         OD 2004-08-23 #110810#
72 
73         @param <_rMovedAnchoredObj>
74         input parameter - moved object, for which the 'repeated' ones have also
75         to be moved.
76 
77         @param <_rMovedChildsObjs>
78         input parameter - data collection of moved 'child' objects - the 'repeated'
79         ones of these 'childs' will also been moved.
80 
81         @author OD
82     */
83     void _MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
84                             const std::vector<SdrObject*>& _rMovedChildObjs ) const;
85 
86 protected:
87 	// add custom handles (used by other apps, e.g. AnchorPos)
88     virtual void AddCustomHdl();
89 
90     // overloaded to allow extra handling when picking SwVirtFlyDrawObj's
91     using FmFormView::CheckSingleSdrObjectHit;
92     virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, sal_uLong nOptions, const SetOfByte* pMVisLay) const;
93 
94 public:
95 	SwDrawView( SwViewImp &rI, SdrModel *pMd, OutputDevice* pOutDev=NULL );
96 
97 	//aus der Basisklasse
98     virtual SdrObject*   GetMaxToTopObj(SdrObject* pObj) const;
99     virtual SdrObject*   GetMaxToBtmObj(SdrObject* pObj) const;
100 	virtual void         MarkListHasChanged();
101 
102 	// #i7672#
103 	// Overload to resue edit background color in active text edit view (OutlinerView)
104 	virtual void ModelHasChanged();
105 
106 	virtual void 	     ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
107 											sal_uLong nNewPos );
108     virtual sal_Bool TakeDragLimit(SdrDragMode eMode, Rectangle& rRect) const;
109 	virtual void MakeVisible( const Rectangle&, Window &rWin );
110 	virtual void CheckPossibilities();
111 
112 	const SwViewImp &Imp() const { return rImp; }
113 		  SwViewImp &Imp()		 { return rImp; }
114 
115 	//Anker und Xor fuer das Draggen.
116 	void ShowDragAnchor();
117 
118 	virtual void DeleteMarked();
119 
120 	//JP 06.10.98: 2. Versuch
121 	inline void ValidateMarkList() { FlushComeBackTimer(); }
122 
123     // --> OD 2009-03-05 #i99665#
124     sal_Bool IsAntiAliasing() const;
125     // <--
126 
127     // OD 18.06.2003 #108784# - method to replace marked/selected <SwDrawVirtObj>
128     // by its reference object for delete of selection and group selection
129     static void ReplaceMarkedDrawVirtObjs( SdrMarkView& _rMarkView );
130 };
131 
132 
133 #endif
134 
135