Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SVDOCIRC_HXX
30 : : #define _SVDOCIRC_HXX
31 : :
32 : : #include <svx/svdorect.hxx>
33 : : #include "svx/svxdllapi.h"
34 : :
35 : : //************************************************************
36 : : // Vorausdeklarationen
37 : : //************************************************************
38 : :
39 : : namespace sdr { namespace properties {
40 : : class CircleProperties;
41 : : }}
42 : :
43 : : //************************************************************
44 : : // Hilfsklasse SdrCircObjGeoData
45 : : //************************************************************
46 : :
47 : : // #109872#
48 [ # # ]: 0 : class SdrCircObjGeoData : public SdrTextObjGeoData
49 : : {
50 : : public:
51 : : long nStartWink;
52 : : long nEndWink;
53 : : };
54 : :
55 : : //************************************************************
56 : : // SdrCircObj
57 : : //************************************************************
58 : :
59 : 0 : class SVX_DLLPUBLIC SdrCircObj : public SdrRectObj
60 : : {
61 : : private:
62 : : // to allow sdr::properties::CircleProperties access to ImpSetAttrToCircInfo()
63 : : friend class sdr::properties::CircleProperties;
64 : :
65 : : // only for SdrCircleAttributes
66 : 63 : SdrObjKind GetCircleKind() const { return meCircleKind; }
67 : :
68 : : protected:
69 : : virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
70 : : virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
71 : :
72 : : SdrObjKind meCircleKind;
73 : : long nStartWink;
74 : : long nEndWink;
75 : :
76 : : // bitfield
77 : : unsigned mbPolygonIsLine : 1;
78 : :
79 : : private:
80 : : SVX_DLLPRIVATE basegfx::B2DPolygon ImpCalcXPolyCirc(const SdrObjKind eKind, const Rectangle& rRect1, long nStart, long nEnd) const;
81 : : SVX_DLLPRIVATE void ImpSetCreateParams(SdrDragStat& rStat) const;
82 : : SVX_DLLPRIVATE void ImpSetAttrToCircInfo(); // Werte vom Pool kopieren
83 : : SVX_DLLPRIVATE void ImpSetCircInfoToAttr(); // Werte in den Pool kopieren
84 : :
85 : : // Liefert sal_True, wenn das Painten ein XPolygon erfordert.
86 : : SVX_DLLPRIVATE bool PaintNeedsXPolyCirc() const; // PaintNeedsXPoly-> PaintNeedsXPolyCirc
87 : : SVX_DLLPRIVATE virtual void RecalcXPoly();
88 : :
89 : : protected:
90 : : virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
91 : :
92 : : public:
93 : : TYPEINFO();
94 : : SdrCircObj(SdrObjKind eNewKind); // Circ, CArc, Sect oder CCut
95 : : SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect);
96 : :
97 : : // 0=0.00Deg=3h 9000=90.00Deg=12h 18000=180.00Deg=9h 27000=270.00Deg=6h
98 : : // Der Verlauf des Kreises von StartWink nach EndWink ist immer entgegen
99 : : // dem Uhrzeigersinn.
100 : : // Wenn nNewStartWink==nNewEndWink hat der Kreisbogen einen Verlaufswinkel
101 : : // von 0 Grad. Bei nNewStartWink+36000==nNewEndWink ist der Verlaufswinkel
102 : : // 360.00 Grad.
103 : : SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect, long nNewStartWink, long nNewEndWink);
104 : : virtual ~SdrCircObj();
105 : :
106 : : virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
107 : : virtual sal_uInt16 GetObjIdentifier() const;
108 : : virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
109 : :
110 : : virtual void TakeObjNameSingul(String& rName) const;
111 : : virtual void TakeObjNamePlural(String& rName) const;
112 : :
113 : : virtual SdrCircObj* Clone() const;
114 : : virtual void RecalcSnapRect();
115 : : virtual void NbcSetSnapRect(const Rectangle& rRect);
116 : : virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
117 : :
118 : : virtual sal_uInt32 GetSnapPointCount() const;
119 : : virtual Point GetSnapPoint(sal_uInt32 i) const;
120 : :
121 : : virtual sal_uInt32 GetHdlCount() const;
122 : : virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
123 : :
124 : : // special drag methods
125 : : virtual bool hasSpecialDrag() const;
126 : : virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
127 : : virtual bool applySpecialDrag(SdrDragStat& rDrag);
128 : : virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
129 : :
130 : : virtual bool BegCreate(SdrDragStat& rStat);
131 : : virtual bool MovCreate(SdrDragStat& rStat);
132 : : virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
133 : : virtual bool BckCreate(SdrDragStat& rStat);
134 : : virtual void BrkCreate(SdrDragStat& rStat);
135 : : virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
136 : : virtual Pointer GetCreatePointer() const;
137 : : virtual void NbcMove(const Size& aSiz);
138 : : virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
139 : : virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
140 : : virtual void NbcShear (const Point& rRef, long nWink, double tn, bool bVShear);
141 : : virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier) const;
142 : :
143 : : protected:
144 : : virtual SdrObjGeoData* NewGeoData() const;
145 : : virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
146 : : virtual void RestGeoData(const SdrObjGeoData& rGeo);
147 : : public:
148 : 0 : long GetStartWink() const { return nStartWink; }
149 : 0 : long GetEndWink() const { return nEndWink; }
150 : :
151 : : };
152 : :
153 : : #endif //_SVDOCIRC_HXX
154 : :
155 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|