diff options
author | Oliver Bolte <obo@openoffice.org> | 2006-10-13 10:27:44 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2006-10-13 10:27:44 +0000 |
commit | ed0a06d4572e0569ec96fea473967f5755895dd0 (patch) | |
tree | e2e3f8c6916ca3905e4a6b6c22b81e5b82eee783 /svtools/source/fsstor | |
parent | d3a87b60d56d31c2b58df9b4d7be076e3d063799 (diff) |
INTEGRATION: CWS opofxmlstorage (1.1.2); FILE ADDED
2006/05/15 14:32:10 mav 1.1.2.1: #i65306# hierarchical access
Diffstat (limited to 'svtools/source/fsstor')
-rw-r--r-- | svtools/source/fsstor/ostreamcontainer.hxx | 161 |
1 files changed, 161 insertions, 0 deletions
diff --git a/svtools/source/fsstor/ostreamcontainer.hxx b/svtools/source/fsstor/ostreamcontainer.hxx new file mode 100644 index 000000000000..68d98979b1c2 --- /dev/null +++ b/svtools/source/fsstor/ostreamcontainer.hxx @@ -0,0 +1,161 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ostreamcontainer.hxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: obo $ $Date: 2006-10-13 11:27:44 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef _OSTREAMCONTAINER_HXX_ +#define _OSTREAMCONTAINER_HXX_ + +#ifndef _COM_SUN_STAR_UNO_XINTERFACE_HPP_ +#include <com/sun/star/uno/XInterface.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_ +#include <com/sun/star/lang/XTypeProvider.hpp> +#endif +#ifndef _COM_SUN_STAR_EMBED_XEXTENDEDSTORAGESTREAM_HPP_ +#include <com/sun/star/embed/XExtendedStorageStream.hpp> +#endif +#ifndef _COM_SUN_STAR_IO_XSEEKABLE_HPP_ +#include <com/sun/star/io/XSeekable.hpp> +#endif +#ifndef _COM_SUN_STAR_IO_XTRUNCATE_HPP_ +#include <com/sun/star/io/XTruncate.hpp> +#endif +#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HPP_ +#include <com/sun/star/io/XInputStream.hpp> +#endif +#ifndef _COM_SUN_STAR_IO_XOUTPUTSTREAM_HPP_ +#include <com/sun/star/io/XOutputStream.hpp> +#endif +#ifndef _COM_SUN_STAR_IO_XSTREAM_HPP_ +#include <com/sun/star/io/XStream.hpp> +#endif +#ifndef _COM_SUN_STAR_IO_XASYNCOUTPUTMONITOR_HPP_ +#include "com/sun/star/io/XAsyncOutputMonitor.hpp" +#endif + +#ifndef _CPPUHELPER_WEAK_HXX_ +#include <cppuhelper/weak.hxx> +#endif +#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ +#include <cppuhelper/typeprovider.hxx> +#endif +#ifndef _CPPUHELPER_INTERFACECONTAINER_H_ +#include <cppuhelper/interfacecontainer.h> +#endif + +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> +#endif + +class OFSStreamContainer : public cppu::OWeakObject, + public ::com::sun::star::lang::XTypeProvider, + public ::com::sun::star::embed::XExtendedStorageStream, + public ::com::sun::star::io::XSeekable, + public ::com::sun::star::io::XInputStream, + public ::com::sun::star::io::XOutputStream, + public ::com::sun::star::io::XTruncate, + public ::com::sun::star::io::XAsyncOutputMonitor +{ + ::osl::Mutex m_aMutex; + + ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xStream; + ::com::sun::star::uno::Reference< ::com::sun::star::io::XSeekable > m_xSeekable; + ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream; + ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > m_xOutputStream; + ::com::sun::star::uno::Reference< ::com::sun::star::io::XTruncate > m_xTruncate; + ::com::sun::star::uno::Reference< ::com::sun::star::io::XAsyncOutputMonitor > m_xAsyncOutputMonitor; + + sal_Bool m_bDisposed; + sal_Bool m_bInputClosed; + sal_Bool m_bOutputClosed; + + ::cppu::OInterfaceContainerHelper* m_pListenersContainer; // list of listeners + ::cppu::OTypeCollection* m_pTypeCollection; + +public: + OFSStreamContainer( const ::com::sun::star::uno::Reference < ::com::sun::star::io::XStream >& xStream ); + virtual ~OFSStreamContainer(); + + // XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL acquire() throw(); + virtual void SAL_CALL release() throw(); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw( ::com::sun::star::uno::RuntimeException ); + + // XStream + virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > SAL_CALL getOutputStream( ) throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + + // XSeekable + virtual void SAL_CALL seek( sal_Int64 location ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int64 SAL_CALL getPosition() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int64 SAL_CALL getLength() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + + // XInputStream + virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) + throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) + throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL available( ) + throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL closeInput( ) + throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + + // XOutputStream + virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL flush( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL closeOutput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + + // XTruncate + virtual void SAL_CALL truncate() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + + // XAsyncOutputMonitor + virtual void SAL_CALL waitForCompletion( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + +}; + +#endif + |