update dev300-m58
[ooovba.git] / xmlhelp / source / cxxhelp / provider / inputstream.hxx
blob6c31cd9fa6cd179de126015da2a0074db357cf37
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: inputstream.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _INPUSTREAM_HXX_
32 #define _INPUSTREAM_HXX_
34 #include <rtl/ustring.hxx>
35 #include <osl/file.hxx>
36 #include <cppuhelper/weak.hxx>
37 #include <com/sun/star/uno/XInterface.hpp>
38 #include <com/sun/star/io/XSeekable.hpp>
39 #include <com/sun/star/io/XInputStream.hpp>
40 #include <com/sun/star/ucb/XContentProvider.hpp>
43 namespace chelp {
45 // forward declaration
47 class XInputStream_impl
48 : public cppu::OWeakObject,
49 public com::sun::star::io::XInputStream,
50 public com::sun::star::io::XSeekable
52 public:
54 XInputStream_impl( const rtl::OUString& aUncPath );
56 virtual ~XInputStream_impl();
58 /**
59 * Returns an error code as given by filerror.hxx
62 bool SAL_CALL CtorSuccess();
64 virtual com::sun::star::uno::Any SAL_CALL
65 queryInterface(
66 const com::sun::star::uno::Type& rType )
67 throw( com::sun::star::uno::RuntimeException);
69 virtual void SAL_CALL
70 acquire(
71 void )
72 throw();
74 virtual void SAL_CALL
75 release(
76 void )
77 throw();
79 virtual sal_Int32 SAL_CALL
80 readBytes(
81 com::sun::star::uno::Sequence< sal_Int8 >& aData,
82 sal_Int32 nBytesToRead )
83 throw( com::sun::star::io::NotConnectedException,
84 com::sun::star::io::BufferSizeExceededException,
85 com::sun::star::io::IOException,
86 com::sun::star::uno::RuntimeException);
88 virtual sal_Int32 SAL_CALL
89 readSomeBytes(
90 com::sun::star::uno::Sequence< sal_Int8 >& aData,
91 sal_Int32 nMaxBytesToRead )
92 throw( com::sun::star::io::NotConnectedException,
93 com::sun::star::io::BufferSizeExceededException,
94 com::sun::star::io::IOException,
95 com::sun::star::uno::RuntimeException);
97 virtual void SAL_CALL
98 skipBytes(
99 sal_Int32 nBytesToSkip )
100 throw( com::sun::star::io::NotConnectedException,
101 com::sun::star::io::BufferSizeExceededException,
102 com::sun::star::io::IOException,
103 com::sun::star::uno::RuntimeException );
105 virtual sal_Int32 SAL_CALL
106 available(
107 void )
108 throw( com::sun::star::io::NotConnectedException,
109 com::sun::star::io::IOException,
110 com::sun::star::uno::RuntimeException );
112 virtual void SAL_CALL
113 closeInput(
114 void )
115 throw( com::sun::star::io::NotConnectedException,
116 com::sun::star::io::IOException,
117 com::sun::star::uno::RuntimeException );
119 virtual void SAL_CALL
120 seek(
121 sal_Int64 location )
122 throw( com::sun::star::lang::IllegalArgumentException,
123 com::sun::star::io::IOException,
124 com::sun::star::uno::RuntimeException );
126 virtual sal_Int64 SAL_CALL
127 getPosition(
128 void )
129 throw( com::sun::star::io::IOException,
130 com::sun::star::uno::RuntimeException );
132 virtual sal_Int64 SAL_CALL
133 getLength(
134 void )
135 throw( com::sun::star::io::IOException,
136 com::sun::star::uno::RuntimeException );
138 private:
140 bool m_bIsOpen;
141 osl::File m_aFile;
145 } // end namespace XInputStream_impl
147 #endif