Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_starmath / xchar.hxx
blob5fed9aa103cf21f2054619c3aeb76ddac66df8b1
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: xchar.hxx,v $
10 * $Revision: 1.6 $
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 XCHAR_HXX
32 #define XCHAR_HXX
35 #ifndef _SV_GEN_HXX //autogen
36 #include <tools/gen.hxx>
37 #endif
38 #ifndef _SV_OUTDEV_HXX //autogen
39 #include <vcl/outdev.hxx>
40 #endif
41 #ifndef _TL_POLY_HXX
42 #include <tools/poly.hxx>
43 #endif
44 #ifndef _XPOLY_HXX //autogen
45 #include <bf_svx/xpoly.hxx>
46 #endif
49 #include "rect.hxx"
50 namespace binfilter {
55 ////////////////////////////////////////
56 // SmPolygon
59 class SmPolygonLoader;
61 class SmPolygon
63 friend class SmPolygonLoader;
65 XPolyPolygon aPoly;
66 Rectangle aBoundRect; // das umgebende Rechteck (ohne Rand!)
67 // wie von OutputDevice::GetBoundRect
68 Size aFontSize; // vom Originalzeichen (Width != 0 aus FontMetric)
69 Point aPos;
70 Size aOrigSize; // Originalgröße (des BoundRect)
71 Point aOrigPos; // Offset des BoundRect im Originalzeichen
73 double fScaleX, // Skalierungsfaktoren der aktuellen (gewollten)
74 fScaleY, // Größe gegenüber der Originalgröße
76 fDelayedFactorX, // dienen zum sammeln der Änderungen
77 fDelayedFactorY; // bis tatsächlich skaliert wird
79 sal_Unicode cChar;
80 BOOL bDelayedScale,
81 bDelayedBoundRect;
83 void Scale();
85 public:
86 SmPolygon();
87 SmPolygon(sal_Unicode cChar);
88 // default copy-constructor verwenden
90 const Size & GetOrigFontSize() const { return aFontSize; };
91 const Size & GetOrigSize() const { return aOrigSize; }
92 const Point & GetOrigPos() const { return aOrigPos; }
94 void ScaleBy(double fFactorX, double fFactorY);
95 double GetScaleX() const { return fScaleX * fDelayedFactorX; }
96 double GetScaleY() const { return fScaleY * fDelayedFactorY; }
98 void AdaptToX(const OutputDevice &rDev, ULONG nWidth);
99 void AdaptToY(const OutputDevice &rDev, ULONG nHeight);
101 void Move (const Point &rPoint);
102 void MoveTo(const Point &rPoint) { Move(rPoint - aPos); }
104 const sal_Unicode GetChar() const { return cChar; }
105 const Rectangle & GetBoundRect(const OutputDevice &rDev) const;
108 // default assignment-operator verwenden
110 friend SvStream & operator >> (SvStream &rIStream, SmPolygon &rPoly);
111 friend SvStream & operator << (SvStream &rOStream, const SmPolygon &rPoly);
116 } //namespace binfilter
117 #endif