LibreOffice Module svl (master) 1
ostreamcontainer.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_SVL_SOURCE_FSSTOR_OSTREAMCONTAINER_HXX
21#define INCLUDED_SVL_SOURCE_FSSTOR_OSTREAMCONTAINER_HXX
22
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>
33#include <mutex>
34
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
43{
44 std::mutex m_aMutex;
45
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;
52
56
58 css::uno::Sequence<css::uno::Type> m_aTypes;
59
60public:
61 explicit OFSStreamContainer( const css::uno::Reference < css::io::XStream >& xStream );
62 virtual ~OFSStreamContainer() override;
63
64 // XInterface
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;
68
69 // XTypeProvider
70 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
71 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
72
73 // XStream
74 virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getInputStream( ) override;
75 virtual css::uno::Reference< css::io::XOutputStream > SAL_CALL getOutputStream( ) override;
76
77 // XComponent
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;
81
82 // XSeekable
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;
86
87 // XInputStream
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;
93
94 // XOutputStream
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;
98
99 // XTruncate
100 virtual void SAL_CALL truncate() override;
101
102 // XAsyncOutputMonitor
103 virtual void SAL_CALL waitForCompletion( ) override;
104
105};
106
107#endif
108
109/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::io::XAsyncOutputMonitor > m_xAsyncOutputMonitor
css::uno::Reference< css::io::XOutputStream > m_xOutputStream
virtual void SAL_CALL closeInput() override
OFSStreamContainer(const css::uno::Reference< css::io::XStream > &xStream)
virtual void SAL_CALL release() noexcept override
virtual css::uno::Reference< css::io::XOutputStream > SAL_CALL getOutputStream() override
::comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > m_aListenersContainer
virtual sal_Int64 SAL_CALL getPosition() override
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getInputStream() override
virtual void SAL_CALL flush() override
css::uno::Reference< css::io::XInputStream > m_xInputStream
virtual sal_Int32 SAL_CALL available() override
virtual ~OFSStreamContainer() override
virtual sal_Int32 SAL_CALL readSomeBytes(css::uno::Sequence< sal_Int8 > &aData, sal_Int32 nMaxBytesToRead) override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual void SAL_CALL acquire() noexcept override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual void SAL_CALL writeBytes(const css::uno::Sequence< sal_Int8 > &aData) override
virtual void SAL_CALL dispose() override
css::uno::Reference< css::io::XTruncate > m_xTruncate
virtual void SAL_CALL closeOutput() override
virtual sal_Int64 SAL_CALL getLength() override
css::uno::Reference< css::io::XSeekable > m_xSeekable
virtual void SAL_CALL waitForCompletion() override
virtual void SAL_CALL skipBytes(sal_Int32 nBytesToSkip) override
virtual void SAL_CALL truncate() override
virtual void SAL_CALL seek(sal_Int64 location) override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
css::uno::Sequence< css::uno::Type > m_aTypes
css::uno::Reference< css::io::XStream > m_xStream
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual sal_Int32 SAL_CALL readBytes(css::uno::Sequence< sal_Int8 > &aData, sal_Int32 nBytesToRead) override
Type
signed char sal_Int8