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_SVL_SOURCE_FSSTOR_OINPUTSTREAMCONTAINER_HXX
21 #define INCLUDED_SVL_SOURCE_FSSTOR_OINPUTSTREAMCONTAINER_HXX
23 #include <com/sun/star/io/XInputStream.hpp>
24 #include <com/sun/star/embed/XExtendedStorageStream.hpp>
25 #include <com/sun/star/io/XSeekable.hpp>
28 #include <cppuhelper/implbase2.hxx>
29 #include <cppuhelper/interfacecontainer.h>
31 #include <osl/mutex.hxx>
33 class OFSInputStreamContainer
: public cppu::WeakImplHelper2
< ::com::sun::star::io::XInputStream
34 ,::com::sun::star::embed::XExtendedStorageStream
>
35 , public ::com::sun::star::io::XSeekable
37 ::osl::Mutex m_aMutex
;
39 ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
> m_xInputStream
;
40 ::com::sun::star::uno::Reference
< ::com::sun::star::io::XSeekable
> m_xSeekable
;
46 ::cppu::OInterfaceContainerHelper
* m_pListenersContainer
; // list of listeners
49 OFSInputStreamContainer( const ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
>& xStream
);
51 virtual ~OFSInputStreamContainer();
53 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes() throw (::com::sun::star::uno::RuntimeException
);
54 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& rType
) throw( ::com::sun::star::uno::RuntimeException
);
55 virtual void SAL_CALL
acquire() throw();
56 virtual void SAL_CALL
release() throw();
59 virtual sal_Int32 SAL_CALL
readBytes( ::com::sun::star::uno::Sequence
< sal_Int8
>& aData
, sal_Int32 nBytesToRead
)
60 throw(::com::sun::star::io::NotConnectedException
, ::com::sun::star::io::BufferSizeExceededException
, ::com::sun::star::io::IOException
, ::com::sun::star::uno::RuntimeException
);
61 virtual sal_Int32 SAL_CALL
readSomeBytes( ::com::sun::star::uno::Sequence
< sal_Int8
>& aData
, sal_Int32 nMaxBytesToRead
)
62 throw(::com::sun::star::io::NotConnectedException
, ::com::sun::star::io::BufferSizeExceededException
, ::com::sun::star::io::IOException
, ::com::sun::star::uno::RuntimeException
);
63 virtual void SAL_CALL
skipBytes( sal_Int32 nBytesToSkip
)
64 throw(::com::sun::star::io::NotConnectedException
, ::com::sun::star::io::BufferSizeExceededException
, ::com::sun::star::io::IOException
, ::com::sun::star::uno::RuntimeException
);
65 virtual sal_Int32 SAL_CALL
available( )
66 throw(::com::sun::star::io::NotConnectedException
, ::com::sun::star::io::IOException
, ::com::sun::star::uno::RuntimeException
);
67 virtual void SAL_CALL
closeInput( )
68 throw(::com::sun::star::io::NotConnectedException
, ::com::sun::star::io::IOException
, ::com::sun::star::uno::RuntimeException
);
71 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
> SAL_CALL
getInputStream( ) throw (::com::sun::star::uno::RuntimeException
);
72 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::io::XOutputStream
> SAL_CALL
getOutputStream( ) throw (::com::sun::star::uno::RuntimeException
);
75 virtual void SAL_CALL
seek( sal_Int64 location
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::io::IOException
, ::com::sun::star::uno::RuntimeException
);
76 virtual sal_Int64 SAL_CALL
getPosition() throw (::com::sun::star::io::IOException
, ::com::sun::star::uno::RuntimeException
);
77 virtual sal_Int64 SAL_CALL
getLength() throw (::com::sun::star::io::IOException
, ::com::sun::star::uno::RuntimeException
);
80 virtual void SAL_CALL
dispose() throw (::com::sun::star::uno::RuntimeException
);
81 virtual void SAL_CALL
addEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
82 virtual void SAL_CALL
removeEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& aListener
) throw (::com::sun::star::uno::RuntimeException
);
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */