1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVX_SVDOCIRC_HXX
21 #define INCLUDED_SVX_SVDOCIRC_HXX
23 #include <svx/svdorect.hxx>
24 #include <svx/svxdllapi.h>
26 //************************************************************
27 // Vorausdeklarationen
28 //************************************************************
30 namespace sdr
{ namespace properties
{
31 class CircleProperties
;
34 //************************************************************
35 // Hilfsklasse SdrCircObjGeoData
36 //************************************************************
39 class SdrCircObjGeoData
: public SdrTextObjGeoData
46 //************************************************************
48 //************************************************************
50 class SVX_DLLPUBLIC SdrCircObj
: public SdrRectObj
53 // to allow sdr::properties::CircleProperties access to ImpSetAttrToCircInfo()
54 friend class sdr::properties::CircleProperties
;
56 // only for SdrCircleAttributes
57 SdrObjKind
GetCircleKind() const { return meCircleKind
; }
60 virtual sdr::contact::ViewContact
* CreateObjectSpecificViewContact();
61 virtual sdr::properties::BaseProperties
* CreateObjectSpecificProperties();
63 SdrObjKind meCircleKind
;
68 unsigned mbPolygonIsLine
: 1;
71 SVX_DLLPRIVATE
basegfx::B2DPolygon
ImpCalcXPolyCirc(const SdrObjKind eKind
, const Rectangle
& rRect1
, long nStart
, long nEnd
) const;
72 SVX_DLLPRIVATE
void ImpSetCreateParams(SdrDragStat
& rStat
) const;
73 SVX_DLLPRIVATE
void ImpSetAttrToCircInfo(); // Werte vom Pool kopieren
74 SVX_DLLPRIVATE
void ImpSetCircInfoToAttr(); // Werte in den Pool kopieren
76 // Liefert sal_True, wenn das Painten ein XPolygon erfordert.
77 SVX_DLLPRIVATE
bool PaintNeedsXPolyCirc() const; // PaintNeedsXPoly-> PaintNeedsXPolyCirc
78 SVX_DLLPRIVATE
virtual void RecalcXPoly();
81 virtual void Notify(SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
85 SdrCircObj(SdrObjKind eNewKind
); // Circ, CArc, Sect oder CCut
86 SdrCircObj(SdrObjKind eNewKind
, const Rectangle
& rRect
);
88 // 0=0.00Deg=3h 9000=90.00Deg=12h 18000=180.00Deg=9h 27000=270.00Deg=6h
89 // Der Verlauf des Kreises von StartWink nach EndWink ist immer entgegen
91 // Wenn nNewStartWink==nNewEndWink hat der Kreisbogen einen Verlaufswinkel
92 // von 0 Grad. Bei nNewStartWink+36000==nNewEndWink ist der Verlaufswinkel
94 SdrCircObj(SdrObjKind eNewKind
, const Rectangle
& rRect
, long nNewStartWink
, long nNewEndWink
);
95 virtual ~SdrCircObj();
97 virtual void TakeObjInfo(SdrObjTransformInfoRec
& rInfo
) const;
98 virtual sal_uInt16
GetObjIdentifier() const;
99 virtual void TakeUnrotatedSnapRect(Rectangle
& rRect
) const;
101 virtual OUString
TakeObjNameSingul() const;
102 virtual OUString
TakeObjNamePlural() const;
104 virtual SdrCircObj
* Clone() const;
105 virtual void RecalcSnapRect();
106 virtual void NbcSetSnapRect(const Rectangle
& rRect
);
107 virtual basegfx::B2DPolyPolygon
TakeXorPoly() const;
109 virtual sal_uInt32
GetSnapPointCount() const;
110 virtual Point
GetSnapPoint(sal_uInt32 i
) const;
112 virtual sal_uInt32
GetHdlCount() const;
113 virtual SdrHdl
* GetHdl(sal_uInt32 nHdlNum
) const;
115 // special drag methods
116 virtual bool hasSpecialDrag() const;
117 virtual bool beginSpecialDrag(SdrDragStat
& rDrag
) const;
118 virtual bool applySpecialDrag(SdrDragStat
& rDrag
);
119 virtual OUString
getSpecialDragComment(const SdrDragStat
& rDrag
) const;
121 virtual bool BegCreate(SdrDragStat
& rStat
);
122 virtual bool MovCreate(SdrDragStat
& rStat
);
123 virtual bool EndCreate(SdrDragStat
& rStat
, SdrCreateCmd eCmd
);
124 virtual bool BckCreate(SdrDragStat
& rStat
);
125 virtual void BrkCreate(SdrDragStat
& rStat
);
126 virtual basegfx::B2DPolyPolygon
TakeCreatePoly(const SdrDragStat
& rDrag
) const;
127 virtual Pointer
GetCreatePointer() const;
128 virtual void NbcMove(const Size
& aSiz
);
129 virtual void NbcResize(const Point
& rRef
, const Fraction
& xFact
, const Fraction
& yFact
);
130 virtual void NbcMirror(const Point
& rRef1
, const Point
& rRef2
);
131 virtual void NbcShear (const Point
& rRef
, long nWink
, double tn
, bool bVShear
);
132 virtual SdrObject
* DoConvertToPolyObj(sal_Bool bBezier
, bool bAddText
) const;
135 virtual SdrObjGeoData
* NewGeoData() const;
136 virtual void SaveGeoData(SdrObjGeoData
& rGeo
) const;
137 virtual void RestGeoData(const SdrObjGeoData
& rGeo
);
139 long GetStartWink() const { return nStartWink
; }
140 long GetEndWink() const { return nEndWink
; }
144 #endif // INCLUDED_SVX_SVDOCIRC_HXX
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */