Version 4.2.0.1, tag libreoffice-4.2.0.1
[LibreOffice.git] / package / inc / zipfileaccess.hxx
blob59d2accc6329a6bee65f8c78dbe00429b103d560
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 .
20 #ifndef _ZIPFILEACCESS_HXX_
21 #define _ZIPFILEACCESS_HXX_
23 #include <com/sun/star/packages/zip/XZipFileAccess2.hpp>
24 #include <com/sun/star/lang/XInitialization.hpp>
25 #include <com/sun/star/lang/XComponent.hpp>
26 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <com/sun/star/container/XNameAccess.hpp>
30 #include <cppuhelper/interfacecontainer.h>
31 #include <cppuhelper/implbase4.hxx>
33 #include <mutexholder.hxx>
35 #include <ZipFile.hxx>
36 #include <HashMaps.hxx>
38 class OZipFileAccess : public ::cppu::WeakImplHelper4<
39 ::com::sun::star::packages::zip::XZipFileAccess2,
40 ::com::sun::star::lang::XInitialization,
41 ::com::sun::star::lang::XComponent,
42 ::com::sun::star::lang::XServiceInfo >
44 SotMutexHolderRef m_aMutexHolder;
46 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
48 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xContentStream;
49 ZipFile* m_pZipFile;
51 ::cppu::OInterfaceContainerHelper* m_pListenersContainer;
53 sal_Bool m_bDisposed;
55 public:
56 OZipFileAccess( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
58 virtual ~OZipFileAccess();
60 ::com::sun::star::uno::Sequence< OUString > GetPatternsFromString_Impl( const OUString& aString );
62 sal_Bool StringGoodForPattern_Impl( const OUString& aString,
63 const ::com::sun::star::uno::Sequence< OUString >& aPattern );
65 static ::com::sun::star::uno::Sequence< OUString > SAL_CALL impl_staticGetSupportedServiceNames();
67 static OUString SAL_CALL impl_staticGetImplementationName();
69 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_staticCreateSelfInstance(
70 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxMSF );
72 // XInitialization
73 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);
75 // XNameAccess
76 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
77 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames( ) throw (::com::sun::star::uno::RuntimeException);
78 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
79 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException);
80 virtual sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException);
82 // XZipFileAccess
83 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getStreamByPattern( const OUString& aPattern ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
85 // XComponent
86 virtual void SAL_CALL dispose( ) throw (::com::sun::star::uno::RuntimeException);
87 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
88 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
90 // XServiceInfo
91 virtual OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
92 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
93 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
97 #endif
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */