LibreOffice Module emfio (master) 1
emfreader.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
21#include "mtftools.hxx"
22
23namespace emfio
24{
25 class EmfReader : public MtfTools
26 {
27 private:
28 sal_uInt32 mnRecordCount;
29
30 bool mbRecordPath : 1;
31 bool mbEMFPlus : 1;
36 bool mbEnableEMFPlus = true;
37
38 bool ReadHeader();
39 // reads and converts the rectangle
40 static tools::Rectangle ReadRectangle(sal_Int32, sal_Int32, sal_Int32, sal_Int32);
41
42 public:
43 EmfReader(SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile);
44 ~EmfReader();
45
46 bool ReadEnhWMF();
47 void ReadGDIComment(sal_uInt32 nCommentId);
50 void SetSizeHint(const basegfx::B2DTuple& rSizeHint) { maSizeHint = rSizeHint; }
51 void SetEnableEMFPlus(bool bEnableEMFPlus) { mbEnableEMFPlus = bEnableEMFPlus; }
52
53 private:
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);
58
60 void ReadEMFPlusComment(sal_uInt32 length, bool& bHaveDC);
61 };
62}
63
64/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
basegfx::B2DTuple maSizeHint
Definition: emfreader.hxx:35
tools::Polygon ReadPolygonWithSkip(const bool skipFirst, sal_uInt32 nNextPos)
Reads polygons from the stream.
Definition: emfreader.cxx:645
void ReadAndDrawPolyLine(sal_uInt32 nNextPos)
Reads a polyline from the WMF file and draws it The <class T> parameter refers to the type of the poi...
Definition: emfreader.cxx:710
bool mbReadOtherGraphicFormat
Another format is read already, can ignore actual EMF data.
Definition: emfreader.hxx:34
void SetSizeHint(const basegfx::B2DTuple &rSizeHint)
Definition: emfreader.hxx:50
tools::Rectangle ReadRectangle()
Definition: emfreader.cxx:2319
EmfReader(SvStream &rStreamWMF, GDIMetaFile &rGDIMetaFile)
Definition: emfreader.cxx:402
bool mbEMFPlusDualMode
Definition: emfreader.hxx:32
void ReadEMFPlusComment(sal_uInt32 length, bool &bHaveDC)
Definition: emfreader.cxx:554
void ReadMultiformatsComment()
Parses EMR_COMMENT_MULTIFORMATS.
Definition: emfreader.cxx:477
tools::Polygon ReadPolygon(sal_uInt32 nStartIndex, sal_uInt32 nPoints, sal_uInt32 nNextPos)
Reads polygons from the stream.
Definition: emfreader.cxx:667
void SetEnableEMFPlus(bool bEnableEMFPlus)
Definition: emfreader.hxx:51
void ReadGDIComment(sal_uInt32 nCommentId)
Definition: emfreader.cxx:420
void ReadAndDrawPolyPolygon(sal_uInt32 nNextPos)
Reads a poly polygon from the WMF file and draws it.
Definition: emfreader.cxx:757
sal_uInt32 mnRecordCount
Definition: emfreader.hxx:28