fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / package / inc / ZipOutputEntry.hxx
blob3a6447cc900752bdd2db332af79d58d862324c98
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 .
19 #ifndef INCLUDED_PACKAGE_INC_ZIPOUTPUTENTRY_HXX
20 #define INCLUDED_PACKAGE_INC_ZIPOUTPUTENTRY_HXX
22 #include <com/sun/star/io/XOutputStream.hpp>
23 #include <com/sun/star/io/XTempFile.hpp>
24 #include <com/sun/star/uno/Reference.hxx>
25 #include <com/sun/star/uno/XComponentContext.hpp>
26 #include <com/sun/star/xml/crypto/XCipherContext.hpp>
27 #include <com/sun/star/xml/crypto/XDigestContext.hpp>
29 #include <package/Deflater.hxx>
30 #include <CRC32.hxx>
32 struct ZipEntry;
33 class ZipPackageBuffer;
34 class ZipPackageStream;
36 class ZipOutputEntry
38 ::com::sun::star::uno::Sequence< sal_Int8 > m_aDeflateBuffer;
39 ZipUtils::Deflater m_aDeflater;
40 css::uno::Reference< css::uno::XComponentContext > m_xContext;
41 OUString m_aTempURL;
42 css::uno::Reference< css::io::XOutputStream > m_xOutStream;
44 ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XCipherContext > m_xCipherContext;
45 ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XDigestContext > m_xDigestContext;
46 ::css::uno::Any m_aParallelDeflateException;
48 CRC32 m_aCRC;
49 ZipEntry *m_pCurrentEntry;
50 sal_Int16 m_nDigested;
51 bool m_bEncryptCurrentEntry;
52 ZipPackageStream* m_pCurrentStream;
54 public:
55 ZipOutputEntry(
56 const css::uno::Reference< css::io::XOutputStream >& rxOutStream,
57 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
58 ZipEntry& rEntry, ZipPackageStream* pStream, bool bEncrypt = false);
60 ~ZipOutputEntry();
62 /* This block of methods is for threaded zipping, where we compress to a temp stream, whose
63 data is retrieved via getData */
64 ZipOutputEntry(
65 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
66 ZipEntry& rEntry, ZipPackageStream* pStream, bool bEncrypt = false);
67 void createBufferFile();
68 void setParallelDeflateException(const ::css::uno::Any &rAny) { m_aParallelDeflateException = rAny; }
69 css::uno::Reference< css::io::XInputStream > getData() const;
70 ::css::uno::Any getParallelDeflateException() const { return m_aParallelDeflateException; }
71 void closeBufferFile();
72 void deleteBufferFile();
74 ZipEntry* getZipEntry() { return m_pCurrentEntry; }
75 ZipPackageStream* getZipPackageStream() { return m_pCurrentStream; }
76 bool isEncrypt() { return m_bEncryptCurrentEntry; }
78 void closeEntry();
79 void write(const css::uno::Sequence< sal_Int8 >& rBuffer);
81 private:
82 void doDeflate();
85 #endif
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */