Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _EMFWR_HXX
30 : : #define _EMFWR_HXX
31 : :
32 : : #include <vcl/metaact.hxx>
33 : : #include <vcl/graph.hxx>
34 : : #include <vcl/gdimtf.hxx>
35 : : #include <vcl/virdev.hxx>
36 : : #include <svtools/fltcall.hxx>
37 : :
38 : : // -------------
39 : : // - EMFWriter -
40 : : // -------------
41 : :
42 : : class LineInfo;
43 : : namespace basegfx { class B2DPolygon; }
44 : :
45 [ + - ]: 90 : class EMFWriter
46 : : {
47 : : private:
48 : :
49 : : VirtualDevice maVDev;
50 : : MapMode maDestMapMode;
51 : : FilterConfigItem* mpFilterConfigItem;
52 : : SvStream& m_rStm;
53 : : sal_Bool* mpHandlesUsed;
54 : : sal_uLong mnHandleCount;
55 : : sal_uLong mnLastPercent;
56 : : sal_uLong mnRecordCount;
57 : : sal_uLong mnRecordPos;
58 : : sal_Bool mbRecordOpen;
59 : : sal_Bool mbLineChanged;
60 : : sal_uInt32 mnLineHandle;
61 : : sal_Bool mbFillChanged;
62 : : sal_uInt32 mnFillHandle;
63 : : sal_Bool mbTextChanged;
64 : : sal_uInt32 mnTextHandle;
65 : : sal_uInt32 mnHorTextAlign;
66 : :
67 : : void ImplBeginRecord( sal_uInt32 nType );
68 : : void ImplEndRecord();
69 : :
70 : : sal_uLong ImplAcquireHandle();
71 : : void ImplReleaseHandle( sal_uLong nHandle );
72 : :
73 : : sal_Bool ImplPrepareHandleSelect( sal_uInt32& rHandle, sal_uLong nSelectType );
74 : : void ImplCheckLineAttr();
75 : : void ImplCheckFillAttr();
76 : : void ImplCheckTextAttr();
77 : :
78 : : void ImplWriteColor( const Color& rColor );
79 : : void ImplWriteRasterOp( RasterOp eRop );
80 : : void ImplWriteExtent( long nExtent );
81 : : void ImplWritePoint( const Point& rPoint );
82 : : void ImplWriteSize( const Size& rSize);
83 : : void ImplWriteRect( const Rectangle& rRect );
84 : : void ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClose );
85 : : void ImplWritePolygonRecord( const Polygon& rPoly, sal_Bool bClose );
86 : : void ImplWritePolyPolygonRecord( const PolyPolygon& rPolyPoly );
87 : : void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, sal_uInt32 nROP );
88 : : void ImplWriteTextRecord( const Point& rPos, const String rText, const sal_Int32* pDXArray, sal_uInt32 nWidth );
89 : :
90 : : void Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon);
91 : : void ImplWrite( const GDIMetaFile& rMtf );
92 : :
93 : : public:
94 : :
95 [ + - ]: 90 : EMFWriter(SvStream &rStream) : m_rStm(rStream) {}
96 : :
97 : : sal_Bool WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pConfigItem = NULL );
98 : : };
99 : :
100 : : #endif // _EMFWR_HXX
101 : :
102 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|