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: svdocirc.hxx,v $
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 ************************************************************************/
35 #include <bf_svx/svdorect.hxx>
39 //************************************************************
40 // Vorausdeklarationen
41 //************************************************************
45 //************************************************************
46 // Hilfsklasse SdrCircObjGeoData
47 //************************************************************
49 class SdrCircObjGeoData
: public SdrRectObjGeoData
56 //************************************************************
58 //************************************************************
60 class SdrCircObj
: public SdrRectObj
70 XPolygon
ImpCalcXPoly(const Rectangle
& rRect1
, long nStart
, long nEnd
, FASTBOOL bContour
=FALSE
) const;
71 void ImpSetAttrToCircInfo(); // Werte vom Pool kopieren
72 void ImpSetCircInfoToAttr(); // Werte in den Pool kopieren
74 // Liefert TRUE, wenn das Painten ein XPolygon erfordert.
75 FASTBOOL
PaintNeedsXPoly() const;
76 virtual void RecalcXPoly();
79 virtual void SFX_NOTIFY(SfxBroadcaster
& rBC
, const TypeId
& rBCType
, const SfxHint
& rHint
, const TypeId
& rHintType
);
80 virtual void ForceDefaultAttr();
84 SdrCircObj(SdrObjKind eNewKind
); // Circ, CArc, Sect oder CCut
85 SdrCircObj(SdrObjKind eNewKind
, const Rectangle
& rRect
);
87 // 0=0.00Deg=3h 9000=90.00Deg=12h 18000=180.00Deg=9h 27000=270.00Deg=6h
88 // Der Verlauf des Kreises von StartWink nach EndWink ist immer entgegen
90 // Wenn nNewStartWink==nNewEndWink hat der Kreisbogen einen Verlaufswinkel
91 // von 0 Grad. Bei nNewStartWink+36000==nNewEndWink ist der Verlaufswinkel
93 SdrCircObj(SdrObjKind eNewKind
, const Rectangle
& rRect
, long nNewStartWink
, long nNewEndWink
);
94 virtual ~SdrCircObj();
96 virtual UINT16
GetObjIdentifier() const;
97 virtual void RecalcBoundRect();
98 virtual void TakeUnrotatedSnapRect(Rectangle
& rRect
) const;
99 virtual FASTBOOL
Paint(ExtOutputDevice
& rOut
, const SdrPaintInfoRec
& rInfoRec
) const;
102 virtual void operator=(const SdrObject
& rObj
);
103 virtual void RecalcSnapRect();
104 virtual void NbcSetSnapRect(const Rectangle
& rRect
);
105 virtual void TakeXorPoly(XPolyPolygon
& rXPoly
, FASTBOOL bDetail
) const;
106 virtual void TakeContour(XPolyPolygon
& rXPoly
) const;
111 virtual void NbcMove(const Size
& aSiz
);
112 virtual void NbcResize(const Point
& rRef
, const Fraction
& xFact
, const Fraction
& yFact
);
113 virtual void NbcShear (const Point
& rRef
, long nWink
, double tn
, FASTBOOL bVShear
);
114 virtual SdrObject
* DoConvertToPolyObj(BOOL bBezier
) const;
118 virtual void WriteData(SvStream
& rOut
) const;
119 virtual void ReadData(const SdrObjIOHeader
& rHead
, SvStream
& rIn
);
121 long GetStartWink() const { return nStartWink
; }
122 long GetEndWink() const { return nEndWink
; }
123 virtual void NbcSetStyleSheet(SfxStyleSheet
* pNewStyleSheet
, FASTBOOL bDontRemoveHardAttr
);
126 virtual SfxItemSet
* CreateNewItemSet(SfxItemPool
& rPool
);
128 // private support routines for ItemSet access. NULL pointer means clear item.
129 virtual void ItemSetChanged(const SfxItemSet
& rSet
);
131 // pre- and postprocessing for objects for saving
132 virtual void PreSave();
133 virtual void PostSave();
136 }//end of namespace binfilter
137 #endif //_SVDOCIRC_HXX