xref: /trunk/main/sw/source/core/inc/dflyobj.hxx (revision 1d2dbeb0)
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 #ifndef _DFLYOBJ_HXX
24 #define	_DFLYOBJ_HXX
25 #include <svx/svdovirt.hxx>
26 
27 class SwFlyFrm;
28 class SwFrmFmt;
29 class SdrObjMacroHitRec;
30 
31 const sal_uInt32 SWGInventor =	sal_uInt32('S')*0x00000001+
32 							sal_uInt32('W')*0x00000100+
33 							sal_uInt32('G')*0x00010000;
34 
35 const sal_uInt16 SwFlyDrawObjIdentifier = 0x0001;
36 const sal_uInt16 SwDrawFirst			= 0x0001;
37 
38 //---------------------------------------
39 //SwFlyDrawObj, Die DrawObjekte fuer Flys.
40 
41 class SwFlyDrawObj : public SdrObject
42 {
43 private:
44 	virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
45 
46 protected:
47     // #i95264# SwFlyDrawObj needs an own VC since createViewIndependentPrimitive2DSequence()
48     // is called when RecalcBoundRect() is used
49     virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
50 
51 public:
52 	TYPEINFO();
53 
54 	SwFlyDrawObj();
55 	~SwFlyDrawObj();
56 
57 	//Damit eine Instanz dieser Klasse beim laden erzeugt werden kann
58 	//(per Factory).
59 	virtual sal_uInt32 GetObjInventor()		const;
60 	virtual sal_uInt16 GetObjIdentifier()	const;
61 	virtual sal_uInt16 GetObjVersion()		const;
62 };
63 
64 //---------------------------------------
65 //SwVirtFlyDrawObj, die virtuellen Objekte fuer Flys.
66 //Flys werden immer mit virtuellen Objekten angezeigt. Nur so koennen sie
67 //ggf. mehrfach angezeigt werden (Kopf-/Fusszeilen).
68 
69 class SwVirtFlyDrawObj : public SdrVirtObj
70 {
71 private:
72 	SwFlyFrm *pFlyFrm;
73 
74 protected:
75     // AW: Need own sdr::contact::ViewContact since AnchorPos from parent is
76     // not used but something own (top left of new SnapRect minus top left
77     // of original SnapRect)
78     virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
79 
80 public:
81     // for paints triggered form ExecutePrimitive
82 	void wrap_DoPaintObject() const;
83 
84     // for simple access to inner and outer bounds
85     basegfx::B2DRange getOuterBound() const;
86     basegfx::B2DRange getInnerBound() const;
87 
88 public:
89 	TYPEINFO();
90 
91 	SwVirtFlyDrawObj(SdrObject& rNew, SwFlyFrm* pFly);
92 	~SwVirtFlyDrawObj();
93 
94 	//Ueberladene Methoden der Basisklasse SdrVirtObj
95 	virtual void  	 TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const;
96 
97 	//Wir nehemen die Groessenbehandlung vollstaendig selbst in die Hand.
98     virtual const Rectangle& GetCurrentBoundRect() const;
99     virtual const Rectangle& GetLastBoundRect() const;
100 	virtual		  void		 RecalcBoundRect();
101 	virtual		  void		 RecalcSnapRect();
102 	virtual const Rectangle& GetSnapRect()	const;
103 	virtual		  void		 SetSnapRect(const Rectangle& rRect);
104 	virtual		  void		 NbcSetSnapRect(const Rectangle& rRect);
105 	virtual const Rectangle& GetLogicRect() const;
106 	virtual		  void		 SetLogicRect(const Rectangle& rRect);
107 	virtual		  void		 NbcSetLogicRect(const Rectangle& rRect);
108 	virtual ::basegfx::B2DPolyPolygon TakeXorPoly() const;
109 	virtual		  void		 NbcMove  (const Size& rSiz);
110 	virtual		  void		 NbcResize(const Point& rRef, const Fraction& xFact,
111 									   const Fraction& yFact);
112 	virtual		  void		 Move  (const Size& rSiz);
113 	virtual		  void		 Resize(const Point& rRef, const Fraction& xFact,
114 									const Fraction& yFact);
115 
116 	const SwFrmFmt *GetFmt() const;
117           SwFrmFmt *GetFmt();
118 
119 	// Get Methoden fuer die Fly Verpointerung
GetFlyFrm()120 		  SwFlyFrm* GetFlyFrm()			{ return pFlyFrm; }
GetFlyFrm() const121 	const SwFlyFrm* GetFlyFrm() const	{ return pFlyFrm; }
122 
123 	void SetRect() const;
124 
125 	// ist eine URL an einer Grafik gesetzt, dann ist das ein Makro-Object
126 	virtual FASTBOOL HasMacro() const;
127 	virtual SdrObject* CheckMacroHit       (const SdrObjMacroHitRec& rRec) const;
128 	virtual Pointer    GetMacroPointer     (const SdrObjMacroHitRec& rRec) const;
129 
130     // FullDrag support
131     virtual bool supportsFullDrag() const;
132     virtual SdrObject* getFullDragClone() const;
133 };
134 
135 
136 #endif
137