nss: upgrade to release 3.73
[LibreOffice.git] / emfio / inc / wmfreader.hxx
blob9e1059d63760fbb7a3919cbc6730a0ae5e573af3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_EMFIO_INC_WMFREADER_HXX
21 #define INCLUDED_EMFIO_INC_WMFREADER_HXX
23 #include "mtftools.hxx"
24 #include <tools/stream.hxx>
26 // predefines
27 struct WmfExternal;
29 namespace emfio
31 class WmfReader : public MtfTools
33 private:
34 sal_uInt16 mnUnitsPerInch;
35 sal_uInt32 mnRecSize;
37 // embedded EMF data
38 std::unique_ptr<SvMemoryStream> mpEMFStream;
40 // total number of comment records containing EMF data
41 sal_uInt32 mnEMFRecCount;
43 // number of EMF records read
44 sal_uInt32 mnEMFRec;
46 // total size of embedded EMF data
47 sal_uInt32 mnEMFSize;
49 sal_uInt32 mnSkipActions;
51 // eventually handed over external header
52 const WmfExternal* mpExternalHeader;
54 // reads header of the WMF-Datei
55 bool ReadHeader();
57 // reads parameters of the record with the functionnumber nFunction.
58 void ReadRecordParams(sal_uInt16 nFunction);
60 Point ReadPoint(); // reads and converts a point (first X then Y)
61 Point ReadYX(); // reads and converts a point (first Y then X)
62 tools::Rectangle ReadRectangle(); // reads and converts a rectangle
63 Size ReadYXExt();
64 void GetPlaceableBound(tools::Rectangle& rSize, SvStream* pStrm);
66 public:
67 WmfReader(SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile, const WmfExternal* pExternalHeader);
69 // read WMF file from stream and fill the GDIMetaFile
70 void ReadWMF();
74 #endif
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */