sync master with lastest vba changes
[ooovba.git] / binfilter / inc / bf_svx / svdomeas.hxx
blob162657f238ec1f24e8280120acd3bb3e757b4cca
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: svdomeas.hxx,v $
10 * $Revision: 1.5 $
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 ************************************************************************/
31 #ifndef _SVDOMEAS_HXX
32 #define _SVDOMEAS_HXX
34 #ifndef _SVDOTEXT_HXX
35 #include <bf_svx/svdotext.hxx>
36 #endif
37 namespace binfilter {
39 //************************************************************
40 // Vorausdeklarationen
41 //************************************************************
43 class SdrMeasureSetItem;
44 class SdrOutliner;
45 struct ImpMeasureRec;
46 struct ImpMeasurePoly;
48 //************************************************************
49 // Hilfsklasse SdrMeasureObjGeoData
50 //************************************************************
52 class SdrMeasureObjGeoData : public SdrTextObjGeoData
54 public:
55 Point aPt1;
56 Point aPt2;
58 public:
59 SdrMeasureObjGeoData();
60 virtual ~SdrMeasureObjGeoData();
63 //************************************************************
64 // SdrMeasureObj
65 //************************************************************
67 class SdrMeasureObj : public SdrTextObj
69 friend class SdrMeasureField;
71 protected:
72 Point aPt1;
73 Point aPt2;
74 FASTBOOL bTextDirty;
76 protected:
77 virtual void SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType, const SfxHint& rHint, const TypeId& rHintType);
78 virtual void ForceDefaultAttr();
79 void ImpTakeAttr(ImpMeasureRec& rRec) const;
80 void ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& rPol) const;
81 void ImpCalcXPoly(const ImpMeasurePoly& rPol, XPolyPolygon& rXPP) const;
82 void SetTextDirty() { bTextDirty=TRUE; SetTextSizeDirty(); if (!bBoundRectDirty) { bBoundRectDirty=TRUE; SetRectsDirty(TRUE); } }
83 void UndirtyText() const;
86 public:
87 TYPEINFO();
88 SdrMeasureObj();
89 SdrMeasureObj(const Point& rPt1, const Point& rPt2);
90 virtual ~SdrMeasureObj();
92 virtual UINT16 GetObjIdentifier() const;
93 virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
100 virtual void NbcMove(const Size& rSiz);
101 virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
102 virtual long GetRotateAngle() const;
103 virtual void RecalcBoundRect();
104 virtual void RecalcSnapRect();
107 virtual const Point& GetPoint(USHORT i) const;
108 virtual void NbcSetPoint(const Point& rPnt, USHORT i);
111 virtual FASTBOOL BegTextEdit(SdrOutliner& rOutl);
112 virtual void EndTextEdit(SdrOutliner& rOutl);
113 virtual const Size& GetTextSize() const;
114 virtual void TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FASTBOOL bNoEditText=FALSE,
115 Rectangle* pAnchorRect=NULL, BOOL bLineWidth=TRUE ) const;
116 virtual void TakeTextAnchorRect(Rectangle& rAnchorRect) const;
117 virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject);
118 virtual OutlinerParaObject* GetOutlinerParaObject() const;
120 virtual FASTBOOL CalcFieldValue(const SvxFieldItem& rField, USHORT nPara, USHORT nPos,
121 FASTBOOL bEdit, Color*& rpTxtColor, Color*& rpFldColor, String& rRet) const;
123 virtual void NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, FASTBOOL bDontRemoveHardAttr);
125 // ItemSet access
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();
135 virtual void WriteData(SvStream& rOut) const;
136 virtual void ReadData(const SdrObjIOHeader& rHead, SvStream& rIn);
139 /////////////////////////////////////////////////////////////////////////////////////////////////
141 // Creating:
142 // ~~~~~~~~~
143 // Dragging von Bezugspunkt 1 zu Bezugspunkt 2 -> Bezugskante
145 // Die Defaults:
146 // ~~~~~~~~~~~~~
147 // Masslinie und Masshilfslinien: Haarlinien solid schwarz
148 // Pfeile: 2mm x 4mm
149 // Textgroesse
150 // ___
151 // ? Masszahl ?2mm
152 // ?--------------------->?--
153 // ? ?8mm
154 // ? ?
155 // Pt1ÍÍÍÍÍÍÍÍÍÍÍÍ? Pt2-- <----Bezugskante (von Pt1 nach Pt2)
156 // ? ? ³___ <- Ueberstand der Masshilfslinie(n)
157 // ? ÈÍÍÍÍÍÍÍÍÍ?
158 // ?Zu bemassendes Objekt ?
159 // ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ?
161 // Attribute:
162 // ~~~~~~~~~~
163 // 1. Wo steht der Text: mitte, rechts oder links (def=automatik)
164 // 2. Text oberhalb der Linie oder unterhalb oder Linie unterbrochen durch Text (def=automatik)
165 // 3. Den Abstand der Masslinie zur Bezugskante (=zum bemassten Objekt).
166 // Default=8mm
167 // 4. Masslinie unterhalb der Bezugskante (default=nein)
168 // 5. Die Ueberlaenge(n) der Masshilfslinien ueber die Bezugskante (2x, default=0)
169 // 6. Den Ueberhang der Masshilfslinien ueber die Masslinie (default=2mm)
170 // 7. Den Abstand der Masshilfslinien zur Bezugskante
172 // Dragging: Handle Shift
173 // ~~~~~~~~~
174 // - Die Bezugspunkte SolidQuadHdl nur die Laenge
175 // 1.+2. Anpacken des Textes
176 // 3.+4. Hdl am Pfeil (2x) SolidQuadHdl nur den Bool
177 // 5. Hdl am Endpunkt CircHdl beide Laengen?
178 // 6.+7. Kein Dragging
180 // Offen:
181 // ~~~~~~
182 // - Radien (gleich als Typ verankern
184 // Special:
185 // ~~~~~~~~
186 // Connecting an max. 2 Objekte
187 // -> Bei Copy, etc. den entspr. Code der Verbinder verwenden?!?
188 // wird wohl recht kompliziert werden ...
190 /////////////////////////////////////////////////////////////////////////////////////////////////
192 }//end of namespace binfilter
193 #endif //_SVDOMEAS_HXX