xref: /aoo4110/main/svx/inc/svx/svdorect.hxx (revision b1cdbd2c)
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 
24 #ifndef _SVDORECT_HXX
25 #define _SVDORECT_HXX
26 
27 #include <svx/svdotext.hxx>
28 #include "svx/svxdllapi.h"
29 
30 //************************************************************
31 //   Vorausdeklarationen
32 //************************************************************
33 
34 class XPolygon;
35 
36 namespace sdr {	namespace properties {
37 	class RectangleProperties;
38 }}
39 
40 //************************************************************
41 //   SdrRectObj
42 //
43 // Rechteck-Objekte (Rechteck,Kreis,...)
44 //
45 //************************************************************
46 
47 class SVX_DLLPUBLIC SdrRectObj : public SdrTextObj
48 {
49 private:
50 	// to allow sdr::properties::RectangleProperties access to SetXPolyDirty()
51 	friend class sdr::properties::RectangleProperties;
52 	friend class				SdrTextObj; // wg SetXPolyDirty bei GrowAdjust
53 
54 protected:
55 	virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
56 	virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
57 
58     XPolygon*					mpXPoly;
59 
60 protected:
61 	// Liefert sal_True, wenn das Painten ein Polygon erfordert.
62 	FASTBOOL PaintNeedsXPoly(long nEckRad) const;
63 
64 protected:
65 	XPolygon ImpCalcXPoly(const Rectangle& rRect1, long nRad1) const;
66 	void SetXPolyDirty();
67 
68 	// RecalcXPoly sollte ueberladen werden. Dabei muss dann eine XPolygon
69 	// Instanz generiert (new) und an mpXPoly zugewiesen werden.
70 	virtual void RecalcXPoly();
71 	const XPolygon& GetXPoly() const;
72 	virtual void           RestGeoData(const SdrObjGeoData& rGeo);
73 
74 public:
75 	TYPEINFO();
76 	// Der Eckenradius-Parameter fliegt irgendwann raus. Der Eckenradius
77 	// ist dann (spaeter) ueber SfxItems einzustellen (SetAttributes()).
78 	// Konstruktion eines Rechteck-Zeichenobjekts
79 
80 	SdrRectObj();
81 	SdrRectObj(const Rectangle& rRect);
82 
83 	// Konstruktion eines Textrahmens
84 	SdrRectObj(SdrObjKind eNewTextKind);
85 	SdrRectObj(SdrObjKind eNewTextKind, const Rectangle& rRect);
86 	// der sal_uInt16 eFormat nimmt Werte des enum EETextFormat entgegen
87     SdrRectObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect, SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat);
88 	virtual ~SdrRectObj();
89 
90 	virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
91 	virtual sal_uInt16 GetObjIdentifier() const;
92 	virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
93 
94 	virtual void TakeObjNameSingul(String& rName) const;
95 	virtual void TakeObjNamePlural(String& rName) const;
96 
97 	virtual void operator=(const SdrObject& rObj);
98 	virtual void RecalcSnapRect();
99 	virtual void NbcSetSnapRect(const Rectangle& rRect);
100 	virtual void NbcSetLogicRect(const Rectangle& rRect);
101 	virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
102 
103 	virtual sal_uInt32 GetHdlCount() const;
104 	virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
105 
106     // special drag methods
107     virtual bool hasSpecialDrag() const;
108 	virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
109 	virtual bool applySpecialDrag(SdrDragStat& rDrag);
110 	virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
111 
112     virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
113 	virtual Pointer GetCreatePointer() const;
114 
115 	virtual void NbcMove(const Size& rSiz);
116 	virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
117 	virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
118 	virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
119 	virtual void NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
120 
121 	virtual FASTBOOL DoMacro(const SdrObjMacroHitRec& rRec);
122 	virtual XubString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
123 
124 	virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const;
125 	virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const;
126 
127 	virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
128 
129 	virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
130 };
131 
132 #endif //_SVDORECT_HXX
133 
134