1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xchar.hxx,v $
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 ************************************************************************/
35 #ifndef _SV_GEN_HXX //autogen
36 #include <tools/gen.hxx>
38 #ifndef _SV_OUTDEV_HXX //autogen
39 #include <vcl/outdev.hxx>
42 #include <tools/poly.hxx>
44 #ifndef _XPOLY_HXX //autogen
45 #include <bf_svx/xpoly.hxx>
55 ////////////////////////////////////////
59 class SmPolygonLoader
;
63 friend class SmPolygonLoader
;
66 Rectangle aBoundRect
; // das umgebende Rechteck (ohne Rand!)
67 // wie von OutputDevice::GetBoundRect
68 Size aFontSize
; // vom Originalzeichen (Width != 0 aus FontMetric)
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
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