1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include "mtftools.hxx"
25 class EmfReader
: public MtfTools
28 sal_uInt32 mnRecordCount
;
30 bool mbRecordPath
: 1;
32 bool mbEMFPlusDualMode
: 1;
33 /// Another format is read already, can ignore actual EMF data.
34 bool mbReadOtherGraphicFormat
= false;
35 basegfx::B2DTuple maSizeHint
;
36 bool mbEnableEMFPlus
= true;
39 // reads and converts the rectangle
40 static tools::Rectangle
ReadRectangle(sal_Int32
, sal_Int32
, sal_Int32
, sal_Int32
);
43 EmfReader(SvStream
& rStreamWMF
, GDIMetaFile
& rGDIMetaFile
);
47 void ReadGDIComment(sal_uInt32 nCommentId
);
48 /// Parses EMR_COMMENT_MULTIFORMATS.
49 void ReadMultiformatsComment();
50 void SetSizeHint(const basegfx::B2DTuple
& rSizeHint
) { maSizeHint
= rSizeHint
; }
51 void SetEnableEMFPlus(bool bEnableEMFPlus
) { mbEnableEMFPlus
= bEnableEMFPlus
; }
54 template <class T
> void ReadAndDrawPolyPolygon(sal_uInt32 nNextPos
);
55 template <class T
> void ReadAndDrawPolyLine(sal_uInt32 nNextPos
);
56 template <class T
> tools::Polygon
ReadPolygon(sal_uInt32 nStartIndex
, sal_uInt32 nPoints
, sal_uInt32 nNextPos
);
57 template <class T
> tools::Polygon
ReadPolygonWithSkip(const bool skipFirst
, sal_uInt32 nNextPos
);
59 tools::Rectangle
ReadRectangle();
60 void ReadEMFPlusComment(sal_uInt32 length
, bool& bHaveDC
);
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */