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_PACKAGE_SOURCE_XSTOR_OCOMPINSTREAM_HXX
21 #define INCLUDED_PACKAGE_SOURCE_XSTOR_OCOMPINSTREAM_HXX
23 #include <com/sun/star/io/XInputStream.hpp>
24 #include <com/sun/star/io/XStream.hpp>
25 #include <com/sun/star/lang/XComponent.hpp>
26 #include <com/sun/star/beans/XPropertySet.hpp>
27 #include <com/sun/star/beans/PropertyValue.hpp>
28 #include <com/sun/star/embed/XExtendedStorageStream.hpp>
29 #include <com/sun/star/embed/XRelationshipAccess.hpp>
30 #include <cppuhelper/implbase.hxx>
31 #include <comphelper/interfacecontainer2.hxx>
32 #include <comphelper/refcountedmutex.hxx>
33 #include <rtl/ref.hxx>
37 struct OWriteStream_Impl
;
39 class OInputCompStream
: public cppu::WeakImplHelper
< css::io::XInputStream
40 ,css::embed::XExtendedStorageStream
41 ,css::embed::XRelationshipAccess
42 ,css::beans::XPropertySet
>
45 OWriteStream_Impl
* m_pImpl
;
46 rtl::Reference
<comphelper::RefCountedMutex
> m_xMutex
;
47 css::uno::Reference
< css::io::XInputStream
> m_xStream
;
48 std::unique_ptr
<::comphelper::OInterfaceContainerHelper2
> m_pInterfaceContainer
;
49 css::uno::Sequence
< css::beans::PropertyValue
> m_aProperties
;
51 sal_Int32 m_nStorageType
;
54 OInputCompStream( OWriteStream_Impl
& pImpl
,
55 css::uno::Reference
< css::io::XInputStream
> const & xStream
,
56 const css::uno::Sequence
< css::beans::PropertyValue
>& aProps
,
57 sal_Int32 nStorageType
);
59 OInputCompStream( css::uno::Reference
< css::io::XInputStream
> const & xStream
,
60 const css::uno::Sequence
< css::beans::PropertyValue
>& aProps
,
61 sal_Int32 nStorageType
);
63 virtual ~OInputCompStream() override
;
65 void InternalDispose();
68 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
;
71 virtual sal_Int32 SAL_CALL
readBytes( css::uno::Sequence
< sal_Int8
>& aData
, sal_Int32 nBytesToRead
) override
;
72 virtual sal_Int32 SAL_CALL
readSomeBytes( css::uno::Sequence
< sal_Int8
>& aData
, sal_Int32 nMaxBytesToRead
) override
;
73 virtual void SAL_CALL
skipBytes( sal_Int32 nBytesToSkip
) override
;
74 virtual sal_Int32 SAL_CALL
available( ) override
;
75 virtual void SAL_CALL
closeInput( ) override
;
78 virtual css::uno::Reference
< css::io::XInputStream
> SAL_CALL
getInputStream( ) override
;
79 virtual css::uno::Reference
< css::io::XOutputStream
> SAL_CALL
getOutputStream( ) override
;
82 virtual void SAL_CALL
dispose( ) override
;
83 virtual void SAL_CALL
addEventListener( const css::uno::Reference
< css::lang::XEventListener
>& xListener
) override
;
84 virtual void SAL_CALL
removeEventListener( const css::uno::Reference
< css::lang::XEventListener
>& aListener
) override
;
87 virtual sal_Bool SAL_CALL
hasByID( const OUString
& sID
) override
;
88 virtual OUString SAL_CALL
getTargetByID( const OUString
& sID
) override
;
89 virtual OUString SAL_CALL
getTypeByID( const OUString
& sID
) override
;
90 virtual css::uno::Sequence
< css::beans::StringPair
> SAL_CALL
getRelationshipByID( const OUString
& sID
) override
;
91 virtual css::uno::Sequence
< css::uno::Sequence
< css::beans::StringPair
> > SAL_CALL
getRelationshipsByType( const OUString
& sType
) override
;
92 virtual css::uno::Sequence
< css::uno::Sequence
< css::beans::StringPair
> > SAL_CALL
getAllRelationships( ) override
;
93 virtual void SAL_CALL
insertRelationshipByID( const OUString
& sID
, const css::uno::Sequence
< css::beans::StringPair
>& aEntry
, sal_Bool bReplace
) override
;
94 virtual void SAL_CALL
removeRelationshipByID( const OUString
& sID
) override
;
95 virtual void SAL_CALL
insertRelationships( const css::uno::Sequence
< css::uno::Sequence
< css::beans::StringPair
> >& aEntries
, sal_Bool bReplace
) override
;
96 virtual void SAL_CALL
clearRelationships( ) override
;
99 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo() override
;
100 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
) override
;
101 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
102 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
103 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) override
;
104 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
105 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) override
;
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */