1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_PACKAGE_INC_ZIPFILEACCESS_HXX
21 #define INCLUDED_PACKAGE_INC_ZIPFILEACCESS_HXX
23 #include <com/sun/star/packages/zip/XZipFileAccess2.hpp>
24 #include <com/sun/star/packages/zip/ZipException.hpp>
25 #include <com/sun/star/lang/XInitialization.hpp>
26 #include <com/sun/star/lang/XComponent.hpp>
27 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/container/XNameAccess.hpp>
31 #include <comphelper/interfacecontainer2.hxx>
32 #include <comphelper/refcountedmutex.hxx>
33 #include <cppuhelper/implbase.hxx>
35 #include "ZipFile.hxx"
36 #include "HashMaps.hxx"
40 class OZipFileAccess
: public ::cppu::WeakImplHelper
<
41 css::packages::zip::XZipFileAccess2
,
42 css::lang::XInitialization
,
43 css::lang::XComponent
,
44 css::lang::XServiceInfo
>
46 rtl::Reference
<comphelper::RefCountedMutex
> m_aMutexHolder
;
47 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
;
48 css::uno::Reference
< css::io::XInputStream
> m_xContentStream
;
49 std::unique_ptr
<ZipFile
> m_pZipFile
;
50 std::unique_ptr
<::comphelper::OInterfaceContainerHelper2
> m_pListenersContainer
;
55 OZipFileAccess( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
57 virtual ~OZipFileAccess() override
;
59 static css::uno::Sequence
< OUString
> GetPatternsFromString_Impl( const OUString
& aString
);
61 static bool StringGoodForPattern_Impl( const OUString
& aString
,
62 const css::uno::Sequence
< OUString
>& aPattern
);
64 static css::uno::Sequence
< OUString
> impl_staticGetSupportedServiceNames();
66 static OUString
impl_staticGetImplementationName();
68 static css::uno::Reference
< css::uno::XInterface
> impl_staticCreateSelfInstance(
69 const css::uno::Reference
< css::lang::XMultiServiceFactory
>& rxMSF
);
72 virtual void SAL_CALL
initialize( const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
75 virtual css::uno::Any SAL_CALL
getByName( const OUString
& aName
) override
;
76 virtual css::uno::Sequence
< OUString
> SAL_CALL
getElementNames( ) override
;
77 virtual sal_Bool SAL_CALL
hasByName( const OUString
& aName
) override
;
78 virtual css::uno::Type SAL_CALL
getElementType( ) override
;
79 virtual sal_Bool SAL_CALL
hasElements( ) override
;
82 virtual css::uno::Reference
< css::io::XInputStream
> SAL_CALL
getStreamByPattern( const OUString
& aPattern
) override
;
85 virtual void SAL_CALL
dispose( ) override
;
86 virtual void SAL_CALL
addEventListener( const css::uno::Reference
< css::lang::XEventListener
>& xListener
) override
;
87 virtual void SAL_CALL
removeEventListener( const css::uno::Reference
< css::lang::XEventListener
>& aListener
) override
;
90 virtual OUString SAL_CALL
getImplementationName() override
;
91 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
92 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */