Fix GNU C++ version check
[LibreOffice.git] / vcl / inc / pdf / objectcopier.hxx
blob0168f69717aea4d47fe4e3412dd3963224f51a9c
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/.
8 */
10 #pragma once
12 #include <map>
13 #include <vector>
15 #include <rtl/strbuf.hxx>
16 #include <rtl/string.hxx>
17 #include <sal/types.h>
19 class SvMemoryStream;
21 namespace vcl
23 class PDFObjectContainer;
24 namespace filter
26 class PDFObjectElement;
27 class PDFElement;
30 /// Copies objects from one PDF file into another one.
31 class PDFObjectCopier
33 PDFObjectContainer& m_rContainer;
35 void copyRecursively(OStringBuffer& rLine, filter::PDFElement& rInputElement,
36 SvMemoryStream& rDocBuffer,
37 std::map<sal_Int32, sal_Int32>& rCopiedResources);
39 public:
40 PDFObjectCopier(PDFObjectContainer& rContainer);
42 /// Copies resources of a given kind from an external page to the output,
43 /// returning what has to be included in the new resource dictionary.
44 OString copyExternalResources(filter::PDFObjectElement& rPage, const OString& rKind,
45 std::map<sal_Int32, sal_Int32>& rCopiedResources);
47 /// Copies a single resource from an external document, returns the new
48 /// object ID in our document.
49 sal_Int32 copyExternalResource(SvMemoryStream& rDocBuffer, filter::PDFObjectElement& rObject,
50 std::map<sal_Int32, sal_Int32>& rCopiedResources);
52 /// Copies resources of pPage into rLine.
53 void copyPageResources(filter::PDFObjectElement* pPage, OStringBuffer& rLine);
55 void copyPageResources(filter::PDFObjectElement* pPage, OStringBuffer& rLine,
56 std::map<sal_Int32, sal_Int32>& rCopiedResources);
58 /// Copies page one or more page streams from rContentStreams into rStream.
59 static sal_Int32 copyPageStreams(std::vector<filter::PDFObjectElement*>& rContentStreams,
60 SvMemoryStream& rStream, bool& rCompressed);
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */