merge the formfield patch from ooo-build
[ooovba.git] / package / source / zippackage / wrapstreamforshare.hxx
blob16373b1ed4344703a471c02de64e2d4b128934fc
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: wrapstreamforshare.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _WRAPSTREAMFORSHARE_HXX_
32 #define _WRAPSTREAMFORSHARE_HXX_
34 #include <com/sun/star/io/XInputStream.hpp>
35 #include <com/sun/star/io/XSeekable.hpp>
36 #include <cppuhelper/implbase2.hxx>
38 #include <mutexholder.hxx>
40 class WrapStreamForShare : public cppu::WeakImplHelper2 < ::com::sun::star::io::XInputStream
41 , ::com::sun::star::io::XSeekable >
43 protected:
44 SotMutexHolderRef m_rMutexRef;
45 ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > m_xInStream;
46 ::com::sun::star::uno::Reference < ::com::sun::star::io::XSeekable > m_xSeekable;
48 sal_Int64 m_nCurPos;
50 public:
51 WrapStreamForShare( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream,
52 const SotMutexHolderRef& rMutexRef );
53 virtual ~WrapStreamForShare();
55 // XInputStream
56 virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead )
57 throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
58 virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead )
59 throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
60 virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip )
61 throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
62 virtual sal_Int32 SAL_CALL available( )
63 throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
64 virtual void SAL_CALL closeInput( )
65 throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
68 //XSeekable
69 virtual void SAL_CALL seek( sal_Int64 location ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
70 virtual sal_Int64 SAL_CALL getPosition() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
71 virtual sal_Int64 SAL_CALL getLength() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
75 #endif