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_OSTREAMCONTAINER_HXX
21 #define INCLUDED_SVL_SOURCE_FSSTOR_OSTREAMCONTAINER_HXX
23 #include <com/sun/star/lang/XTypeProvider.hpp>
24 #include <com/sun/star/embed/XExtendedStorageStream.hpp>
25 #include <com/sun/star/io/XSeekable.hpp>
26 #include <com/sun/star/io/XTruncate.hpp>
27 #include <com/sun/star/io/XInputStream.hpp>
28 #include <com/sun/star/io/XOutputStream.hpp>
29 #include <com/sun/star/io/XStream.hpp>
30 #include <com/sun/star/io/XAsyncOutputMonitor.hpp>
31 #include <cppuhelper/weak.hxx>
32 #include <comphelper/interfacecontainer4.hxx>
35 class OFSStreamContainer
: public cppu::OWeakObject
,
36 public css::lang::XTypeProvider
,
37 public css::embed::XExtendedStorageStream
,
38 public css::io::XSeekable
,
39 public css::io::XInputStream
,
40 public css::io::XOutputStream
,
41 public css::io::XTruncate
,
42 public css::io::XAsyncOutputMonitor
46 css::uno::Reference
< css::io::XStream
> m_xStream
;
47 css::uno::Reference
< css::io::XSeekable
> m_xSeekable
;
48 css::uno::Reference
< css::io::XInputStream
> m_xInputStream
;
49 css::uno::Reference
< css::io::XOutputStream
> m_xOutputStream
;
50 css::uno::Reference
< css::io::XTruncate
> m_xTruncate
;
51 css::uno::Reference
< css::io::XAsyncOutputMonitor
> m_xAsyncOutputMonitor
;
57 ::comphelper::OInterfaceContainerHelper4
<css::lang::XEventListener
> m_aListenersContainer
; // list of listeners
58 css::uno::Sequence
<css::uno::Type
> m_aTypes
;
61 explicit OFSStreamContainer( const css::uno::Reference
< css::io::XStream
>& xStream
);
62 virtual ~OFSStreamContainer() override
;
65 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
;
66 virtual void SAL_CALL
acquire() noexcept override
;
67 virtual void SAL_CALL
release() noexcept override
;
70 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
71 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
74 virtual css::uno::Reference
< css::io::XInputStream
> SAL_CALL
getInputStream( ) override
;
75 virtual css::uno::Reference
< css::io::XOutputStream
> SAL_CALL
getOutputStream( ) override
;
78 virtual void SAL_CALL
dispose() override
;
79 virtual void SAL_CALL
addEventListener( const css::uno::Reference
< css::lang::XEventListener
>& xListener
) override
;
80 virtual void SAL_CALL
removeEventListener( const css::uno::Reference
< css::lang::XEventListener
>& aListener
) override
;
83 virtual void SAL_CALL
seek( sal_Int64 location
) override
;
84 virtual sal_Int64 SAL_CALL
getPosition() override
;
85 virtual sal_Int64 SAL_CALL
getLength() override
;
88 virtual sal_Int32 SAL_CALL
readBytes( css::uno::Sequence
< sal_Int8
>& aData
, sal_Int32 nBytesToRead
) override
;
89 virtual sal_Int32 SAL_CALL
readSomeBytes( css::uno::Sequence
< sal_Int8
>& aData
, sal_Int32 nMaxBytesToRead
) override
;
90 virtual void SAL_CALL
skipBytes( sal_Int32 nBytesToSkip
) override
;
91 virtual sal_Int32 SAL_CALL
available( ) override
;
92 virtual void SAL_CALL
closeInput( ) override
;
95 virtual void SAL_CALL
writeBytes( const css::uno::Sequence
< sal_Int8
>& aData
) override
;
96 virtual void SAL_CALL
flush( ) override
;
97 virtual void SAL_CALL
closeOutput( ) override
;
100 virtual void SAL_CALL
truncate() override
;
102 // XAsyncOutputMonitor
103 virtual void SAL_CALL
waitForCompletion( ) override
;
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */