bump product version to 6.4.0.3
[LibreOffice.git] / package / inc / ZipPackageFolder.hxx
blobc99f8f2a6b271cc6538cd47f295d3036ed876268
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_PACKAGE_INC_ZIPPACKAGEFOLDER_HXX
20 #define INCLUDED_PACKAGE_INC_ZIPPACKAGEFOLDER_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 <com/sun/star/uno/XComponentContext.hpp>
26 #include "HashMaps.hxx"
27 #include "ZipPackageEntry.hxx"
28 #include <cppuhelper/implbase.hxx>
29 #include <vector>
31 class ZipOutputStream;
32 struct ZipEntry;
34 class ZipPackageFolder : public cppu::ImplInheritanceHelper
36 ZipPackageEntry,
37 css::container::XNameContainer,
38 css::container::XEnumerationAccess
41 private:
42 ContentHash maContents;
43 OUString m_sVersion;
45 public:
47 ZipPackageFolder( const css::uno::Reference < css::uno::XComponentContext >& xContext,
48 sal_Int32 nFormat,
49 bool bAllowRemoveOnInsert );
50 virtual ~ZipPackageFolder() override;
52 const OUString& GetVersion() const { return m_sVersion; }
53 void SetVersion( const OUString& aVersion ) { m_sVersion = aVersion; }
55 bool LookForUnexpectedODF12Streams( const OUString& aPath );
57 void setChildStreamsTypeByExtension( const css::beans::StringPair& aPair );
59 /// @throws css::lang::IllegalArgumentException
60 /// @throws css::container::ElementExistException
61 /// @throws css::lang::WrappedTargetException
62 /// @throws css::uno::RuntimeException
63 void doInsertByName ( ZipPackageEntry *pEntry, bool bSetParent );
65 ZipContentInfo& doGetByName( const OUString& aName );
67 static css::uno::Sequence < sal_Int8 > getUnoTunnelId();
69 void setPackageFormat_Impl( sal_Int32 nFormat ) { m_nFormat = nFormat; }
70 void setRemoveOnInsertMode_Impl( bool bRemove ) { mbAllowRemoveOnInsert = bRemove; }
72 virtual bool saveChild( const OUString &rPath,
73 std::vector < css::uno::Sequence < css::beans::PropertyValue > > &rManList,
74 ZipOutputStream & rZipOut,
75 const css::uno::Sequence < sal_Int8 >& rEncryptionKey,
76 sal_Int32 nPBKDF2IterationCount,
77 const rtlRandomPool &rRandomPool ) override;
79 // Recursive functions
80 /// @throws css::uno::RuntimeException
81 void saveContents(
82 const OUString &rPath,
83 std::vector < css::uno::Sequence < css::beans::PropertyValue > > &rManList,
84 ZipOutputStream & rZipOut,
85 const css::uno::Sequence< sal_Int8 > &rEncryptionKey,
86 sal_Int32 nPBKDF2IterationCount,
87 const rtlRandomPool & rRandomPool) const;
89 // XNameContainer
90 virtual void SAL_CALL insertByName( const OUString& aName, const css::uno::Any& aElement ) override;
91 virtual void SAL_CALL removeByName( const OUString& Name ) override;
93 // XEnumerationAccess
94 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration( ) override;
96 // XElementAccess
97 virtual css::uno::Type SAL_CALL getElementType( ) override;
98 virtual sal_Bool SAL_CALL hasElements( ) override;
100 // XNameAccess
101 virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
102 virtual css::uno::Sequence< OUString > SAL_CALL getElementNames( ) override;
103 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
105 // XNameReplace
106 virtual void SAL_CALL replaceByName( const OUString& aName, const css::uno::Any& aElement ) override;
108 // XPropertySet
109 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
110 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
112 // XUnoTunnel
113 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
115 // XServiceInfo
116 virtual OUString SAL_CALL getImplementationName( ) override;
117 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
118 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
120 #endif
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */