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 .
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>
33 class ZipPackageBuffer
;
34 class ZipPackageStream
;
38 ::com::sun::star::uno::Sequence
< sal_Int8
> m_aDeflateBuffer
;
39 ZipUtils::Deflater m_aDeflater
;
40 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
;
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
;
49 ZipEntry
*m_pCurrentEntry
;
50 sal_Int16 m_nDigested
;
51 bool m_bEncryptCurrentEntry
;
52 ZipPackageStream
* m_pCurrentStream
;
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);
62 /* This block of methods is for threaded zipping, where we compress to a temp stream, whose
63 data is retrieved via getData */
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
; }
79 void write(const css::uno::Sequence
< sal_Int8
>& rBuffer
);
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */