diff options
Diffstat (limited to 'package/inc')
24 files changed, 0 insertions, 2189 deletions
diff --git a/package/inc/ByteChucker.hxx b/package/inc/ByteChucker.hxx deleted file mode 100644 index ce187774c..000000000 --- a/package/inc/ByteChucker.hxx +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _BYTE_CHUCKER_HXX_ -#define _BYTE_CHUCKER_HXX_ - -#include <com/sun/star/uno/Sequence.h> -#include <com/sun/star/uno/Reference.h> -#include <com/sun/star/io/BufferSizeExceededException.hpp> -#include <com/sun/star/io/IOException.hpp> -#include <com/sun/star/io/NotConnectedException.hpp> -#include <com/sun/star/uno/RuntimeException.hpp> -#include <com/sun/star/lang/IllegalArgumentException.hpp> - -namespace com { namespace sun { namespace star { - namespace io { class XSeekable; class XOutputStream; } -} } } -class ByteChucker -{ -protected: - com::sun::star::uno::Reference < com::sun::star::io::XOutputStream > xStream; - com::sun::star::uno::Reference < com::sun::star::io::XSeekable > xSeek; - com::sun::star::uno::Sequence < sal_Int8 > a1Sequence, a2Sequence, a4Sequence; - sal_Int8 * const p1Sequence, * const p2Sequence, * const p4Sequence; - -public: - ByteChucker (com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> xOstream); - ~ByteChucker(); - - void WriteBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData ) - throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - - sal_Int64 GetPosition() - throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - - ByteChucker& operator << (sal_Int8 nInt8); - ByteChucker& operator << (sal_Int16 nInt16); - ByteChucker& operator << (sal_Int32 nInt32); - ByteChucker& operator << (sal_uInt8 nuInt8); - ByteChucker& operator << (sal_uInt16 nuInt16); - ByteChucker& operator << (sal_uInt32 nuInt32); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/ByteGrabber.hxx b/package/inc/ByteGrabber.hxx deleted file mode 100644 index fd65f3dcc..000000000 --- a/package/inc/ByteGrabber.hxx +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _BYTE_GRABBER_HXX_ -#define _BYTE_GRABBER_HXX_ - -#include <com/sun/star/uno/Sequence.h> -#include <com/sun/star/uno/Reference.h> -#include <com/sun/star/io/BufferSizeExceededException.hpp> -#include <com/sun/star/io/IOException.hpp> -#include <com/sun/star/io/NotConnectedException.hpp> -#include <com/sun/star/uno/RuntimeException.hpp> -#include <com/sun/star/lang/IllegalArgumentException.hpp> - -#include <osl/mutex.hxx> - -namespace com { namespace sun { namespace star { - namespace io { class XSeekable; class XInputStream; } -} } } -class ByteGrabber -{ -protected: - ::osl::Mutex m_aMutex; - - com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xStream; - com::sun::star::uno::Reference < com::sun::star::io::XSeekable > xSeek; - com::sun::star::uno::Sequence < sal_Int8 > aSequence; - const sal_Int8 *pSequence; - -public: - ByteGrabber (com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xIstream); - ~ByteGrabber(); - - void setInputStream (com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xNewStream); - // XInputStream - sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) - throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - // XSeekable - sal_Int64 SAL_CALL seek( sal_Int64 location ) - throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - sal_Int64 SAL_CALL getPosition( ) - throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - sal_Int64 SAL_CALL getLength( ) - throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - - ByteGrabber& operator >> (sal_Int8& rInt8); - ByteGrabber& operator >> (sal_Int16& rInt16); - ByteGrabber& operator >> (sal_Int32& rInt32); - ByteGrabber& operator >> (sal_uInt8& ruInt8); - ByteGrabber& operator >> (sal_uInt16& ruInt16); - ByteGrabber& operator >> (sal_uInt32& ruInt32); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/CRC32.hxx b/package/inc/CRC32.hxx deleted file mode 100644 index a7983557a..000000000 --- a/package/inc/CRC32.hxx +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _CRC32_HXX -#define _CRC32_HXX - -#include <com/sun/star/uno/Sequence.h> -#include <com/sun/star/uno/RuntimeException.hpp> - -namespace com { namespace sun { namespace star { - namespace io { class XInputStream; } -} } } -class CRC32 -{ -protected: - sal_uInt32 nCRC; -public: - CRC32(); - ~CRC32(); - - sal_Int32 SAL_CALL updateStream (::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > & xStream) - throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL updateSegment(const ::com::sun::star::uno::Sequence< sal_Int8 > &b, sal_Int32 off, sal_Int32 len) - throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL update(const ::com::sun::star::uno::Sequence< sal_Int8 > &b) - throw(::com::sun::star::uno::RuntimeException); - sal_Int32 SAL_CALL getValue() - throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL reset() - throw(::com::sun::star::uno::RuntimeException); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/Deflater.hxx b/package/inc/Deflater.hxx deleted file mode 100644 index 4950681ea..000000000 --- a/package/inc/Deflater.hxx +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _DEFLATER_HXX_ -#define _DEFLATER_HXX_ - -#include <com/sun/star/uno/Sequence.hxx> -#include "packagedllapi.hxx" - -struct z_stream_s; - -namespace ZipUtils { - -class DLLPUBLIC_PACKAGE Deflater -{ - typedef struct z_stream_s z_stream; - -protected: - com::sun::star::uno::Sequence< sal_Int8 > sInBuffer; - sal_Bool bFinish; - sal_Bool bFinished; - sal_Bool bSetParams; - sal_Int32 nLevel, nStrategy; - sal_Int32 nOffset, nLength; - z_stream* pStream; - - void init (sal_Int32 nLevel, sal_Int32 nStrategy, sal_Bool bNowrap); - sal_Int32 doDeflateBytes (com::sun::star::uno::Sequence < sal_Int8 > &rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength); - -public: - ~Deflater(); - Deflater(sal_Int32 nSetLevel, sal_Bool bNowrap); - void SAL_CALL setInputSegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ); - void SAL_CALL setLevel( sal_Int32 nNewLevel ); - sal_Bool SAL_CALL needsInput( ); - void SAL_CALL finish( ); - sal_Bool SAL_CALL finished( ); - sal_Int32 SAL_CALL doDeflateSegment( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ); - sal_Int32 SAL_CALL getTotalIn( ); - sal_Int32 SAL_CALL getTotalOut( ); - void SAL_CALL reset( ); - void SAL_CALL end( ); -}; - -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/EncryptedDataHeader.hxx b/package/inc/EncryptedDataHeader.hxx deleted file mode 100644 index 8eb45558b..000000000 --- a/package/inc/EncryptedDataHeader.hxx +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _ENCRYPTED_DATA_HEADER_HXX_ -#define _ENCRYPTED_DATA_HEADER_HXX_ - -#include <sal/types.h> - -/* The structure of this header is as follows: - - Header signature 4 bytes - Version number 2 bytes - Iteraction count 4 bytes - Size 4 bytes - EncAlgorithm 4 bytes - DigestAlgorithm 4 bytes - DerivedKeySize 4 bytes - StartKeyAlgorithm 4 bytes - Salt length 2 bytes - IV length 2 bytes - Digest length 2 bytes - MediaType length 2 bytes - Salt content X bytes - IV content X bytes - digest content X bytes - MediaType X bytes - -*/ -const sal_uInt32 n_ConstHeader = 0x05024d4dL; // "MM\002\005" -const sal_Int32 n_ConstHeaderSize = 38; // + salt length + iv length + digest length + mediatype length -const sal_Int16 n_ConstCurrentVersion = 1; -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/EncryptionData.hxx b/package/inc/EncryptionData.hxx deleted file mode 100644 index 166251022..000000000 --- a/package/inc/EncryptionData.hxx +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _ENCRYPTION_DATA_HXX_ -#define _ENCRYPTION_DATA_HXX_ - -#include <com/sun/star/uno/Sequence.hxx> -#include <cppuhelper/weak.hxx> - -class BaseEncryptionData : public cppu::OWeakObject -{ -public: - ::com::sun::star::uno::Sequence< sal_Int8 > m_aSalt; - ::com::sun::star::uno::Sequence< sal_Int8 > m_aInitVector; - ::com::sun::star::uno::Sequence< sal_Int8 > m_aDigest; - sal_Int32 m_nIterationCount; - - BaseEncryptionData() - : m_nIterationCount ( 0 ){} - - BaseEncryptionData( const BaseEncryptionData& aData ) - : cppu::OWeakObject() - , m_aSalt( aData.m_aSalt ) - , m_aInitVector( aData.m_aInitVector ) - , m_aDigest( aData.m_aDigest ) - , m_nIterationCount( aData.m_nIterationCount ) - {} -}; - -class EncryptionData : public BaseEncryptionData -{ -public: - ::com::sun::star::uno::Sequence < sal_Int8 > m_aKey; - sal_Int32 m_nEncAlg; - sal_Int32 m_nCheckAlg; - sal_Int32 m_nDerivedKeySize; - sal_Int32 m_nStartKeyGenID; - - EncryptionData( const BaseEncryptionData& aData, const ::com::sun::star::uno::Sequence< sal_Int8 >& aKey, sal_Int32 nEncAlg, sal_Int32 nCheckAlg, sal_Int32 nDerivedKeySize, sal_Int32 nStartKeyGenID ) - : BaseEncryptionData( aData ) - , m_aKey( aKey ) - , m_nEncAlg( nEncAlg ) - , m_nCheckAlg( nCheckAlg ) - , m_nDerivedKeySize( nDerivedKeySize ) - , m_nStartKeyGenID( nStartKeyGenID ) - {} - - EncryptionData( const EncryptionData& aData ) - : BaseEncryptionData( aData ) - , m_aKey( aData.m_aKey ) - , m_nEncAlg( aData.m_nEncAlg ) - , m_nCheckAlg( aData.m_nCheckAlg ) - , m_nDerivedKeySize( aData.m_nDerivedKeySize ) - , m_nStartKeyGenID( aData.m_nStartKeyGenID ) - {} -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/HashMaps.hxx b/package/inc/HashMaps.hxx deleted file mode 100644 index 8f6c3586b..000000000 --- a/package/inc/HashMaps.hxx +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _HASHMAPS_HXX -#define _HASHMAPS_HXX - -#include <ZipEntry.hxx> -#include <rtl/ref.hxx> -#include <boost/unordered_map.hpp> - -struct eqFunc -{ - sal_Bool operator()( const rtl::OUString &r1, - const rtl::OUString &r2) const - { - return r1 == r2; - } -}; - -class ZipPackageFolder; -namespace com { namespace sun { namespace star { namespace packages { -class ContentInfo; -} } } } - -typedef boost::unordered_map < rtl::OUString, - ZipPackageFolder *, - ::rtl::OUStringHash, - eqFunc > FolderHash; - -typedef boost::unordered_map < rtl::OUString, - rtl::Reference < com::sun::star::packages::ContentInfo >, - ::rtl::OUStringHash, - eqFunc > ContentHash; - -typedef boost::unordered_map < rtl::OUString, - ZipEntry, - rtl::OUStringHash, - eqFunc > EntryHash; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/Inflater.hxx b/package/inc/Inflater.hxx deleted file mode 100644 index 2c3b68f69..000000000 --- a/package/inc/Inflater.hxx +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _INFLATER_HXX_ -#define _INFLATER_HXX_ - -#include <com/sun/star/uno/Sequence.hxx> -#include "packagedllapi.hxx" - -struct z_stream_s; - -namespace ZipUtils { - -class DLLPUBLIC_PACKAGE Inflater -{ - typedef struct z_stream_s z_stream; - -protected: - sal_Bool bFinish, bFinished, bSetParams, bNeedDict; - sal_Int32 nOffset, nLength, nLastInflateError; - z_stream* pStream; - com::sun::star::uno::Sequence < sal_Int8 > sInBuffer; - sal_Int32 doInflateBytes (com::sun::star::uno::Sequence < sal_Int8 > &rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength); - -public: - Inflater(sal_Bool bNoWrap = sal_False); - ~Inflater(); - void SAL_CALL setInput( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer ); - sal_Bool SAL_CALL needsDictionary( ); - sal_Bool SAL_CALL finished( ); - sal_Int32 SAL_CALL doInflateSegment( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ); - void SAL_CALL end( ); - - sal_Int32 getLastInflateError() { return nLastInflateError; } -}; - -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/PackageConstants.hxx b/package/inc/PackageConstants.hxx deleted file mode 100644 index 03dd9ce27..000000000 --- a/package/inc/PackageConstants.hxx +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _PACKAGE_CONSTANTS_HXX_ -#define _PACKAGE_CONSTANTS_HXX_ - -#include <sal/types.h> - -const sal_Int32 n_ConstBufferSize = 32768; -const sal_Int32 n_ConstMaxMemoryStreamSize = 20480; - -// by calculation of the digest we read 32 bytes more ( if available ) -// it allows to ignore the padding if the stream is longer than n_ConstDigestDecrypt since we read at least two blocks more; -// if the stream is shorter or equal the padding will be done successfully -const sal_Int32 n_ConstDigestLength = 1024; -const sal_Int32 n_ConstDigestDecrypt = 1056; // 1024 + 32 - -// the constants related to the manifest.xml entries -#define PKG_MNFST_MEDIATYPE 0 -#define PKG_MNFST_VERSION 1 -#define PKG_MNFST_FULLPATH 2 - -#define PKG_MNFST_INIVECTOR 3 -#define PKG_MNFST_SALT 4 -#define PKG_MNFST_ITERATION 5 -#define PKG_MNFST_UCOMPSIZE 6 -#define PKG_MNFST_DIGEST 7 -#define PKG_MNFST_ENCALG 8 -#define PKG_MNFST_STARTALG 9 -#define PKG_MNFST_DIGESTALG 10 -#define PKG_MNFST_DERKEYSIZE 11 - -#define PKG_SIZE_NOENCR_MNFST 3 -#define PKG_SIZE_ENCR_MNFST 12 - -// the properties related constants -#define ENCRYPTION_KEY_PROPERTY "EncryptionKey" -#define STORAGE_ENCRYPTION_KEYS_PROPERTY "StorageEncryptionKeys" -#define ENCRYPTION_ALGORITHMS_PROPERTY "EncryptionAlgorithms" -#define HAS_ENCRYPTED_ENTRIES_PROPERTY "HasEncryptedEntries" -#define HAS_NONENCRYPTED_ENTRIES_PROPERTY "HasNonEncryptedEntries" -#define IS_INCONSISTENT_PROPERTY "IsInconsistent" -#define MEDIATYPE_FALLBACK_USED_PROPERTY "MediaTypeFallbackUsed" - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/ZipEntry.hxx b/package/inc/ZipEntry.hxx deleted file mode 100644 index 79df26166..000000000 --- a/package/inc/ZipEntry.hxx +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _ZIP_ENTRY_HXX_ -#define _ZIP_ENTRY_HXX_ - -#include <rtl/ustring.hxx> - -struct ZipEntry -{ - sal_Int16 nVersion; - sal_Int16 nFlag; - sal_Int16 nMethod; - sal_Int32 nTime; - sal_Int32 nCrc; - sal_Int32 nCompressedSize; - sal_Int32 nSize; - sal_Int32 nOffset; - sal_Int16 nPathLen; - sal_Int16 nExtraLen; - ::rtl::OUString sPath; -}; -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/ZipEnumeration.hxx b/package/inc/ZipEnumeration.hxx deleted file mode 100644 index 0cfaa2bce..000000000 --- a/package/inc/ZipEnumeration.hxx +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _ZIP_ENUMERATION_HXX -#define _ZIP_ENUMERATION_HXX - -#include <HashMaps.hxx> - -class ZipEnumeration -{ -protected: - EntryHash &rEntryHash; - EntryHash::const_iterator aIterator; -public: - sal_Bool SAL_CALL hasMoreElements(); - const ZipEntry * SAL_CALL nextElement(); - ZipEnumeration( EntryHash &rNewEntryHash ); - ~ZipEnumeration(); -}; -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx deleted file mode 100644 index 7df06c3ad..000000000 --- a/package/inc/ZipFile.hxx +++ /dev/null @@ -1,217 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _ZIP_FILE_HXX -#define _ZIP_FILE_HXX - -#include <com/sun/star/packages/zip/ZipException.hpp> -#include <com/sun/star/packages/zip/ZipIOException.hpp> -#include <com/sun/star/packages/NoEncryptionException.hpp> -#include <com/sun/star/packages/WrongPasswordException.hpp> -#include <com/sun/star/xml/crypto/XCipherContext.hpp> -#include <com/sun/star/xml/crypto/XDigestContext.hpp> - -#include <ByteGrabber.hxx> -#include <HashMaps.hxx> -#include <Inflater.hxx> -#include <EncryptionData.hxx> - -#include <mutexholder.hxx> - -namespace com { namespace sun { namespace star { - namespace lang { class XMultiServiceFactory; } - namespace ucb { class XProgressHandler; } -} } } -namespace rtl -{ - template < class T > class Reference; -} - -/* - * We impose arbitrary but reasonable limit on ZIP files. - */ - -#define ZIP_MAXNAMELEN 512 -#define ZIP_MAXEXTRA 256 -#define ZIP_MAXENTRIES (0x10000 - 2) - -class ZipEnumeration; - -class ZipFile -{ -protected: - ::osl::Mutex m_aMutex; - - ::rtl::OUString sComment; /* zip file comment */ - EntryHash aEntries; - ByteGrabber aGrabber; - ZipUtils::Inflater aInflater; - com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xStream; - com::sun::star::uno::Reference < com::sun::star::io::XSeekable > xSeek; - const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory; - ::com::sun::star::uno::Reference < ::com::sun::star::ucb::XProgressHandler > xProgressHandler; - - sal_Bool bRecoveryMode; - - com::sun::star::uno::Reference < com::sun::star::io::XInputStream > createMemoryStream( - ZipEntry & rEntry, - const ::rtl::Reference < EncryptionData > &rData, - sal_Bool bRawStream, - sal_Bool bDecrypt ); - - com::sun::star::uno::Reference < com::sun::star::io::XInputStream > createFileStream( - ZipEntry & rEntry, - const ::rtl::Reference < EncryptionData > &rData, - sal_Bool bRawStream, - sal_Bool bDecrypt ); - - // aMediaType parameter is used only for raw stream header creation - com::sun::star::uno::Reference < com::sun::star::io::XInputStream > createUnbufferedStream( - SotMutexHolderRef aMutexHolder, - ZipEntry & rEntry, - const ::rtl::Reference < EncryptionData > &rData, - sal_Int8 nStreamMode, - sal_Bool bDecrypt, - ::rtl::OUString aMediaType = ::rtl::OUString() ); - - sal_Bool hasValidPassword ( ZipEntry & rEntry, const rtl::Reference < EncryptionData > &rData ); - - sal_Bool checkSizeAndCRC( const ZipEntry& aEntry ); - - sal_Int32 getCRC( sal_Int32 nOffset, sal_Int32 nSize ); - - void getSizeAndCRC( sal_Int32 nOffset, sal_Int32 nCompressedSize, sal_Int32 *nSize, sal_Int32 *nCRC ); - -public: - - ZipFile( com::sun::star::uno::Reference < com::sun::star::io::XInputStream > &xInput, - const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > &xNewFactory, - sal_Bool bInitialise - ) - throw(::com::sun::star::io::IOException, com::sun::star::packages::zip::ZipException, com::sun::star::uno::RuntimeException); - - ZipFile( com::sun::star::uno::Reference < com::sun::star::io::XInputStream > &xInput, - const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > &xNewFactory, - sal_Bool bInitialise, - sal_Bool bForceRecover, - ::com::sun::star::uno::Reference < ::com::sun::star::ucb::XProgressHandler > xProgress - ) - throw(::com::sun::star::io::IOException, com::sun::star::packages::zip::ZipException, com::sun::star::uno::RuntimeException); - - ~ZipFile(); - - EntryHash& GetEntryHash() { return aEntries; } - - void setInputStream ( com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xNewStream ); - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawData( - ZipEntry& rEntry, - const ::rtl::Reference < EncryptionData > &rData, - sal_Bool bDecrypt, - SotMutexHolderRef aMutexHolder ) - throw(::com::sun::star::io::IOException, ::com::sun::star::packages::zip::ZipException, ::com::sun::star::uno::RuntimeException); - - - static ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XDigestContext > StaticGetDigestContextForChecksum( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xArgFactory, - const ::rtl::Reference< EncryptionData >& xEncryptionData ); - - static ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XCipherContext > StaticGetCipher( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xArgFactory, - const ::rtl::Reference< EncryptionData >& xEncryptionData, - bool bEncrypt ); - - static void StaticFillHeader ( const ::rtl::Reference < EncryptionData > & rData, - sal_Int32 nSize, - const ::rtl::OUString& aMediaType, - sal_Int8 * & pHeader ); - - static sal_Bool StaticFillData ( ::rtl::Reference < BaseEncryptionData > & rData, - sal_Int32 &rEncAlgorithm, - sal_Int32 &rChecksumAlgorithm, - sal_Int32 &rDerivedKeySize, - sal_Int32 &rStartKeyGenID, - sal_Int32 &rSize, - ::rtl::OUString& aMediaType, - const ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& rStream ); - - static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > StaticGetDataFromRawStream( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory, - const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xStream, - const ::rtl::Reference < EncryptionData > &rData ) - throw ( ::com::sun::star::packages::WrongPasswordException, - ::com::sun::star::packages::zip::ZipIOException, - ::com::sun::star::uno::RuntimeException ); - - static sal_Bool StaticHasValidPassword ( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory, - const ::com::sun::star::uno::Sequence< sal_Int8 > &aReadBuffer, - const ::rtl::Reference < EncryptionData > &rData ); - - - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( - ZipEntry& rEntry, - const ::rtl::Reference < EncryptionData > &rData, - sal_Bool bDecrypt, - SotMutexHolderRef aMutexHolder ) - throw(::com::sun::star::io::IOException, ::com::sun::star::packages::zip::ZipException, ::com::sun::star::uno::RuntimeException); - - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getDataStream( - ZipEntry& rEntry, - const ::rtl::Reference < EncryptionData > &rData, - sal_Bool bDecrypt, - SotMutexHolderRef aMutexHolder ) - throw ( ::com::sun::star::packages::WrongPasswordException, - ::com::sun::star::io::IOException, - ::com::sun::star::packages::zip::ZipException, - ::com::sun::star::uno::RuntimeException ); - - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getWrappedRawStream( - ZipEntry& rEntry, - const ::rtl::Reference < EncryptionData > &rData, - const ::rtl::OUString& aMediaType, - SotMutexHolderRef aMutexHolder ) - throw ( ::com::sun::star::packages::NoEncryptionException, - ::com::sun::star::io::IOException, - ::com::sun::star::packages::zip::ZipException, - ::com::sun::star::uno::RuntimeException ); - - ZipEnumeration * SAL_CALL entries( ); -protected: - sal_Bool readLOC ( ZipEntry &rEntry) - throw(::com::sun::star::io::IOException, com::sun::star::packages::zip::ZipException, com::sun::star::uno::RuntimeException); - sal_Int32 readCEN() - throw(::com::sun::star::io::IOException, com::sun::star::packages::zip::ZipException, com::sun::star::uno::RuntimeException); - sal_Int32 findEND() - throw(::com::sun::star::io::IOException, com::sun::star::packages::zip::ZipException, com::sun::star::uno::RuntimeException); - sal_Int32 recover() - throw(::com::sun::star::io::IOException, com::sun::star::packages::zip::ZipException, com::sun::star::uno::RuntimeException); - -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/ZipOutputStream.hxx b/package/inc/ZipOutputStream.hxx deleted file mode 100644 index 5b89c776d..000000000 --- a/package/inc/ZipOutputStream.hxx +++ /dev/null @@ -1,115 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _ZIP_OUTPUT_STREAM_HXX -#define _ZIP_OUTPUT_STREAM_HXX - -#include <com/sun/star/uno/Reference.hxx> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/io/XOutputStream.hpp> -#include <com/sun/star/xml/crypto/XCipherContext.hpp> -#include <com/sun/star/xml/crypto/XDigestContext.hpp> - -#include <ByteChucker.hxx> -#include <Deflater.hxx> -#include <CRC32.hxx> - -#include <vector> - -struct ZipEntry; -class ZipPackageStream; -namespace rtl -{ - template < class T > class Reference; -} - -class ZipOutputStream -{ -protected: - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; - ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > xStream; - - ::std::vector < ZipEntry * > aZipList; - - ::com::sun::star::uno::Sequence< sal_Int8 > m_aDeflateBuffer; - - ::rtl::OUString sComment; - ZipUtils::Deflater aDeflater; - - ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XCipherContext > m_xCipherContext; - ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XDigestContext > m_xDigestContext; - - CRC32 aCRC; - ByteChucker aChucker; - ZipEntry *pCurrentEntry; - sal_Int16 nMethod, nLevel, mnDigested; - sal_Bool bFinished, bEncryptCurrentEntry; - ZipPackageStream* m_pCurrentStream; - -public: - ZipOutputStream( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory, - const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > &xOStream ); - ~ZipOutputStream(); - - // rawWrite to support a direct write to the output stream - void SAL_CALL rawWrite( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ) - throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - void SAL_CALL rawCloseEntry( ) - throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - - // XZipOutputStream interfaces - void SAL_CALL setMethod( sal_Int32 nNewMethod ) - throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL setLevel( sal_Int32 nNewLevel ) - throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL putNextEntry( ZipEntry& rEntry, - ZipPackageStream* pStream, - sal_Bool bEncrypt = sal_False ) - throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - void SAL_CALL closeEntry( ) - throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - void SAL_CALL write( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ) - throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - void SAL_CALL finish( ) - throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - static sal_uInt32 getCurrentDosTime ( ); -protected: - void doDeflate(); - void writeEND(sal_uInt32 nOffset, sal_uInt32 nLength) - throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - void writeCEN( const ZipEntry &rEntry ) - throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - void writeEXT( const ZipEntry &rEntry ) - throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - sal_Int32 writeLOC( const ZipEntry &rEntry ) - throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx deleted file mode 100644 index ed7be23ea..000000000 --- a/package/inc/ZipPackage.hxx +++ /dev/null @@ -1,205 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _ZIP_PACKAGE_HXX -#define _ZIP_PACKAGE_HXX - -#include <cppuhelper/implbase7.hxx> -#include <com/sun/star/lang/XInitialization.hpp> -#include <com/sun/star/container/XHierarchicalNameAccess.hpp> -#include <com/sun/star/lang/XSingleServiceFactory.hpp> -#include <com/sun/star/util/XChangesBatch.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/beans/NamedValue.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/xml/crypto/CipherID.hpp> -#include <com/sun/star/lang/IllegalArgumentException.hpp> - -#include <HashMaps.hxx> -#include <osl/file.h> -#include <mutexholder.hxx> -#include <vector> - -class ZipOutputStream; -class ZipPackageFolder; -class ZipFile; -class ByteGrabber; -namespace com { namespace sun { namespace star { - namespace container { class XNameContainer; } - namespace io { class XStream; class XOutputStream; class XInputStream; class XSeekable; class XActiveDataStreamer; } - namespace lang { class XMultiServiceFactory; } - namespace task { class XInteractionHandler; } -} } } -enum SegmentEnum -{ - e_Aborted = -1000, - e_Retry, - e_Finished, - e_Success = 0 -}; - -enum InitialisationMode -{ - e_IMode_None, - e_IMode_URL, - e_IMode_XInputStream, - e_IMode_XStream -}; - -class ZipPackage : public cppu::WeakImplHelper7 - < - com::sun::star::lang::XInitialization, - com::sun::star::lang::XSingleServiceFactory, - com::sun::star::lang::XUnoTunnel, - com::sun::star::lang::XServiceInfo, - com::sun::star::container::XHierarchicalNameAccess, - com::sun::star::util::XChangesBatch, - com::sun::star::beans::XPropertySet - > -{ -protected: - SotMutexHolderRef m_aMutexHolder; - - ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > m_aStorageEncryptionKeys; - ::com::sun::star::uno::Sequence< sal_Int8 > m_aEncryptionKey; - - FolderHash m_aRecent; - ::rtl::OUString m_aURL; - - sal_Int32 m_nStartKeyGenerationID; - sal_Int32 m_nChecksumDigestID; - sal_Int32 m_nCommonEncryptionID; - sal_Bool m_bHasEncryptedEntries; - sal_Bool m_bHasNonEncryptedEntries; - - sal_Bool m_bInconsistent; - sal_Bool m_bForceRecovery; - - sal_Bool m_bMediaTypeFallbackUsed; - sal_Int32 m_nFormat; - sal_Bool m_bAllowRemoveOnInsert; - - InitialisationMode m_eMode; - - ::com::sun::star::uno::Reference < com::sun::star::container::XNameContainer > m_xRootFolder; - ::com::sun::star::uno::Reference < com::sun::star::io::XStream > m_xStream; - ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream > m_xContentStream; - ::com::sun::star::uno::Reference < com::sun::star::io::XSeekable > m_xContentSeek; - const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory; - - ZipPackageFolder *m_pRootFolder; - ZipFile *m_pZipFile; - - void parseManifest(); - void parseContentType(); - void getZipFileContents(); - - void WriteMimetypeMagicFile( ZipOutputStream& aZipOut ); - void WriteManifest( ZipOutputStream& aZipOut, const ::std::vector< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& aManList ); - void WriteContentTypes( ZipOutputStream& aZipOut, const ::std::vector< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& aManList ); - - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > writeTempFile(); - ::com::sun::star::uno::Reference < ::com::sun::star::io::XActiveDataStreamer > openOriginalForOutput(); - void DisconnectFromTargetAndThrowException_Impl( - const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xTempStream ); - -public: - ZipPackage( const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > &xNewFactory ); - virtual ~ZipPackage( void ); - ZipFile& getZipFile() { return *m_pZipFile;} - sal_Int32 getFormat() const { return m_nFormat; } - - sal_Int32 GetStartKeyGenID() const { return m_nStartKeyGenerationID; } - sal_Int32 GetEncAlgID() const { return m_nCommonEncryptionID; } - sal_Int32 GetChecksumAlgID() const { return m_nChecksumDigestID; } - sal_Int32 GetDefaultDerivedKeySize() const { return m_nCommonEncryptionID == ::com::sun::star::xml::crypto::CipherID::AES_CBC_W3C_PADDING ? 32 : 16; } - - SotMutexHolderRef GetSharedMutexRef() { return m_aMutexHolder; } - - void ConnectTo( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream ); - const ::com::sun::star::uno::Sequence< sal_Int8 > GetEncryptionKey(); - - // XInitialization - virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) - throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); - // XHierarchicalNameAccess - virtual ::com::sun::star::uno::Any SAL_CALL getByHierarchicalName( const ::rtl::OUString& aName ) - throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasByHierarchicalName( const ::rtl::OUString& aName ) - throw(::com::sun::star::uno::RuntimeException); - // XSingleServiceFactory - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( ) - throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) - throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); - // XChangesBatch - virtual void SAL_CALL commitChanges( ) - throw(::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasPendingChanges( ) - throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::util::ElementChange > SAL_CALL getPendingChanges( ) - throw(::com::sun::star::uno::RuntimeException); - // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) - throw(::com::sun::star::uno::RuntimeException); - com::sun::star::uno::Sequence < sal_Int8 > getUnoTunnelImplementationId( void ) - throw(::com::sun::star::uno::RuntimeException); - // XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) - throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) - throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) - throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) - throw (::com::sun::star::uno::RuntimeException); - - // Uno componentiseralation - static ::rtl::OUString static_getImplementationName(); - static ::com::sun::star::uno::Sequence < ::rtl::OUString > static_getSupportedServiceNames(); - static ::com::sun::star::uno::Reference < com::sun::star::lang::XSingleServiceFactory > createServiceFactory( com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > const & rServiceFactory ); - sal_Bool SAL_CALL static_supportsService(rtl::OUString const & rServiceName); -}; -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/ZipPackageBuffer.hxx b/package/inc/ZipPackageBuffer.hxx deleted file mode 100644 index 29ba4156e..000000000 --- a/package/inc/ZipPackageBuffer.hxx +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _ZIP_PACKAGE_BUFFER_HXX -#define _ZIP_PACKAGE_BUFFER_HXX - -#include <com/sun/star/io/XOutputStream.hpp> -#include <com/sun/star/io/XSeekable.hpp> -#include <com/sun/star/io/XInputStream.hpp> -#include <cppuhelper/implbase3.hxx> - -class ZipPackage; - -class ZipPackageBuffer : public ::cppu::WeakImplHelper3 -< - com::sun::star::io::XInputStream, - com::sun::star::io::XOutputStream, - com::sun::star::io::XSeekable -> -{ -protected: - com::sun::star::uno::Sequence < sal_Int8 > m_aBuffer; - sal_Int64 m_nBufferSize, m_nEnd, m_nCurrent; - sal_Bool m_bMustInitBuffer; -public: - ZipPackageBuffer(sal_Int64 nNewBufferSize); - virtual ~ZipPackageBuffer(void); - - inline void realloc ( sal_Int32 nSize ) { m_aBuffer.realloc ( nSize ); } - inline const sal_Int8 * getConstArray () const { return m_aBuffer.getConstArray(); } - inline const com::sun::star::uno::Sequence < sal_Int8> getSequence () const { return m_aBuffer; } - - // XInputStream - virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) - throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) - throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) - throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL available( ) - throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL closeInput( ) - throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - // XOutputStream - virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData ) - throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL flush( ) - throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL closeOutput( ) - throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - // XSeekable - virtual void SAL_CALL seek( sal_Int64 location ) - throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int64 SAL_CALL getPosition( ) - throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int64 SAL_CALL getLength( ) - throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); -}; -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/ZipPackageEntry.hxx b/package/inc/ZipPackageEntry.hxx deleted file mode 100644 index 18adfdc14..000000000 --- a/package/inc/ZipPackageEntry.hxx +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _ZIP_PACKAGE_ENTRY_HXX -#define _ZIP_PACKAGE_ENTRY_HXX - -#include <com/sun/star/container/XChild.hpp> -#include <com/sun/star/container/XNamed.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> -#include <com/sun/star/container/XNameContainer.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <ZipEntry.hxx> -#include <cppuhelper/implbase5.hxx> - -class ZipPackageFolder; - -class ZipPackageEntry : public cppu::WeakImplHelper5 -< - com::sun::star::container::XNamed, - com::sun::star::container::XChild, - com::sun::star::lang::XUnoTunnel, - com::sun::star::beans::XPropertySet, - com::sun::star::lang::XServiceInfo -> -{ -protected: - ::rtl::OUString msName; - bool mbIsFolder:1; - bool mbAllowRemoveOnInsert:1; - // com::sun::star::uno::Reference < com::sun::star::container::XNameContainer > xParent; - ::rtl::OUString sMediaType; - ZipPackageFolder * pParent; -public: - ZipEntry aEntry; - ZipPackageEntry ( bool bNewFolder = sal_False ); - virtual ~ZipPackageEntry( void ); - - ::rtl::OUString & GetMediaType () { return sMediaType; } - void SetMediaType ( const ::rtl::OUString & sNewType) { sMediaType = sNewType; } - void doSetParent ( ZipPackageFolder * pNewParent, sal_Bool bInsert ); - bool IsFolder ( ) { return mbIsFolder; } - ZipPackageFolder* GetParent ( ) { return pParent; } - void SetFolder ( bool bSetFolder ) { mbIsFolder = bSetFolder; } - - void clearParent ( void ) - { - // xParent.clear(); - pParent = NULL; - } - // XNamed - virtual ::rtl::OUString SAL_CALL getName( ) - throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setName( const ::rtl::OUString& aName ) - throw(::com::sun::star::uno::RuntimeException); - // XChild - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) - throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) - throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); - // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) - throw(::com::sun::star::uno::RuntimeException) = 0; - // XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) - throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0; - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0; - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); -}; -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/ZipPackageFolder.hxx b/package/inc/ZipPackageFolder.hxx deleted file mode 100644 index 59be1b7b3..000000000 --- a/package/inc/ZipPackageFolder.hxx +++ /dev/null @@ -1,150 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _ZIP_PACKAGE_FOLDER_HXX -#define _ZIP_PACKAGE_FOLDER_HXX - -#include <com/sun/star/container/XNameContainer.hpp> -#include <com/sun/star/container/XEnumerationAccess.hpp> -#include <com/sun/star/beans/StringPair.hpp> -#include <HashMaps.hxx> -#include <ZipPackageEntry.hxx> -#include <cppuhelper/implbase2.hxx> -#include <vector> - -namespace com { namespace sun { namespace star { -namespace beans -{ - struct PropertyValue; -} -namespace packages -{ - class ContentInfo; -} -} } } - -class ZipFile; -class ZipPackage; -class ZipOutputStream; -struct ZipEntry; -typedef void* rtlRandomPool; - -class ZipPackageFolder : public cppu::ImplInheritanceHelper2 -< - ZipPackageEntry, - ::com::sun::star::container::XNameContainer, - ::com::sun::star::container::XEnumerationAccess -> -{ -protected: - ContentHash maContents; - const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory; - sal_Int32 m_nFormat; - ::rtl::OUString m_sVersion; - -public: - - ZipPackageFolder( const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& xFactory, - sal_Int32 nFormat, - sal_Bool bAllowRemoveOnInsert ); - virtual ~ZipPackageFolder(); - - ::rtl::OUString& GetVersion() { return m_sVersion; } - void SetVersion( const ::rtl::OUString& aVersion ) { m_sVersion = aVersion; } - - sal_Bool LookForUnexpectedODF12Streams( const ::rtl::OUString& aPath ); - - void setChildStreamsTypeByExtension( const ::com::sun::star::beans::StringPair& aPair ); - - void doInsertByName ( ZipPackageEntry *pEntry, sal_Bool bSetParent ) - throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - com::sun::star::packages::ContentInfo & doGetByName( const ::rtl::OUString& aName ) - throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - static void copyZipEntry( ZipEntry &rDest, const ZipEntry &rSource); - static const ::com::sun::star::uno::Sequence < sal_Int8 >& static_getImplementationId(); - - void setPackageFormat_Impl( sal_Int32 nFormat ) { m_nFormat = nFormat; } - void setRemoveOnInsertMode_Impl( sal_Bool bRemove ) { this->mbAllowRemoveOnInsert = bRemove; } - - bool saveChild(const rtl::OUString &rShortName, const com::sun::star::packages::ContentInfo &rInfo, rtl::OUString &rPath, std::vector < com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > > &rManList, ZipOutputStream & rZipOut, const com::sun::star::uno::Sequence < sal_Int8 >& rEncryptionKey, rtlRandomPool & rRandomPool); - - // Recursive functions - void saveContents(rtl::OUString &rPath, std::vector < com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > > &rManList, ZipOutputStream & rZipOut, const com::sun::star::uno::Sequence< sal_Int8 > &rEncryptionKey, rtlRandomPool & rRandomPool) - throw(::com::sun::star::uno::RuntimeException); - void releaseUpwardRef(); - - // XNameContainer - virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) - throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeByName( const ::rtl::OUString& Name ) - throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - // XEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration( ) - throw(::com::sun::star::uno::RuntimeException); - - // XElementAccess - virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) - throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements( ) - throw(::com::sun::star::uno::RuntimeException); - - // XNameAccess - virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) - throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) - throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) - throw(::com::sun::star::uno::RuntimeException); - - // XNameReplace - virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) - throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - // XPropertySet - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) - throw(::com::sun::star::uno::RuntimeException); - - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) - throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) - throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) - throw (::com::sun::star::uno::RuntimeException); -}; -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/ZipPackageStream.hxx b/package/inc/ZipPackageStream.hxx deleted file mode 100644 index 7dacc81d9..000000000 --- a/package/inc/ZipPackageStream.hxx +++ /dev/null @@ -1,218 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _ZIP_PACKAGE_STREAM_HXX -#define _ZIP_PACKAGE_STREAM_HXX - -#include <com/sun/star/io/XActiveDataSink.hpp> -#include <com/sun/star/io/XSeekable.hpp> -#include <com/sun/star/beans/NamedValue.hpp> -#include <com/sun/star/packages/XDataSinkEncrSupport.hpp> -#include <ZipPackageEntry.hxx> -#include <rtl/ref.hxx> -#include <cppuhelper/implbase2.hxx> - -#include <EncryptionData.hxx> -#include <mutexholder.hxx> - -#define PACKAGE_STREAM_NOTSET 0 -#define PACKAGE_STREAM_PACKAGEMEMBER 1 -#define PACKAGE_STREAM_DETECT 2 -#define PACKAGE_STREAM_DATA 3 -#define PACKAGE_STREAM_RAW 4 - -class ZipPackage; -struct ZipEntry; -class ZipPackageStream : public cppu::ImplInheritanceHelper2 -< - ZipPackageEntry, - ::com::sun::star::io::XActiveDataSink, - ::com::sun::star::packages::XDataSinkEncrSupport -> -{ -protected: - com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xStream; - const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory; - ZipPackage &rZipPackage; - sal_Bool bToBeCompressed, bToBeEncrypted, bHaveOwnKey, bIsEncrypted; - - ::rtl::Reference< BaseEncryptionData > m_xBaseEncryptionData; - ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > m_aStorageEncryptionKeys; - ::com::sun::star::uno::Sequence< sal_Int8 > m_aEncryptionKey; - - sal_Int32 m_nImportedStartKeyAlgorithm; - sal_Int32 m_nImportedEncryptionAlgorithm; - sal_Int32 m_nImportedChecksumAlgorithm; - sal_Int32 m_nImportedDerivedKeySize; - - sal_uInt8 m_nStreamMode; - sal_uInt32 m_nMagicalHackPos; - sal_uInt32 m_nMagicalHackSize; - - sal_Bool m_bHasSeekable; - - sal_Bool m_bCompressedIsSetFromOutside; - - sal_Bool m_bFromManifest; - - bool m_bUseWinEncoding; - - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetOwnSeekStream(); - -public: - sal_Bool HasOwnKey () const { return bHaveOwnKey;} - sal_Bool IsToBeCompressed () const { return bToBeCompressed;} - sal_Bool IsToBeEncrypted () const { return bToBeEncrypted;} - sal_Bool IsEncrypted () const { return bIsEncrypted;} - sal_Bool IsPackageMember () const { return m_nStreamMode == PACKAGE_STREAM_PACKAGEMEMBER;} - - sal_Bool IsFromManifest() const { return m_bFromManifest; } - void SetFromManifest( sal_Bool bValue ) { m_bFromManifest = bValue; } - - ::rtl::Reference< EncryptionData > GetEncryptionData( bool bWinEncoding = false ); - void SetBaseEncryptionData( const ::rtl::Reference< BaseEncryptionData >& xData ); - - ::com::sun::star::uno::Sequence< sal_Int8 > GetEncryptionKey( bool bWinEncoding = false ); - - sal_Int32 GetStartKeyGenID(); - - const com::sun::star::uno::Sequence < sal_Int8 > getInitialisationVector () const - { return m_xBaseEncryptionData->m_aInitVector;} - const com::sun::star::uno::Sequence < sal_Int8 > getDigest () const - { return m_xBaseEncryptionData->m_aDigest;} - const com::sun::star::uno::Sequence < sal_Int8 > getSalt () const - { return m_xBaseEncryptionData->m_aSalt;} - sal_Int32 getIterationCount () const - { return m_xBaseEncryptionData->m_nIterationCount;} - sal_Int32 getSize () const - { return aEntry.nSize;} - - sal_uInt8 GetStreamMode() const { return m_nStreamMode; } - sal_uInt32 GetMagicalHackPos() const { return m_nMagicalHackPos; } - sal_uInt32 GetMagicalHackSize() const { return m_nMagicalHackSize; } - sal_Int32 GetEncryptionAlgorithm() const; - sal_Int32 GetBlockSize() const; - - void SetToBeCompressed (sal_Bool bNewValue) { bToBeCompressed = bNewValue;} - void SetIsEncrypted (sal_Bool bNewValue) { bIsEncrypted = bNewValue;} - void SetImportedStartKeyAlgorithm( sal_Int32 nAlgorithm ) { m_nImportedStartKeyAlgorithm = nAlgorithm; } - void SetImportedEncryptionAlgorithm( sal_Int32 nAlgorithm ) { m_nImportedEncryptionAlgorithm = nAlgorithm; } - void SetImportedChecksumAlgorithm( sal_Int32 nAlgorithm ) { m_nImportedChecksumAlgorithm = nAlgorithm; } - void SetImportedDerivedKeySize( sal_Int32 nSize ) { m_nImportedDerivedKeySize = nSize; } - void SetToBeEncrypted (sal_Bool bNewValue) - { - bToBeEncrypted = bNewValue; - if ( bToBeEncrypted && !m_xBaseEncryptionData.is()) - m_xBaseEncryptionData = new BaseEncryptionData; - else if ( !bToBeEncrypted && m_xBaseEncryptionData.is() ) - m_xBaseEncryptionData.clear(); - } - void SetPackageMember (sal_Bool bNewValue); - - void setKey (const com::sun::star::uno::Sequence < sal_Int8 >& rNewKey ) - { m_aEncryptionKey = rNewKey; m_aStorageEncryptionKeys.realloc( 0 ); } - void setInitialisationVector (const com::sun::star::uno::Sequence < sal_Int8 >& rNewVector ) - { m_xBaseEncryptionData->m_aInitVector = rNewVector;} - void setSalt (const com::sun::star::uno::Sequence < sal_Int8 >& rNewSalt ) - { m_xBaseEncryptionData->m_aSalt = rNewSalt;} - void setDigest (const com::sun::star::uno::Sequence < sal_Int8 >& rNewDigest ) - { m_xBaseEncryptionData->m_aDigest = rNewDigest;} - void setIterationCount (const sal_Int32 nNewCount) - { m_xBaseEncryptionData->m_nIterationCount = nNewCount;} - void setSize (const sal_Int32 nNewSize); - - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetOwnStreamNoWrap() { return xStream; } - - void CloseOwnStreamIfAny(); - - ZipPackageStream ( ZipPackage & rNewPackage, - const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& xFactory, - sal_Bool bAllowRemoveOnInsert ); - virtual ~ZipPackageStream( void ); - - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetRawEncrStreamNoHeaderCopy(); - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > TryToGetRawFromDataStream( - sal_Bool bAddHeaderForEncr ); - - sal_Bool ParsePackageRawStream(); - - void setZipEntryOnLoading( const ZipEntry &rInEntry); - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawData() - throw(::com::sun::star::uno::RuntimeException); - - static const ::com::sun::star::uno::Sequence < sal_Int8 >& static_getImplementationId(); - - // XActiveDataSink - virtual void SAL_CALL setInputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aStream ) - throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) - throw(::com::sun::star::uno::RuntimeException); - - // XDataSinkEncrSupport - virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getDataStream() - throw ( ::com::sun::star::packages::WrongPasswordException, - ::com::sun::star::io::IOException, - ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawStream() - throw ( ::com::sun::star::packages::NoEncryptionException, - ::com::sun::star::io::IOException, - ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setDataStream( - const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aStream ) - throw ( ::com::sun::star::io::IOException, - ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setRawStream( - const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aStream ) - throw ( ::com::sun::star::packages::EncryptionNotAllowedException, - ::com::sun::star::packages::NoRawFormatException, - ::com::sun::star::io::IOException, - ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getPlainRawStream() - throw ( ::com::sun::star::io::IOException, - ::com::sun::star::uno::RuntimeException ); - - // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) - throw(::com::sun::star::uno::RuntimeException); - - // XPropertySet - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) - throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) - throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) - throw (::com::sun::star::uno::RuntimeException); -}; -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/makefile.mk b/package/inc/makefile.mk deleted file mode 100644 index 19d89678b..000000000 --- a/package/inc/makefile.mk +++ /dev/null @@ -1,47 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=.. - -PRJNAME=package -TARGET=inc - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -# --- Files -------------------------------------------------------- -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - -.IF "$(ENABLE_PCH)"!="" -ALLTAR : \ - $(SLO)$/precompiled.pch \ - $(SLO)$/precompiled_ex.pch - -.ENDIF # "$(ENABLE_PCH)"!="" - diff --git a/package/inc/mutexholder.hxx b/package/inc/mutexholder.hxx deleted file mode 100644 index 8f56012e3..000000000 --- a/package/inc/mutexholder.hxx +++ /dev/null @@ -1,133 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef __MUTEXHOLDER_HXX_ -#define __MUTEXHOLDER_HXX_ - -#include <osl/mutex.hxx> - -class SotMutexHolder -{ - ::osl::Mutex m_aMutex; - sal_Int32 m_nRefCount; - - public: - SotMutexHolder() : m_nRefCount( 0 ) {} - - void AddRef() - { - m_nRefCount++; - } - - void ReleaseRef() - { - if ( !--m_nRefCount ) - delete this; - } - - ::osl::Mutex& GetMutex() { return m_aMutex; } -}; - -class SotMutexHolderRef -{ - SotMutexHolder* m_pHolder; - -public: - SotMutexHolderRef() - : m_pHolder( NULL ) - {} - - SotMutexHolderRef( SotMutexHolder* pHolder ) - : m_pHolder( pHolder ) - { - if ( m_pHolder ) - m_pHolder->AddRef(); - } - - SotMutexHolderRef( const SotMutexHolderRef& rRef ) - : m_pHolder( rRef.m_pHolder ) - { - if ( m_pHolder ) - m_pHolder->AddRef(); - } - - ~SotMutexHolderRef() - { - if ( m_pHolder ) - m_pHolder->ReleaseRef(); - } - - SotMutexHolderRef& operator =( const SotMutexHolderRef& rRef ) - { - if ( m_pHolder ) - m_pHolder->ReleaseRef(); - - m_pHolder = rRef.m_pHolder; - - if ( m_pHolder ) - m_pHolder->AddRef(); - - return *this; - } - - SotMutexHolderRef& operator =( SotMutexHolder* pHolder ) - { - if ( m_pHolder ) - m_pHolder->ReleaseRef(); - - m_pHolder = pHolder; - - if ( m_pHolder ) - m_pHolder->AddRef(); - return *this; - } - - SotMutexHolder* operator ->() const - { - return m_pHolder; - } - - SotMutexHolder& operator *() const - { - return *m_pHolder; - } - - operator SotMutexHolder*() const - { - return m_pHolder; - } - - sal_Bool Is() const - { - return m_pHolder != NULL; - } -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/packagedllapi.hxx b/package/inc/packagedllapi.hxx deleted file mode 100644 index 41e8efa4d..000000000 --- a/package/inc/packagedllapi.hxx +++ /dev/null @@ -1,15 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -#ifndef INCLUDED_PACKAGEDLLAPI_H -#define INCLUDED_PACKAGEDLLAPI_H - -#include "sal/types.h" - -#if defined(DLLIMPLEMENTATION_PACKAGE) -#define DLLPUBLIC_PACKAGE SAL_DLLPUBLIC_EXPORT -#else -#define DLLPUBLIC_PACKAGE SAL_DLLPUBLIC_IMPORT -#endif - -#endif /* INCLUDED_PACKAGEDLLAPI_H */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/pch/precompiled_package.cxx b/package/inc/pch/precompiled_package.cxx deleted file mode 100644 index 762f8ec65..000000000 --- a/package/inc/pch/precompiled_package.cxx +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "precompiled_package.hxx" - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/pch/precompiled_package.hxx b/package/inc/pch/precompiled_package.hxx deleted file mode 100644 index ea9e713ff..000000000 --- a/package/inc/pch/precompiled_package.hxx +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): Generated on 2006-09-01 17:49:53.889391 - -#ifdef PRECOMPILED_HEADERS -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/zipfileaccess.hxx b/package/inc/zipfileaccess.hxx deleted file mode 100644 index 68f48268e..000000000 --- a/package/inc/zipfileaccess.hxx +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _ZIPFILEACCESS_HXX_ -#define _ZIPFILEACCESS_HXX_ - -#include <com/sun/star/packages/zip/XZipFileAccess.hpp> -#include <com/sun/star/lang/XInitialization.hpp> -#include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/container/XNameAccess.hpp> - -#include <cppuhelper/interfacecontainer.h> -#include <cppuhelper/implbase5.hxx> - -#include <mutexholder.hxx> - -#include <ZipFile.hxx> -#include <HashMaps.hxx> - -class OZipFileAccess : public ::cppu::WeakImplHelper5< - ::com::sun::star::packages::zip::XZipFileAccess, - ::com::sun::star::container::XNameAccess, - ::com::sun::star::lang::XInitialization, - ::com::sun::star::lang::XComponent, - ::com::sun::star::lang::XServiceInfo > -{ - SotMutexHolderRef m_aMutexHolder; - - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; - - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xContentStream; - ZipFile* m_pZipFile; - - ::cppu::OInterfaceContainerHelper* m_pListenersContainer; - - sal_Bool m_bDisposed; - -public: - OZipFileAccess( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory ); - - virtual ~OZipFileAccess(); - - ::com::sun::star::uno::Sequence< ::rtl::OUString > GetPatternsFromString_Impl( const ::rtl::OUString& aString ); - - sal_Bool StringGoodForPattern_Impl( const ::rtl::OUString& aString, - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPattern ); - - - static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL impl_staticGetSupportedServiceNames(); - - static ::rtl::OUString SAL_CALL impl_staticGetImplementationName(); - - static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_staticCreateSelfInstance( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ); - - - // XInitialization - virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); - - // XNameAccess - virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException); - - // XZipFileAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getStreamByPattern( const ::rtl::OUString& aPattern ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - - // XComponent - virtual void SAL_CALL dispose( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); - - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); - -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |