bump product version to 4.2.0.1
[LibreOffice.git] / include / svx / svdomeas.hxx
blob73c32d09ccfff6f1d75f7b80495181c246a1656d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_SVDOMEAS_HXX
21 #define INCLUDED_SVX_SVDOMEAS_HXX
23 #include <svx/svdotext.hxx>
24 #include <svx/svxdllapi.h>
25 #include <editeng/measfld.hxx>
27 //************************************************************
28 // Initial Declarations
29 //************************************************************
31 class SdrOutliner;
32 struct ImpMeasureRec;
33 struct ImpMeasurePoly;
35 namespace sdr { namespace properties {
36 class MeasureProperties;
39 //************************************************************
40 // Auxiliary Class SdrMeasureObjGeoData
41 //************************************************************
43 class SdrMeasureObjGeoData : public SdrTextObjGeoData
45 public:
46 Point aPt1;
47 Point aPt2;
49 public:
50 SdrMeasureObjGeoData();
51 virtual ~SdrMeasureObjGeoData();
54 //************************************************************
55 // SdrMeasureObj
56 //************************************************************
58 class SVX_DLLPUBLIC SdrMeasureObj : public SdrTextObj
60 private:
61 // to allow sdr::properties::MeasureProperties access to SetTextDirty()
62 friend class sdr::properties::MeasureProperties;
64 friend class SdrMeasureField;
66 protected:
67 virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
68 virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
70 Point aPt1;
71 Point aPt2;
72 bool bTextDirty;
74 protected:
75 void ImpTakeAttr(ImpMeasureRec& rRec) const;
76 OUString TakeRepresentation(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);
87 public:
88 TYPEINFO();
89 SdrMeasureObj();
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 OUString TakeObjNameSingul() const;
99 virtual OUString TakeObjNamePlural() 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 OUString 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, OUString& rRet) const;
150 // #i97878#
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 /////////////////////////////////////////////////////////////////////////////////////////////////
157 // Creating:
158 // ~~~~~~~~~
159 // dragging reference point 1 to reference point 2 -> reference edge
161 // Defaults:
162 // ~~~~~~~~~~~~~
163 // dimension line and auxiliary dimension lines: solid black hairlines
164 // arrows : 2mm x 4mm
165 // text size
166 // ___
167 // | dimension | 2mm
168 // |<--------------------->|---
169 // | | 8mm
170 // | |
171 // Pt1============# Pt2-- <----reference edge (from Pt1 to Pt2)
172 // # # |___ <-excess length of the auxiliary dimention line(s)
173 // # #=========#
174 // # objected to be dimensioned #
175 // #=======================#
177 // Attributes:
178 // ~~~~~~~~~~
179 // 1. Where is the text: middle, right or left (default=automatic)
180 // 2. Text above or below the line or line broken by text (default=automatic)
181 // Default=8mm
182 // 3. The distance from the dimension line to the reference edge (= to the dimesnioned object)
183 // 4. dimension line below the reference edge (default=no))
184 // 5. excess lenth of the auxiliary dimension lines beyond the reference edge (2x, default=0)
185 // 6. excess lenth of the auxiliary dimension lines past the dimesion line (default=2mm)
186 // 7. distance between the auxiliary dimension line and the reference edge
188 // Dragging: Handle Shift
189 // ~~~~~~~~~
190 // - reference points SolidQuadHdl only the length
191 // 1.+2. Anpacken des Textes
192 // 3.+4. Hdl on arrow (2x) SolidQuadHdl only the Bool
193 // 5. Hdl one end point CircHdl both lengths ?
194 // 6.+7. no dragging
196 // Open:
197 // ~~~~~~
198 // - radiuses (anchor as type immediately)
200 // Special:
201 // ~~~~~~~~
202 // Connecting to a maximum of two objects
203 // -> during Copy, etc. use the respective code of the connectors?!?
204 // this probably will be pretty complicated ...
206 /////////////////////////////////////////////////////////////////////////////////////////////////
208 #endif // INCLUDED_SVX_SVDOMEAS_HXX
210 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */