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: dflyobj.hxx,v $
10 * $Revision: 1.11.24.1 $
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 ************************************************************************/
32 #include <svx/svdovirt.hxx>
36 class SdrObjMacroHitRec
;
38 const UINT32 SWGInventor
= UINT32('S')*0x00000001+
39 UINT32('W')*0x00000100+
40 UINT32('G')*0x00010000;
42 const UINT16 SwFlyDrawObjIdentifier
= 0x0001;
43 const UINT16 SwDrawFirst
= 0x0001;
45 //---------------------------------------
46 //SwFlyDrawObj, Die DrawObjekte fuer Flys.
48 class SwFlyDrawObj
: public SdrObject
50 virtual sdr::properties::BaseProperties
* CreateObjectSpecificProperties();
52 // #i95264# SwFlyDrawObj needs an own VC since createViewIndependentPrimitive2DSequence()
53 // is called when RecalcBoundRect() is used
54 virtual sdr::contact::ViewContact
* CreateObjectSpecificViewContact();
62 //Damit eine Instanz dieser Klasse beim laden erzeugt werden kann
64 virtual UINT32
GetObjInventor() const;
65 virtual UINT16
GetObjIdentifier() const;
66 virtual UINT16
GetObjVersion() const;
69 //---------------------------------------
70 //SwVirtFlyDrawObj, die virtuellen Objekte fuer Flys.
71 //Flys werden immer mit virtuellen Objekten angezeigt. Nur so koennen sie
72 //ggf. mehrfach angezeigt werden (Kopf-/Fusszeilen).
74 class SwVirtFlyDrawObj
: public SdrVirtObj
79 // AW: Need own sdr::contact::ViewContact since AnchorPos from parent is
80 // not used but something own (top left of new SnapRect minus top left
81 // of original SnapRect)
82 virtual sdr::contact::ViewContact
* CreateObjectSpecificViewContact();
85 // for paints triggered form ExecutePrimitive
86 void wrap_DoPaintObject() const;
88 // for simple access to inner and outer bounds
89 basegfx::B2DRange
getOuterBound() const;
90 basegfx::B2DRange
getInnerBound() const;
95 SwVirtFlyDrawObj(SdrObject
& rNew
, SwFlyFrm
* pFly
);
98 //Ueberladene Methoden der Basisklasse SdrVirtObj
99 virtual void TakeObjInfo( SdrObjTransformInfoRec
& rInfo
) const;
101 //Wir nehemen die Groessenbehandlung vollstaendig selbst in die Hand.
102 virtual const Rectangle
& GetCurrentBoundRect() const;
103 virtual void RecalcBoundRect();
104 virtual void RecalcSnapRect();
105 virtual const Rectangle
& GetSnapRect() const;
106 virtual void SetSnapRect(const Rectangle
& rRect
);
107 virtual void NbcSetSnapRect(const Rectangle
& rRect
);
108 virtual const Rectangle
& GetLogicRect() const;
109 virtual void SetLogicRect(const Rectangle
& rRect
);
110 virtual void NbcSetLogicRect(const Rectangle
& rRect
);
111 virtual ::basegfx::B2DPolyPolygon
TakeXorPoly() const;
112 virtual void NbcMove (const Size
& rSiz
);
113 virtual void NbcResize(const Point
& rRef
, const Fraction
& xFact
,
114 const Fraction
& yFact
);
115 virtual void Move (const Size
& rSiz
);
116 virtual void Resize(const Point
& rRef
, const Fraction
& xFact
,
117 const Fraction
& yFact
);
119 const SwFrmFmt
*GetFmt() const;
122 // Get Methoden fuer die Fly Verpointerung
123 SwFlyFrm
* GetFlyFrm() { return pFlyFrm
; }
124 const SwFlyFrm
* GetFlyFrm() const { return pFlyFrm
; }
126 void SetRect() const;
128 // ist eine URL an einer Grafik gesetzt, dann ist das ein Makro-Object
129 virtual FASTBOOL
HasMacro() const;
130 virtual SdrObject
* CheckMacroHit (const SdrObjMacroHitRec
& rRec
) const;
131 virtual Pointer
GetMacroPointer (const SdrObjMacroHitRec
& rRec
) const;
134 virtual bool supportsFullDrag() const;
135 virtual SdrObject
* getFullDragClone() const;