xref: /aoo4110/main/svl/inc/svl/instrm.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SVTOOLS_INSTRM_HXX
25 #define SVTOOLS_INSTRM_HXX
26 
27 #include "svl/svldllapi.h"
28 #include <com/sun/star/uno/Reference.h>
29 #include <tools/stream.hxx>
30 
31 namespace com { namespace sun { namespace star { namespace io {
32 	class XInputStream;
33 	class XSeekable;
34 } } } }
35 
36 class SvDataPipe_Impl;
37 
38 //============================================================================
39 class SVL_DLLPUBLIC SvInputStream: public SvStream
40 {
41 	com::sun::star::uno::Reference< com::sun::star::io::XInputStream >
42 	    m_xStream;
43 	com::sun::star::uno::Reference< com::sun::star::io::XSeekable >
44 	    m_xSeekable;
45 	SvDataPipe_Impl * m_pPipe;
46 	sal_uLong m_nSeekedFrom;
47 
48 	SVL_DLLPRIVATE bool open();
49 
50 	SVL_DLLPRIVATE virtual sal_uLong GetData(void * pData, sal_uLong nSize);
51 
52 	SVL_DLLPRIVATE virtual sal_uLong PutData(void const *, sal_uLong);
53 
54 	SVL_DLLPRIVATE virtual sal_uLong SeekPos(sal_uLong nPos);
55 
56 	SVL_DLLPRIVATE virtual void FlushData();
57 
58 	SVL_DLLPRIVATE virtual void SetSize(sal_uLong);
59 
60 public:
61 	SvInputStream(
62 		com::sun::star::uno::Reference< com::sun::star::io::XInputStream >
63 		        const &
64 		    rTheStream);
65 
66 	virtual ~SvInputStream();
67 
68 	virtual sal_uInt16 IsA() const;
69 
70 	virtual void AddMark(sal_uLong nPos);
71 
72 	virtual void RemoveMark(sal_uLong nPos);
73 };
74 
75 #endif // SVTOOLS_INSTRM_HXX
76 
77