2010-10-27 12:45:03 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2004-05-18 16:22:25 +00:00
|
|
|
|
2014-04-18 22:14:30 +02:00
|
|
|
#ifndef INCLUDED_PACKAGE_INC_ZIPFILEACCESS_HXX
|
|
|
|
#define INCLUDED_PACKAGE_INC_ZIPFILEACCESS_HXX
|
2004-05-18 16:22:25 +00:00
|
|
|
|
2013-05-07 08:07:01 +02:00
|
|
|
#include <com/sun/star/packages/zip/XZipFileAccess2.hpp>
|
2014-10-17 11:59:41 +01:00
|
|
|
#include <com/sun/star/packages/zip/ZipException.hpp>
|
2004-05-18 16:22:25 +00:00
|
|
|
#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>
|
2015-08-25 16:10:12 +09:00
|
|
|
#include <cppuhelper/implbase.hxx>
|
2009-09-08 08:54:47 +00:00
|
|
|
|
|
|
|
#include <mutexholder.hxx>
|
2004-05-18 16:22:25 +00:00
|
|
|
|
|
|
|
#include <ZipFile.hxx>
|
|
|
|
#include <HashMaps.hxx>
|
|
|
|
|
2015-08-25 16:10:12 +09:00
|
|
|
class OZipFileAccess : public ::cppu::WeakImplHelper<
|
2015-10-23 14:59:15 +02:00
|
|
|
css::packages::zip::XZipFileAccess2,
|
|
|
|
css::lang::XInitialization,
|
|
|
|
css::lang::XComponent,
|
|
|
|
css::lang::XServiceInfo >
|
2004-05-18 16:22:25 +00:00
|
|
|
{
|
2015-06-29 09:15:16 +02:00
|
|
|
rtl::Reference<SotMutexHolder> m_aMutexHolder;
|
2015-10-23 14:59:15 +02:00
|
|
|
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
|
|
|
css::uno::Reference< css::io::XInputStream > m_xContentStream;
|
2004-05-18 16:22:25 +00:00
|
|
|
ZipFile* m_pZipFile;
|
|
|
|
::cppu::OInterfaceContainerHelper* m_pListenersContainer;
|
2014-04-17 13:40:46 +02:00
|
|
|
bool m_bDisposed;
|
2014-01-16 16:15:10 +01:00
|
|
|
bool m_bOwnContent;
|
2004-05-18 16:22:25 +00:00
|
|
|
|
|
|
|
public:
|
2015-10-23 14:59:15 +02:00
|
|
|
OZipFileAccess( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
|
2004-05-18 16:22:25 +00:00
|
|
|
|
|
|
|
virtual ~OZipFileAccess();
|
|
|
|
|
2015-10-23 14:59:15 +02:00
|
|
|
static css::uno::Sequence< OUString > GetPatternsFromString_Impl( const OUString& aString );
|
2004-05-18 16:22:25 +00:00
|
|
|
|
2015-04-07 13:16:24 +02:00
|
|
|
static bool StringGoodForPattern_Impl( const OUString& aString,
|
2015-10-23 14:59:15 +02:00
|
|
|
const css::uno::Sequence< OUString >& aPattern );
|
2004-05-18 16:22:25 +00:00
|
|
|
|
2015-10-23 14:59:15 +02:00
|
|
|
static css::uno::Sequence< OUString > SAL_CALL impl_staticGetSupportedServiceNames();
|
2004-05-18 16:22:25 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
static OUString SAL_CALL impl_staticGetImplementationName();
|
2004-05-18 16:22:25 +00:00
|
|
|
|
2015-10-23 14:59:15 +02:00
|
|
|
static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_staticCreateSelfInstance(
|
|
|
|
const css::uno::Reference< css::lang::XMultiServiceFactory >& rxMSF );
|
2004-05-18 16:22:25 +00:00
|
|
|
|
|
|
|
// XInitialization
|
2015-10-23 14:59:15 +02:00
|
|
|
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw (css::uno::Exception, css::uno::RuntimeException, std::exception) override;
|
2004-05-18 16:22:25 +00:00
|
|
|
|
|
|
|
// XNameAccess
|
2015-10-23 14:59:15 +02:00
|
|
|
virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames( ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Type SAL_CALL getElementType( ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL hasElements( ) throw (css::uno::RuntimeException, std::exception) override;
|
2004-05-18 16:22:25 +00:00
|
|
|
|
|
|
|
// XZipFileAccess
|
2015-10-23 14:59:15 +02:00
|
|
|
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getStreamByPattern( const OUString& aPattern ) throw (css::container::NoSuchElementException, css::io::IOException, css::uno::RuntimeException, css::packages::WrongPasswordException, css::packages::zip::ZipException, std::exception) override;
|
2004-05-18 16:22:25 +00:00
|
|
|
|
|
|
|
// XComponent
|
2015-10-23 14:59:15 +02:00
|
|
|
virtual void SAL_CALL dispose( ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) throw (css::uno::RuntimeException, std::exception) override;
|
2004-05-18 16:22:25 +00:00
|
|
|
|
|
|
|
// XServiceInfo
|
2015-10-23 14:59:15 +02:00
|
|
|
virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException, std::exception) override;
|
|
|
|
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException, std::exception) override;
|
2004-05-18 16:22:25 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-10-27 12:45:03 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|