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 .
23 #include <svx/svdotext.hxx>
24 #include "svx/svxdllapi.h"
25 #include <editeng/measfld.hxx>
27 //************************************************************
28 // Vorausdeklarationen
29 //************************************************************
33 struct ImpMeasurePoly
;
35 namespace sdr
{ namespace properties
{
36 class MeasureProperties
;
39 //************************************************************
40 // Hilfsklasse SdrMeasureObjGeoData
41 //************************************************************
43 class SdrMeasureObjGeoData
: public SdrTextObjGeoData
50 SdrMeasureObjGeoData();
51 virtual ~SdrMeasureObjGeoData();
54 //************************************************************
56 //************************************************************
58 class SVX_DLLPUBLIC SdrMeasureObj
: public SdrTextObj
61 // to allow sdr::properties::MeasureProperties access to SetTextDirty()
62 friend class sdr::properties::MeasureProperties
;
64 friend class SdrMeasureField
;
67 virtual sdr::contact::ViewContact
* CreateObjectSpecificViewContact();
68 virtual sdr::properties::BaseProperties
* CreateObjectSpecificProperties();
75 void ImpTakeAttr(ImpMeasureRec
& rRec
) const;
76 void TakeRepresentation( XubString
& rStr
, SdrMeasureFieldKind eMeasureFieldKind
) const;
77 void ImpCalcGeometrics(const ImpMeasureRec
& rRec
, ImpMeasurePoly
& rPol
) const;
78 basegfx::B2DPolyPolygon
ImpCalcXPoly(const ImpMeasurePoly
& rPol
) const;
79 void ImpEvalDrag(ImpMeasureRec
& rRec
, const SdrDragStat
& rDrag
) const;
80 void SetTextDirty() { bTextDirty
=sal_True
; SetTextSizeDirty(); if (!aOutRect
.IsEmpty()) { SetBoundRectDirty(); SetRectsDirty(sal_True
); } }
81 void UndirtyText() const;
83 virtual SdrObjGeoData
* NewGeoData() const;
84 virtual void SaveGeoData(SdrObjGeoData
& rGeo
) const;
85 virtual void RestGeoData(const SdrObjGeoData
& rGeo
);
90 SdrMeasureObj(const Point
& rPt1
, const Point
& rPt2
);
91 virtual ~SdrMeasureObj();
93 virtual void TakeObjInfo(SdrObjTransformInfoRec
& rInfo
) const;
94 virtual sal_uInt16
GetObjIdentifier() const;
95 virtual void TakeUnrotatedSnapRect(Rectangle
& rRect
) const;
96 virtual SdrMeasureObj
* Clone() const;
98 virtual void TakeObjNameSingul(String
& rName
) const;
99 virtual void TakeObjNamePlural(String
& rName
) const;
101 virtual basegfx::B2DPolyPolygon
TakeXorPoly() const;
102 virtual sal_uInt32
GetHdlCount() const;
103 virtual SdrHdl
* GetHdl(sal_uInt32 nHdlNum
) const;
105 // special drag methods
106 virtual bool hasSpecialDrag() const;
107 virtual bool beginSpecialDrag(SdrDragStat
& rDrag
) const;
108 virtual bool applySpecialDrag(SdrDragStat
& rDrag
);
109 virtual String
getSpecialDragComment(const SdrDragStat
& rDrag
) const;
111 virtual bool BegCreate(SdrDragStat
& rStat
);
112 virtual bool MovCreate(SdrDragStat
& rStat
);
113 virtual bool EndCreate(SdrDragStat
& rStat
, SdrCreateCmd eCmd
);
114 virtual bool BckCreate(SdrDragStat
& rStat
);
115 virtual void BrkCreate(SdrDragStat
& rStat
);
116 virtual basegfx::B2DPolyPolygon
TakeCreatePoly(const SdrDragStat
& rDrag
) const;
117 virtual Pointer
GetCreatePointer() const;
119 virtual void NbcMove(const Size
& rSiz
);
120 virtual void NbcResize(const Point
& rRef
, const Fraction
& xFact
, const Fraction
& yFact
);
121 virtual void NbcRotate(const Point
& rRef
, long nWink
, double sn
, double cs
);
122 virtual void NbcMirror(const Point
& rRef1
, const Point
& rRef2
);
123 virtual void NbcShear(const Point
& rRef
, long nWink
, double tn
, bool bVShear
);
124 virtual long GetRotateAngle() const;
125 virtual void RecalcSnapRect();
127 virtual sal_uInt32
GetSnapPointCount() const;
128 virtual Point
GetSnapPoint(sal_uInt32 i
) const;
130 virtual sal_Bool
IsPolyObj() const;
131 virtual sal_uInt32
GetPointCount() const;
132 virtual Point
GetPoint(sal_uInt32 i
) const;
133 virtual void NbcSetPoint(const Point
& rPnt
, sal_uInt32 i
);
135 virtual SdrObject
* DoConvertToPolyObj(sal_Bool bBezier
, bool bAddText
) const;
137 virtual sal_Bool
BegTextEdit(SdrOutliner
& rOutl
);
138 virtual const Size
& GetTextSize() const;
139 virtual void TakeTextRect( SdrOutliner
& rOutliner
, Rectangle
& rTextRect
, bool bNoEditText
= false,
140 Rectangle
* pAnchorRect
=NULL
, bool bLineWidth
= true ) const;
141 virtual void TakeTextAnchorRect(Rectangle
& rAnchorRect
) const;
142 virtual void TakeTextEditArea(Size
* pPaperMin
, Size
* pPaperMax
, Rectangle
* pViewInit
, Rectangle
* pViewMin
) const;
143 virtual sal_uInt16
GetOutlinerViewAnchorMode() const;
144 virtual void NbcSetOutlinerParaObject(OutlinerParaObject
* pTextObject
);
145 virtual OutlinerParaObject
* GetOutlinerParaObject() const;
147 virtual bool CalcFieldValue(const SvxFieldItem
& rField
, sal_Int32 nPara
, sal_uInt16 nPos
,
148 bool bEdit
, Color
*& rpTxtColor
, Color
*& rpFldColor
, String
& rRet
) const;
151 virtual sal_Bool
TRGetBaseGeometry(basegfx::B2DHomMatrix
& rMatrix
, basegfx::B2DPolyPolygon
& rPolyPolygon
) const;
152 virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix
& rMatrix
, const basegfx::B2DPolyPolygon
& rPolyPolygon
);
155 /////////////////////////////////////////////////////////////////////////////////////////////////
159 // Dragging von Bezugspunkt 1 zu Bezugspunkt 2 -> Bezugskante
163 // Masslinie und Masshilfslinien: Haarlinien solid schwarz
168 // |<--------------------->|---
171 // Pt1============# Pt2-- <----Bezugskante (von Pt1 nach Pt2)
172 // # # |___ <- Ueberstand der Masshilfslinie(n)
174 // # Zu bemassendes Objekt #
175 // #=======================#
179 // 1. Wo steht der Text: mitte, rechts oder links (def=automatik)
180 // 2. Text oberhalb der Linie oder unterhalb oder Linie unterbrochen durch Text (def=automatik)
181 // 3. Den Abstand der Masslinie zur Bezugskante (=zum bemassten Objekt).
183 // 4. Masslinie unterhalb der Bezugskante (default=nein)
184 // 5. Die Ueberlaenge(n) der Masshilfslinien ueber die Bezugskante (2x, default=0)
185 // 6. Den Ueberhang der Masshilfslinien ueber die Masslinie (default=2mm)
186 // 7. Den Abstand der Masshilfslinien zur Bezugskante
188 // Dragging: Handle Shift
190 // - Die Bezugspunkte SolidQuadHdl nur die Laenge
191 // 1.+2. Anpacken des Textes
192 // 3.+4. Hdl am Pfeil (2x) SolidQuadHdl nur den Bool
193 // 5. Hdl am Endpunkt CircHdl beide Laengen?
194 // 6.+7. Kein Dragging
198 // - Radien (gleich als Typ verankern
202 // Connecting an max. 2 Objekte
203 // -> Bei Copy, etc. den entspr. Code der Verbinder verwenden?!?
204 // wird wohl recht kompliziert werden ...
206 /////////////////////////////////////////////////////////////////////////////////////////////////
208 #endif //_SVDOMEAS_HXX
210 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */