1 #ifndef WPXSVSTREAM_H
2 #define WPXSVSTREAM_H
3 
4 #include <sot/storage.hxx>
5 #include <com/sun/star/io/XInputStream.hpp>
6 
7 #ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_H_
8 #include <com/sun/star/io/XSeekable.hpp>
9 #endif
10 
11 
12 #if defined _MSC_VER
13 #pragma warning( push, 1 )
14 #endif
15 #include <libwpd/WPXStream.h>
16 #if defined _MSC_VER
17 #pragma warning( pop )
18 #endif
19 
20 class WPXSvInputStream : public WPXInputStream
21 {
22 public:
23 	WPXSvInputStream( ::com::sun::star::uno::Reference<
24 					  ::com::sun::star::io::XInputStream > xStream );
25 	virtual ~WPXSvInputStream();
26 
27 	virtual bool isOLEStream();
28 	virtual WPXInputStream * getDocumentOLEStream();
29 	virtual WPXInputStream * getDocumentOLEStream(const char *name);
30 
31 	virtual const uint8_t *read(size_t numBytes, size_t &numBytesRead);
32 	virtual int seek(long offset, WPX_SEEK_TYPE seekType);
33 	virtual long tell();
34 	virtual bool atEOS();
35 
36 private:
37 	SotStorageRef       mxChildStorage;
38 	SotStorageStreamRef mxChildStream;
39 	::com::sun::star::uno::Reference<
40 			::com::sun::star::io::XInputStream > mxStream;
41 	::com::sun::star::uno::Reference<
42 			::com::sun::star::io::XSeekable > mxSeekable;
43 	::com::sun::star::uno::Sequence< sal_Int8 > maData;
44 	sal_Int64 mnLength;
45 };
46 
47 #endif
48