bump product version to 4.1.6.2
[LibreOffice.git] / package / inc / ZipPackageFolder.hxx
blob2a41e94d9dfd68a9b1861dacbdc43eedb39464dc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _ZIP_PACKAGE_FOLDER_HXX
20 #define _ZIP_PACKAGE_FOLDER_HXX
22 #include <com/sun/star/container/XNameContainer.hpp>
23 #include <com/sun/star/container/XEnumerationAccess.hpp>
24 #include <com/sun/star/beans/StringPair.hpp>
25 #include <HashMaps.hxx>
26 #include <ZipPackageEntry.hxx>
27 #include <cppuhelper/implbase2.hxx>
28 #include <vector>
30 namespace com { namespace sun { namespace star {
31 namespace beans
33 struct PropertyValue;
35 namespace packages
37 class ContentInfo;
39 } } }
41 class ZipOutputStream;
42 struct ZipEntry;
43 typedef void* rtlRandomPool;
45 class ZipPackageFolder : public cppu::ImplInheritanceHelper2
47 ZipPackageEntry,
48 ::com::sun::star::container::XNameContainer,
49 ::com::sun::star::container::XEnumerationAccess
52 private:
53 ContentHash maContents;
54 sal_Int32 m_nFormat;
55 OUString m_sVersion;
57 public:
59 ZipPackageFolder( sal_Int32 nFormat,
60 sal_Bool bAllowRemoveOnInsert );
61 virtual ~ZipPackageFolder();
63 OUString& GetVersion() { return m_sVersion; }
64 void SetVersion( const OUString& aVersion ) { m_sVersion = aVersion; }
66 sal_Bool LookForUnexpectedODF12Streams( const OUString& aPath );
68 void setChildStreamsTypeByExtension( const ::com::sun::star::beans::StringPair& aPair );
70 void doInsertByName ( ZipPackageEntry *pEntry, sal_Bool bSetParent )
71 throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
73 com::sun::star::packages::ContentInfo & doGetByName( const OUString& aName )
74 throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
76 static void copyZipEntry( ZipEntry &rDest, const ZipEntry &rSource);
77 static const ::com::sun::star::uno::Sequence < sal_Int8 >& static_getImplementationId();
79 void setPackageFormat_Impl( sal_Int32 nFormat ) { m_nFormat = nFormat; }
80 void setRemoveOnInsertMode_Impl( sal_Bool bRemove ) { this->mbAllowRemoveOnInsert = bRemove; }
82 bool saveChild(const OUString &rShortName, const com::sun::star::packages::ContentInfo &rInfo, 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);
84 // Recursive functions
85 void saveContents(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)
86 throw(::com::sun::star::uno::RuntimeException);
87 void releaseUpwardRef();
89 // XNameContainer
90 virtual void SAL_CALL insertByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement )
91 throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
92 virtual void SAL_CALL removeByName( const OUString& Name )
93 throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
95 // XEnumerationAccess
96 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration( )
97 throw(::com::sun::star::uno::RuntimeException);
99 // XElementAccess
100 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( )
101 throw(::com::sun::star::uno::RuntimeException);
102 virtual sal_Bool SAL_CALL hasElements( )
103 throw(::com::sun::star::uno::RuntimeException);
105 // XNameAccess
106 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
107 throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
108 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames( )
109 throw(::com::sun::star::uno::RuntimeException);
110 virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
111 throw(::com::sun::star::uno::RuntimeException);
113 // XNameReplace
114 virtual void SAL_CALL replaceByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement )
115 throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
117 // XPropertySet
118 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
119 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);
120 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName )
121 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
123 // XUnoTunnel
124 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
125 throw(::com::sun::star::uno::RuntimeException);
127 // XServiceInfo
128 virtual OUString SAL_CALL getImplementationName( )
129 throw (::com::sun::star::uno::RuntimeException);
130 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
131 throw (::com::sun::star::uno::RuntimeException);
132 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( )
133 throw (::com::sun::star::uno::RuntimeException);
135 #endif
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */