update dev300-m58
[ooovba.git] / svtools / source / filter.vcl / wmf / emfwr.hxx
blob910c78f288b9e9acc6b268a7d7e4fa96285184d2
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: emfwr.hxx,v $
10 * $Revision: 1.9 $
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 _EMFWR_HXX
32 #define _EMFWR_HXX
34 #include <tools/debug.hxx>
35 #include <vcl/metaact.hxx>
36 #include <vcl/graph.hxx>
37 #include <vcl/gdimtf.hxx>
38 #include <vcl/virdev.hxx>
39 #include <svtools/fltcall.hxx>
41 // -------------
42 // - EMFWriter -
43 // -------------
45 class EMFWriter
47 private:
49 VirtualDevice maVDev;
50 FilterConfigItem* mpFilterConfigItem;
51 SvStream* mpStm;
52 BOOL* mpHandlesUsed;
53 ULONG mnHandleCount;
54 ULONG mnLastPercent;
55 ULONG mnRecordCount;
56 ULONG mnRecordPos;
57 BOOL mbRecordOpen;
58 BOOL mbLineChanged;
59 sal_uInt32 mnLineHandle;
60 BOOL mbFillChanged;
61 sal_uInt32 mnFillHandle;
62 BOOL mbTextChanged;
63 sal_uInt32 mnTextHandle;
64 sal_uInt32 mnHorTextAlign;
66 void ImplBeginRecord( sal_uInt32 nType );
67 void ImplEndRecord();
69 ULONG ImplAcquireHandle();
70 void ImplReleaseHandle( ULONG nHandle );
72 BOOL ImplPrepareHandleSelect( sal_uInt32& rHandle, ULONG nSelectType );
73 void ImplCheckLineAttr();
74 void ImplCheckFillAttr();
75 void ImplCheckTextAttr();
77 void ImplWriteColor( const Color& rColor );
78 void ImplWriteRasterOp( RasterOp eRop );
79 void ImplWriteExtent( long nExtent );
80 void ImplWritePoint( const Point& rPoint );
81 void ImplWriteSize( const Size& rSize);
82 void ImplWriteRect( const Rectangle& rRect );
83 void ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClose );
84 void ImplWritePolygonRecord( const Polygon& rPoly, BOOL bClose );
85 void ImplWritePolyPolygonRecord( const PolyPolygon& rPolyPoly );
86 void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, UINT32 nROP );
87 void ImplWriteTextRecord( const Point& rPos, const String rText, const sal_Int32* pDXArray, sal_uInt32 nWidth );
89 void ImplWrite( const GDIMetaFile& rMtf );
91 public:
93 EMFWriter() {}
95 BOOL WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfigItem* pConfigItem = NULL );
98 #endif // _EMFWR_HXX