xref: /AOO41X/main/sw/inc/dcontact.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _DCONTACT_HXX
24cdf0e10cSrcweir #define	_DCONTACT_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <svx/svdobj.hxx>
27cdf0e10cSrcweir #include <svx/svdovirt.hxx>
28cdf0e10cSrcweir #include <swtypes.hxx>
29cdf0e10cSrcweir #include <fmtanchr.hxx>
30cdf0e10cSrcweir #include <frmfmt.hxx>
31cdf0e10cSrcweir #include <list>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include "calbck.hxx"
34cdf0e10cSrcweir #include <anchoreddrawobject.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir class SfxPoolItem;
37cdf0e10cSrcweir class SwFrmFmt;
38cdf0e10cSrcweir class SwFlyFrmFmt;
39cdf0e10cSrcweir class SwFlyFrm;
40cdf0e10cSrcweir class SwFrm;
41cdf0e10cSrcweir class SwPageFrm;
42cdf0e10cSrcweir class SwVirtFlyDrawObj;
43cdf0e10cSrcweir class SwFmtAnchor;
44cdf0e10cSrcweir class SwFlyDrawObj;
45cdf0e10cSrcweir class SwRect;
46cdf0e10cSrcweir class SwDrawContact;
47cdf0e10cSrcweir struct SwPosition;
48cdf0e10cSrcweir class SwIndex;
49cdf0e10cSrcweir class SdrTextObj;
50cdf0e10cSrcweir 
51cdf0e10cSrcweir //Der Umgekehrte Weg: Sucht das Format zum angegebenen Objekt.
52cdf0e10cSrcweir //Wenn das Object ein SwVirtFlyDrawObj ist so wird das Format von
53cdf0e10cSrcweir //selbigem besorgt.
54cdf0e10cSrcweir //Anderfalls ist es eben ein einfaches Zeichenobjekt. Diese hat einen
55cdf0e10cSrcweir //UserCall und der ist Client vom gesuchten Format.
56cdf0e10cSrcweir //Implementierung in dcontact.cxx
57cdf0e10cSrcweir SW_DLLPUBLIC SwFrmFmt *FindFrmFmt( SdrObject *pObj );
FindFrmFmt(const SdrObject * pObj)58cdf0e10cSrcweir inline const SwFrmFmt *FindFrmFmt( const SdrObject *pObj )
59cdf0e10cSrcweir {	return ::FindFrmFmt( (SdrObject*)pObj ); }
60cdf0e10cSrcweir sal_Bool HasWrap( const SdrObject* pObj );
61cdf0e10cSrcweir 
62cdf0e10cSrcweir void setContextWritingMode( SdrObject* pObj, SwFrm* pAnchor );
63cdf0e10cSrcweir 
64cdf0e10cSrcweir //Bei Aenderungen das Objekt aus dem ContourCache entfernen.
65cdf0e10cSrcweir //Implementierung in TxtFly.Cxx
66cdf0e10cSrcweir void ClrContourCache( const SdrObject *pObj );
67cdf0e10cSrcweir 
68cdf0e10cSrcweir // liefert BoundRect inklusive Abstand
69cdf0e10cSrcweir // --> OD 2006-08-15 #i68520# - change naming
70cdf0e10cSrcweir SwRect GetBoundRectOfAnchoredObj( const SdrObject* pObj );
71cdf0e10cSrcweir // <--
72cdf0e10cSrcweir 
73cdf0e10cSrcweir //Liefert den UserCall ggf. vom Gruppenobjekt
74cdf0e10cSrcweir // OD 2004-03-31 #i26791# - change return type
75cdf0e10cSrcweir SwContact* GetUserCall( const SdrObject* );
76cdf0e10cSrcweir 
77cdf0e10cSrcweir // liefert sal_True falls das SrdObject ein Marquee-Object (Lauftext) ist
78cdf0e10cSrcweir sal_Bool IsMarqueeTextObj( const SdrObject& rObj );
79cdf0e10cSrcweir 
80cdf0e10cSrcweir //Basisklasse fuer die folgenden KontaktObjekte (Rahmen+Zeichenobjekte)
81cdf0e10cSrcweir class SwContact : public SdrObjUserCall, public SwClient
82cdf0e10cSrcweir {
83cdf0e10cSrcweir     // OD 05.09.2003 #112039# - boolean, indicating destruction of contact object
84cdf0e10cSrcweir     // important note: boolean has to be set at the beginning of each destructor
85cdf0e10cSrcweir     //                 in the subclasses using method <SetInDTOR()>.
86cdf0e10cSrcweir     bool mbInDTOR;
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     /** method to move object to visible/invisible layer
89cdf0e10cSrcweir 
90cdf0e10cSrcweir         OD 21.08.2003 #i18447#
91cdf0e10cSrcweir         Implementation for the public method <MoveObjToVisibleLayer(..)>
92cdf0e10cSrcweir         and <MoveObjToInvisibleLayer(..)>
93cdf0e10cSrcweir         If object is in invisble respectively visible layer, its moved to
94cdf0e10cSrcweir         the corresponding visible respectively invisible layers.
95cdf0e10cSrcweir         For group object the members are individually moved to the corresponding
96cdf0e10cSrcweir         layer, because <SdrObjGroup::GetLayer()> does return 0, if members
97cdf0e10cSrcweir         aren't on the same layer as the group object, and
98cdf0e10cSrcweir         <SdrObjGroup::SetLayer(..)|NbcSetLayer(..)> sets also the layer of
99cdf0e10cSrcweir         the members.
100cdf0e10cSrcweir         OD 2004-01-15 #110582# - moved from subclass <SwDrawContact>
101cdf0e10cSrcweir 
102cdf0e10cSrcweir         @author OD
103cdf0e10cSrcweir 
104cdf0e10cSrcweir         @param _bToVisible
105cdf0e10cSrcweir         input parameter - boolean indicating, if object has to be moved to
106cdf0e10cSrcweir         visible (== true) or invisible (== false) layer.
107cdf0e10cSrcweir 
108cdf0e10cSrcweir         @param _pDrawObj
109cdf0e10cSrcweir         input parameter, which will be changed - drawing object, which will
110cdf0e10cSrcweir         change its layer.
111cdf0e10cSrcweir     */
112cdf0e10cSrcweir     void _MoveObjToLayer( const bool _bToVisible,
113cdf0e10cSrcweir                           SdrObject* _pDrawObj );
114cdf0e10cSrcweir 
115cdf0e10cSrcweir protected:
116cdf0e10cSrcweir     // OD 05.09.2003 #112039# - accessor to set member <mbInDTOR>
117cdf0e10cSrcweir     void SetInDTOR();
118cdf0e10cSrcweir 
119cdf0e10cSrcweir public:
120cdf0e10cSrcweir 	TYPEINFO();
121cdf0e10cSrcweir 
122cdf0e10cSrcweir 	//Fuer den Reader, es wir nur die Verbindung hergestellt.
123cdf0e10cSrcweir     SwContact( SwFrmFmt *pToRegisterIn );
124cdf0e10cSrcweir     virtual ~SwContact();
125cdf0e10cSrcweir 
126cdf0e10cSrcweir     // OD 2004-03-29 #i26791#
127cdf0e10cSrcweir     virtual const SwAnchoredObject* GetAnchoredObj( const SdrObject* _pSdrObj ) const = 0;
128cdf0e10cSrcweir     virtual SwAnchoredObject* GetAnchoredObj( SdrObject* _pSdrObj ) = 0;
129cdf0e10cSrcweir 
130cdf0e10cSrcweir     // OD 13.05.2003 #108784# - made methods virtual and not inline
131cdf0e10cSrcweir     // OD 2004-04-01 #i26791# - made methods pure virtual
132cdf0e10cSrcweir     virtual const SdrObject *GetMaster() const = 0;
133cdf0e10cSrcweir     virtual SdrObject *GetMaster() = 0;
134cdf0e10cSrcweir     virtual void SetMaster( SdrObject* _pNewMaster ) = 0;
135cdf0e10cSrcweir 
GetFmt()136cdf0e10cSrcweir 		  SwFrmFmt	*GetFmt(){ return (SwFrmFmt*)GetRegisteredIn(); }
GetFmt() const137cdf0e10cSrcweir 	const SwFrmFmt	*GetFmt() const
138cdf0e10cSrcweir 		{ return (const SwFrmFmt*)GetRegisteredIn(); }
139cdf0e10cSrcweir 
140cdf0e10cSrcweir     // OD 05.09.2003 #112039# - accessor for member <mbInDTOR>
141cdf0e10cSrcweir     bool IsInDTOR() const;
142cdf0e10cSrcweir 
143cdf0e10cSrcweir     /** method to move drawing object to corresponding visible layer
144cdf0e10cSrcweir 
145cdf0e10cSrcweir         OD 21.08.2003 #i18447#
146cdf0e10cSrcweir         uses method <_MoveObjToLayer(..)>
147cdf0e10cSrcweir         OD 2004-01-15 #110582# - moved from subclass <SwDrawContact> and made virtual
148cdf0e10cSrcweir 
149cdf0e10cSrcweir         @author OD
150cdf0e10cSrcweir 
151cdf0e10cSrcweir         @param _pDrawObj
152cdf0e10cSrcweir         drawing object, which will be moved to the visible layer
153cdf0e10cSrcweir     */
154cdf0e10cSrcweir     virtual void MoveObjToVisibleLayer( SdrObject* _pDrawObj );
155cdf0e10cSrcweir 
156cdf0e10cSrcweir     /** method to move drawing object to corresponding invisible layer
157cdf0e10cSrcweir 
158cdf0e10cSrcweir         OD 21.08.2003 #i18447#
159cdf0e10cSrcweir         uses method <_MoveObjToLayer(..)>
160cdf0e10cSrcweir         OD 2004-01-15 #110582# - moved from subclass <SwDrawContact> and made virtual.
161cdf0e10cSrcweir 
162cdf0e10cSrcweir         @author OD
163cdf0e10cSrcweir 
164cdf0e10cSrcweir         @param _pDrawObj
165cdf0e10cSrcweir         drawing object, which will be moved to the visible layer
166cdf0e10cSrcweir     */
167cdf0e10cSrcweir     virtual void MoveObjToInvisibleLayer( SdrObject* _pDrawObj );
168cdf0e10cSrcweir 
169cdf0e10cSrcweir     // -------------------------------------------------------------------------
170cdf0e10cSrcweir     // OD 2004-01-16 #110582# - some virtual helper methods for information
171cdf0e10cSrcweir     // about the object (Writer fly frame resp. drawing object)
GetAnchorFmt() const172cdf0e10cSrcweir     const SwFmtAnchor& GetAnchorFmt() const
173cdf0e10cSrcweir     {
174cdf0e10cSrcweir         ASSERT( GetFmt(),
175cdf0e10cSrcweir                 "<SwContact::GetAnchorFmt()> - no frame format -> crash" );
176cdf0e10cSrcweir 
177cdf0e10cSrcweir         return GetFmt()->GetAnchor();
178cdf0e10cSrcweir     }
179cdf0e10cSrcweir 
GetAnchorId() const180cdf0e10cSrcweir     RndStdIds GetAnchorId() const { return GetAnchorFmt().GetAnchorId(); }
ObjAnchoredAtPage() const181cdf0e10cSrcweir     bool      ObjAnchoredAtPage() const { return GetAnchorId() == FLY_AT_PAGE; }
ObjAnchoredAtFly() const182cdf0e10cSrcweir     bool      ObjAnchoredAtFly()  const { return GetAnchorId() == FLY_AT_FLY; }
ObjAnchoredAtPara() const183cdf0e10cSrcweir     bool      ObjAnchoredAtPara() const { return GetAnchorId() == FLY_AT_PARA; }
ObjAnchoredAtChar() const184cdf0e10cSrcweir     bool      ObjAnchoredAtChar() const { return GetAnchorId() == FLY_AT_CHAR; }
ObjAnchoredAsChar() const185cdf0e10cSrcweir     bool      ObjAnchoredAsChar() const { return GetAnchorId() == FLY_AS_CHAR; }
186cdf0e10cSrcweir 
GetCntntAnchor() const187cdf0e10cSrcweir     const SwPosition&  GetCntntAnchor() const
188cdf0e10cSrcweir     {
189cdf0e10cSrcweir         ASSERT( GetAnchorFmt().GetCntntAnchor(),
190cdf0e10cSrcweir                 "<SwContact::GetCntntAnchor()> - no content anchor -> crash" );
191cdf0e10cSrcweir 
192cdf0e10cSrcweir         return *(GetAnchorFmt().GetCntntAnchor());
193cdf0e10cSrcweir     }
194cdf0e10cSrcweir 
195cdf0e10cSrcweir     const SwIndex&     GetCntntAnchorIndex() const;
196cdf0e10cSrcweir 
197cdf0e10cSrcweir     // -------------------------------------------------------------------------
198cdf0e10cSrcweir 
199cdf0e10cSrcweir     /** get data collection of anchored objects, handled by with contact
200cdf0e10cSrcweir 
201cdf0e10cSrcweir         OD 2004-08-23 #110810#
202cdf0e10cSrcweir 
203cdf0e10cSrcweir         @author
204cdf0e10cSrcweir     */
205cdf0e10cSrcweir     virtual void GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const = 0;
206cdf0e10cSrcweir 
207cdf0e10cSrcweir     /** get minimum order number of anchored objects handled by with contact
208cdf0e10cSrcweir 
209cdf0e10cSrcweir         OD 2004-08-24 #110810#
210cdf0e10cSrcweir 
211cdf0e10cSrcweir         @author
212cdf0e10cSrcweir     */
213cdf0e10cSrcweir     sal_uInt32 GetMinOrdNum() const;
214cdf0e10cSrcweir 
215cdf0e10cSrcweir     /** get maximum order number of anchored objects handled by with contact
216cdf0e10cSrcweir 
217cdf0e10cSrcweir         OD 2004-08-24 #110810#
218cdf0e10cSrcweir 
219cdf0e10cSrcweir         @author
220cdf0e10cSrcweir     */
221cdf0e10cSrcweir     sal_uInt32 GetMaxOrdNum() const;
222cdf0e10cSrcweir };
223cdf0e10cSrcweir 
224cdf0e10cSrcweir //KontactObjekt fuer die Verbindung zwischen Rahmen bzw. deren Formaten
225cdf0e10cSrcweir //im StarWriter (SwClient) und den Zeichenobjekten des Drawing (SdrObjUserCall)
226cdf0e10cSrcweir 
227cdf0e10cSrcweir class SW_DLLPUBLIC SwFlyDrawContact : public SwContact
228cdf0e10cSrcweir {
229cdf0e10cSrcweir private:
230cdf0e10cSrcweir     // OD 2004-04-01 #i26791#
231cdf0e10cSrcweir     SwFlyDrawObj* mpMasterObj;
232cdf0e10cSrcweir 
233cdf0e10cSrcweir protected:
234cdf0e10cSrcweir 	 // virtuelle Methoden von SwClient
235cdf0e10cSrcweir     virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
236cdf0e10cSrcweir 
237cdf0e10cSrcweir public:
238cdf0e10cSrcweir 	TYPEINFO();
239cdf0e10cSrcweir 
240cdf0e10cSrcweir 	//Legt das DrawObjekt an und meldet es beim Model an.
241cdf0e10cSrcweir     SwFlyDrawContact( SwFlyFrmFmt* pToRegisterIn, SdrModel* pMod );
242cdf0e10cSrcweir     virtual ~SwFlyDrawContact();
243cdf0e10cSrcweir 
244cdf0e10cSrcweir     // OD 2004-03-29 #i26791#
245cdf0e10cSrcweir     virtual const SwAnchoredObject* GetAnchoredObj( const SdrObject* _pSdrObj ) const;
246cdf0e10cSrcweir     virtual SwAnchoredObject* GetAnchoredObj( SdrObject* _pSdrObj );
247cdf0e10cSrcweir 
248cdf0e10cSrcweir     // OD 2004-04-01 #i26791#
249cdf0e10cSrcweir     virtual const SdrObject* GetMaster() const;
250cdf0e10cSrcweir     virtual SdrObject* GetMaster();
251cdf0e10cSrcweir     virtual void SetMaster( SdrObject* _pNewMaster );
252cdf0e10cSrcweir 
253cdf0e10cSrcweir     // OD 2004-01-16 #110582# - override methods to control Writer fly frames,
254cdf0e10cSrcweir     // which are linked, and to assure that all objects anchored at/inside the
255cdf0e10cSrcweir     // Writer fly frame are also made visible/invisible.
256cdf0e10cSrcweir     virtual void MoveObjToVisibleLayer( SdrObject* _pDrawObj );
257cdf0e10cSrcweir     virtual void MoveObjToInvisibleLayer( SdrObject* _pDrawObj );
258cdf0e10cSrcweir 
259cdf0e10cSrcweir     /** get data collection of anchored objects handled by with contact
260cdf0e10cSrcweir 
261cdf0e10cSrcweir         OD 2004-08-23 #110810#
262cdf0e10cSrcweir 
263cdf0e10cSrcweir         @author
264cdf0e10cSrcweir     */
265cdf0e10cSrcweir     virtual void GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const;
266cdf0e10cSrcweir };
267cdf0e10cSrcweir 
268cdf0e10cSrcweir // OD 16.05.2003 #108784# - new class for re-direct methods calls at a 'virtual'
269cdf0e10cSrcweir //      drawing object to its referenced object.
270cdf0e10cSrcweir class SwDrawVirtObj : public SdrVirtObj
271cdf0e10cSrcweir {
272cdf0e10cSrcweir     private:
273cdf0e10cSrcweir         // data for connection to writer layout
274cdf0e10cSrcweir         // OD 2004-03-25 #i26791# - anchored drawing object instance for the
275cdf0e10cSrcweir         // 'virtual' drawing object
276cdf0e10cSrcweir         SwAnchoredDrawObject maAnchoredDrawObj;
277cdf0e10cSrcweir 
278cdf0e10cSrcweir         // writer-drawing contact object the 'virtual' drawing object is controlled by.
279cdf0e10cSrcweir         // This object is also the <UserCall> of the drawing object, if it's
280cdf0e10cSrcweir         // inserted into the drawing layer.
281cdf0e10cSrcweir         SwDrawContact&  mrDrawContact;
282cdf0e10cSrcweir 
283cdf0e10cSrcweir         using SdrVirtObj::GetPlusHdl;
284cdf0e10cSrcweir 
285cdf0e10cSrcweir    protected:
286cdf0e10cSrcweir         // AW: Need own sdr::contact::ViewContact since AnchorPos from parent is
287cdf0e10cSrcweir         // not used but something own (top left of new SnapRect minus top left
288cdf0e10cSrcweir         // of original SnapRect)
289cdf0e10cSrcweir         virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
290cdf0e10cSrcweir 
291cdf0e10cSrcweir    public:
292cdf0e10cSrcweir         TYPEINFO();
293cdf0e10cSrcweir 
294cdf0e10cSrcweir         SwDrawVirtObj( SdrObject&       _rNewObj,
295cdf0e10cSrcweir                        SwDrawContact&   _rDrawContact );
296cdf0e10cSrcweir         virtual ~SwDrawVirtObj();
297cdf0e10cSrcweir 
298cdf0e10cSrcweir 		// access to offset
299cdf0e10cSrcweir         // OD 30.06.2003 #108784# - virtual!!!
300cdf0e10cSrcweir         virtual const Point GetOffset() const;
301cdf0e10cSrcweir 
302cdf0e10cSrcweir         virtual SdrObject* Clone() const;
303cdf0e10cSrcweir         virtual void operator=( const SdrObject& rObj );
304cdf0e10cSrcweir 
305cdf0e10cSrcweir         // connection to writer layout
306cdf0e10cSrcweir         // OD 2004-03-29 #i26791#
307cdf0e10cSrcweir         const SwAnchoredObject* GetAnchoredObj() const;
308cdf0e10cSrcweir         SwAnchoredObject* AnchoredObj();
309cdf0e10cSrcweir         const SwFrm* GetAnchorFrm() const;
310cdf0e10cSrcweir         SwFrm* AnchorFrm();
311cdf0e10cSrcweir         void RemoveFromWriterLayout();
312cdf0e10cSrcweir 
313cdf0e10cSrcweir         // connection to drawing layer
314cdf0e10cSrcweir         void AddToDrawingPage();
315cdf0e10cSrcweir         void RemoveFromDrawingPage();
316cdf0e10cSrcweir 
317cdf0e10cSrcweir         // is 'virtual' drawing object connected to writer layout and
318cdf0e10cSrcweir         // to drawing layer.
319cdf0e10cSrcweir         bool IsConnected() const;
320cdf0e10cSrcweir 
321cdf0e10cSrcweir         virtual void NbcSetAnchorPos(const Point& rPnt);
322cdf0e10cSrcweir 
323cdf0e10cSrcweir         // #108784#
324cdf0e10cSrcweir 		// All overloaded methods which need to use the offset
325cdf0e10cSrcweir 		virtual void RecalcBoundRect();
326cdf0e10cSrcweir 		virtual ::basegfx::B2DPolyPolygon TakeXorPoly() const;
327cdf0e10cSrcweir         virtual ::basegfx::B2DPolyPolygon TakeContour() const;
328cdf0e10cSrcweir 		virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
329cdf0e10cSrcweir 		virtual SdrHdl* GetPlusHdl(const SdrHdl& rHdl, sal_uInt16 nPlNum) const;
330cdf0e10cSrcweir         virtual void NbcMove(const Size& rSiz);
331cdf0e10cSrcweir 		virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
332cdf0e10cSrcweir 		virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
333cdf0e10cSrcweir 		virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
334cdf0e10cSrcweir 		virtual void NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
335cdf0e10cSrcweir         virtual void Move(const Size& rSiz);
336cdf0e10cSrcweir         virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
337cdf0e10cSrcweir 		virtual void Rotate(const Point& rRef, long nWink, double sn, double cs);
338cdf0e10cSrcweir 		virtual void Mirror(const Point& rRef1, const Point& rRef2);
339cdf0e10cSrcweir 		virtual void Shear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
340cdf0e10cSrcweir 		virtual void RecalcSnapRect();
341cdf0e10cSrcweir 		virtual const Rectangle& GetSnapRect() const;
342cdf0e10cSrcweir 		virtual void SetSnapRect(const Rectangle& rRect);
343cdf0e10cSrcweir         virtual void NbcSetSnapRect(const Rectangle& rRect);
344cdf0e10cSrcweir 		virtual const Rectangle& GetLogicRect() const;
345cdf0e10cSrcweir 		virtual void SetLogicRect(const Rectangle& rRect);
346cdf0e10cSrcweir         virtual void NbcSetLogicRect(const Rectangle& rRect);
347cdf0e10cSrcweir 		virtual Point GetSnapPoint(sal_uInt32 i) const;
348cdf0e10cSrcweir 		virtual Point GetPoint(sal_uInt32 i) const;
349cdf0e10cSrcweir         virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i);
350cdf0e10cSrcweir 
351cdf0e10cSrcweir 		// #108784#
352cdf0e10cSrcweir 		virtual FASTBOOL HasTextEdit() const;
353cdf0e10cSrcweir 
354cdf0e10cSrcweir         // OD 17.06.2003 #108784# - overload 'layer' methods
355cdf0e10cSrcweir         virtual SdrLayerID GetLayer() const;
356cdf0e10cSrcweir         virtual void NbcSetLayer(SdrLayerID nLayer);
357cdf0e10cSrcweir         virtual void SetLayer(SdrLayerID nLayer);
358cdf0e10cSrcweir 
359cdf0e10cSrcweir         // FullDrag support
360cdf0e10cSrcweir 	    virtual bool supportsFullDrag() const;
361cdf0e10cSrcweir 	    virtual SdrObject* getFullDragClone() const;
362cdf0e10cSrcweir 
363cdf0e10cSrcweir         // #i97197#
364cdf0e10cSrcweir 	    virtual void SetBoundRectDirty();
365cdf0e10cSrcweir     	virtual const Rectangle& GetCurrentBoundRect() const;
366cdf0e10cSrcweir     	virtual const Rectangle& GetLastBoundRect() const;
367cdf0e10cSrcweir };
368cdf0e10cSrcweir 
369cdf0e10cSrcweir // OD 26.06.2003 #108784#
370cdf0e10cSrcweir bool CheckControlLayer( const SdrObject *pObj );
371cdf0e10cSrcweir 
372cdf0e10cSrcweir //KontactObjekt fuer die Verbindung von Formaten als Repraesentanten der
373cdf0e10cSrcweir //Zeichenobjekte im StarWriter (SwClient) und den Objekten selbst im Drawing
374cdf0e10cSrcweir //(SdrObjUserCall).
375cdf0e10cSrcweir 
376cdf0e10cSrcweir // --> OD 2006-01-18 #129959#
377cdf0e10cSrcweir class NestedUserCallHdl;
378cdf0e10cSrcweir // <--
379cdf0e10cSrcweir 
380cdf0e10cSrcweir class SwDrawContact : public SwContact
381cdf0e10cSrcweir {
382cdf0e10cSrcweir     private:
383cdf0e10cSrcweir         // OD 2004-03-25 #i26791# - anchored drawing object instance for the
384cdf0e10cSrcweir         // 'master' drawing object
385cdf0e10cSrcweir         SwAnchoredDrawObject maAnchoredDrawObj;
386cdf0e10cSrcweir 
387cdf0e10cSrcweir         // OD 16.05.2003 #108784# - data structure for collecting 'virtual'
388cdf0e10cSrcweir         // drawing object supporting drawing objects in headers/footers.
389cdf0e10cSrcweir         std::list<SwDrawVirtObj*> maDrawVirtObjs;
390cdf0e10cSrcweir 
391cdf0e10cSrcweir         // OD 2004-04-01 #i26791# - boolean indicating set 'master' drawing
392cdf0e10cSrcweir         // object has been cleared.
393cdf0e10cSrcweir         bool mbMasterObjCleared : 1;
394cdf0e10cSrcweir 
395cdf0e10cSrcweir         // OD 10.10.2003 #112299# - internal flag to indicate that disconnect
396cdf0e10cSrcweir         // from layout is in progress
397cdf0e10cSrcweir         bool mbDisconnectInProgress : 1;
398cdf0e10cSrcweir 
399cdf0e10cSrcweir         // --> OD 2006-01-18 #129959#
400cdf0e10cSrcweir         // Needed data for handling of nested <SdrObjUserCall> events in
401cdf0e10cSrcweir         // method <_Changed(..)>
402cdf0e10cSrcweir         bool mbUserCallActive : 1;
403cdf0e10cSrcweir         // event type, which is handled for <mpSdrObjHandledByCurrentUserCall>.
404cdf0e10cSrcweir         // Note: value only valid, if <mbUserCallActive> is sal_True.
405cdf0e10cSrcweir         SdrUserCallType meEventTypeOfCurrentUserCall;
406cdf0e10cSrcweir 
407cdf0e10cSrcweir         friend class NestedUserCallHdl;
408cdf0e10cSrcweir         // <--
409cdf0e10cSrcweir 
410cdf0e10cSrcweir         // unary function used by <list> iterator to find a disconnected 'virtual'
411cdf0e10cSrcweir         // drawing object
412cdf0e10cSrcweir         struct UsedOrUnusedVirtObjPred
413cdf0e10cSrcweir         {
414cdf0e10cSrcweir             bool mbUsedPred;
UsedOrUnusedVirtObjPredSwDrawContact::UsedOrUnusedVirtObjPred415cdf0e10cSrcweir             UsedOrUnusedVirtObjPred( bool _bUsed ) : mbUsedPred( _bUsed ) {};
operator ()SwDrawContact::UsedOrUnusedVirtObjPred416cdf0e10cSrcweir             bool operator() ( const SwDrawVirtObj* _pDrawVirtObj )
417cdf0e10cSrcweir             {
418cdf0e10cSrcweir                 if ( mbUsedPred )
419cdf0e10cSrcweir                 {
420cdf0e10cSrcweir                     return _pDrawVirtObj->IsConnected();
421cdf0e10cSrcweir                 }
422cdf0e10cSrcweir                 else
423cdf0e10cSrcweir                 {
424cdf0e10cSrcweir                     return !_pDrawVirtObj->IsConnected();
425cdf0e10cSrcweir                 }
426cdf0e10cSrcweir             }
427cdf0e10cSrcweir         };
428cdf0e10cSrcweir 
429cdf0e10cSrcweir         // unary function used by <list> iterator to find a 'virtual' drawing
430cdf0e10cSrcweir         // object anchored at a given frame
431cdf0e10cSrcweir         struct VirtObjAnchoredAtFrmPred
432cdf0e10cSrcweir         {
433cdf0e10cSrcweir             const SwFrm* mpAnchorFrm;
434cdf0e10cSrcweir             VirtObjAnchoredAtFrmPred( const SwFrm& _rAnchorFrm );
435cdf0e10cSrcweir             bool operator() ( const SwDrawVirtObj* _pDrawVirtObj );
436cdf0e10cSrcweir         };
437cdf0e10cSrcweir 
438cdf0e10cSrcweir         // OD 16.05.2003 #108784# - method for adding/removing 'virtual' drawing object.
439cdf0e10cSrcweir         SwDrawVirtObj* CreateVirtObj();
440cdf0e10cSrcweir         void DestroyVirtObj( SwDrawVirtObj* pVirtObj );
441cdf0e10cSrcweir         void RemoveAllVirtObjs();
442cdf0e10cSrcweir 
443cdf0e10cSrcweir         // OD 2004-03-31 #i26791#
444cdf0e10cSrcweir         void _InvalidateObjs( const bool _bUpdateSortedObjsList = false );
445cdf0e10cSrcweir 
446cdf0e10cSrcweir         // --> OD 2006-01-23 #124157#
447cdf0e10cSrcweir         // no copy-constructor and no assignment operator
448cdf0e10cSrcweir         SwDrawContact( const SwDrawContact& );
449cdf0e10cSrcweir         SwDrawContact& operator=( const SwDrawContact& );
450cdf0e10cSrcweir         // <--
451cdf0e10cSrcweir 
452cdf0e10cSrcweir     protected:
453cdf0e10cSrcweir         // virtuelle Methoden von SwClient
454cdf0e10cSrcweir         virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
455cdf0e10cSrcweir 
456cdf0e10cSrcweir     public:
457cdf0e10cSrcweir         TYPEINFO();
458cdf0e10cSrcweir 
459cdf0e10cSrcweir         SwDrawContact( SwFrmFmt *pToRegisterIn, SdrObject *pObj );
460cdf0e10cSrcweir         virtual ~SwDrawContact();
461cdf0e10cSrcweir 
462cdf0e10cSrcweir         // OD 2004-03-29 #i26791#
463cdf0e10cSrcweir         // --> OD 2005-01-06 #i30669# - no default value for parameter <_pSdrObj>
464cdf0e10cSrcweir         virtual const SwAnchoredObject* GetAnchoredObj( const SdrObject* _pSdrObj ) const;
465cdf0e10cSrcweir         virtual SwAnchoredObject* GetAnchoredObj( SdrObject* _pSdrObj );
466cdf0e10cSrcweir         // <--
467cdf0e10cSrcweir 
468cdf0e10cSrcweir         // OD 2004-04-01 #i26791#
469cdf0e10cSrcweir         virtual const SdrObject* GetMaster() const;
470cdf0e10cSrcweir         virtual SdrObject* GetMaster();
471cdf0e10cSrcweir         virtual void SetMaster( SdrObject* _pNewMaster );
472cdf0e10cSrcweir 
473cdf0e10cSrcweir         // OD 2004-03-29 #i26791#
474cdf0e10cSrcweir         const SwFrm* GetAnchorFrm( const SdrObject* _pDrawObj = 0L ) const;
475cdf0e10cSrcweir         SwFrm* GetAnchorFrm( SdrObject* _pDrawObj = 0L );
476cdf0e10cSrcweir 
477cdf0e10cSrcweir         // --> OD 2004-06-30 #i28701# - page frame is now stored at member <maAnchoredDrawObj>
GetPageFrm() const478cdf0e10cSrcweir         inline const SwPageFrm* GetPageFrm() const
479cdf0e10cSrcweir         {
480cdf0e10cSrcweir             return maAnchoredDrawObj.GetPageFrm();
481cdf0e10cSrcweir         }
GetPageFrm()482cdf0e10cSrcweir         inline SwPageFrm* GetPageFrm()
483cdf0e10cSrcweir         {
484cdf0e10cSrcweir             return maAnchoredDrawObj.GetPageFrm();
485cdf0e10cSrcweir         }
SetPageFrm(SwPageFrm * _pNewPageFrm)486cdf0e10cSrcweir         void SetPageFrm( SwPageFrm* _pNewPageFrm )
487cdf0e10cSrcweir         {
488cdf0e10cSrcweir             return maAnchoredDrawObj.SetPageFrm( _pNewPageFrm );
489cdf0e10cSrcweir         }
490cdf0e10cSrcweir         // <--
491cdf0e10cSrcweir         void ChkPage();
492cdf0e10cSrcweir         SwPageFrm* FindPage( const SwRect &rRect );
493cdf0e10cSrcweir 
494cdf0e10cSrcweir         //Fuegt das SdrObject in die Arrays (SwPageFrm und SwFrm) des Layouts ein.
495cdf0e10cSrcweir         //Der Anker wird Anhand des Attributes SwFmtAnchor bestimmt.
496cdf0e10cSrcweir         //Das Objekt wird ggf. beim alten Anker abgemeldet.
497cdf0e10cSrcweir         void ConnectToLayout( const SwFmtAnchor *pAnch = 0 );
498cdf0e10cSrcweir         // OD 27.06.2003 #108784# - method to insert 'master' drawing object
499cdf0e10cSrcweir         // into drawing page
500cdf0e10cSrcweir         void InsertMasterIntoDrawPage();
501cdf0e10cSrcweir 
502cdf0e10cSrcweir         void DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer = true );
503cdf0e10cSrcweir         // OD 19.06.2003 #108784# - disconnect for a dedicated drawing object -
504cdf0e10cSrcweir         // could be 'master' or 'virtual'.
505cdf0e10cSrcweir         void DisconnectObjFromLayout( SdrObject* _pDrawObj );
506cdf0e10cSrcweir         // OD 26.06.2003 #108784# - method to remove 'master' drawing object
507cdf0e10cSrcweir         // from drawing page.
508cdf0e10cSrcweir         // To be used by the undo for delete of object. Call it after method
509cdf0e10cSrcweir         // <DisconnectFromLayout( bool = true )> is already performed.
510cdf0e10cSrcweir         // Note: <DisconnectFromLayout( bool )> no longer removes the 'master'
511cdf0e10cSrcweir         // drawing object from drawing page.
512cdf0e10cSrcweir         void RemoveMasterFromDrawPage();
513cdf0e10cSrcweir 
514cdf0e10cSrcweir         // OD 19.06.2003 #108784# - get drawing object ('master' or 'virtual')
515cdf0e10cSrcweir         // by frame.
516cdf0e10cSrcweir         SdrObject* GetDrawObjectByAnchorFrm( const SwFrm& _rAnchorFrm );
517cdf0e10cSrcweir 
518cdf0e10cSrcweir         // virtuelle Methoden von SdrObjUserCall
519cdf0e10cSrcweir         virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectangle& rOldBoundRect);
520cdf0e10cSrcweir 
521cdf0e10cSrcweir         // wird von Changed() und auch vom UndoDraw benutzt, uebernimmt
522cdf0e10cSrcweir         // das Notifien von Absaetzen, die ausweichen muessen
523cdf0e10cSrcweir         void _Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectangle* pOldBoundRect);
524cdf0e10cSrcweir 
525cdf0e10cSrcweir         //Moved alle SW-Verbindungen zu dem neuen Master.
526cdf0e10cSrcweir         void ChangeMasterObject( SdrObject *pNewMaster );
527cdf0e10cSrcweir 
528cdf0e10cSrcweir         // OD 19.06.2003 #108784#
529cdf0e10cSrcweir         SwDrawVirtObj* AddVirtObj();
530cdf0e10cSrcweir 
531cdf0e10cSrcweir         // OD 20.06.2003 #108784#
532cdf0e10cSrcweir         void NotifyBackgrdOfAllVirtObjs( const Rectangle* pOldBoundRect );
533cdf0e10cSrcweir 
534cdf0e10cSrcweir         /** get data collection of anchored objects, handled by with contact
535cdf0e10cSrcweir 
536cdf0e10cSrcweir             OD 2004-08-23 #110810#
537cdf0e10cSrcweir 
538cdf0e10cSrcweir             @author
539cdf0e10cSrcweir         */
540cdf0e10cSrcweir 
541cdf0e10cSrcweir         static void GetTextObjectsFromFmt( std::list<SdrTextObj*>&, SwDoc* );
542cdf0e10cSrcweir         virtual void GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const;
543cdf0e10cSrcweir };
544cdf0e10cSrcweir 
545cdf0e10cSrcweir #endif
546