Bump for 3.6-28
[LibreOffice.git] / ucb / source / ucp / file / filinpstr.hxx
blob69c996ae8b54f701819c8e867c89595216418bcd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef _FILINPSTR_HXX_
29 #define _FILINPSTR_HXX_
31 #include <rtl/ustring.hxx>
32 #include <cppuhelper/weak.hxx>
33 #include <ucbhelper/macros.hxx>
34 #include <com/sun/star/uno/XInterface.hpp>
35 #include <com/sun/star/lang/XTypeProvider.hpp>
36 #include <com/sun/star/io/XSeekable.hpp>
37 #include <com/sun/star/io/XInputStream.hpp>
38 #include <com/sun/star/ucb/XContentProvider.hpp>
40 #include "filrec.hxx"
42 namespace fileaccess {
44 // forward declaration
46 class shell;
49 class XInputStream_impl
50 : public cppu::OWeakObject,
51 public com::sun::star::lang::XTypeProvider,
52 public com::sun::star::io::XInputStream,
53 public com::sun::star::io::XSeekable
55 public:
57 XInputStream_impl( shell* pMyShell,const rtl::OUString& aUncPath, sal_Bool bLock );
59 virtual ~XInputStream_impl();
61 /**
62 * Returns an error code as given by filerror.hxx
65 sal_Int32 SAL_CALL CtorSuccess();
66 sal_Int32 SAL_CALL getMinorError();
69 // XTypeProvider
71 XTYPEPROVIDER_DECL()
73 virtual com::sun::star::uno::Any SAL_CALL
74 queryInterface(
75 const com::sun::star::uno::Type& rType )
76 throw( com::sun::star::uno::RuntimeException);
78 virtual void SAL_CALL
79 acquire(
80 void )
81 throw();
83 virtual void SAL_CALL
84 release(
85 void )
86 throw();
88 virtual sal_Int32 SAL_CALL
89 readBytes(
90 com::sun::star::uno::Sequence< sal_Int8 >& aData,
91 sal_Int32 nBytesToRead )
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 sal_Int32 SAL_CALL
98 readSomeBytes(
99 com::sun::star::uno::Sequence< sal_Int8 >& aData,
100 sal_Int32 nMaxBytesToRead )
101 throw( com::sun::star::io::NotConnectedException,
102 com::sun::star::io::BufferSizeExceededException,
103 com::sun::star::io::IOException,
104 com::sun::star::uno::RuntimeException);
106 virtual void SAL_CALL
107 skipBytes(
108 sal_Int32 nBytesToSkip )
109 throw( com::sun::star::io::NotConnectedException,
110 com::sun::star::io::BufferSizeExceededException,
111 com::sun::star::io::IOException,
112 com::sun::star::uno::RuntimeException );
114 virtual sal_Int32 SAL_CALL
115 available(
116 void )
117 throw( com::sun::star::io::NotConnectedException,
118 com::sun::star::io::IOException,
119 com::sun::star::uno::RuntimeException );
121 virtual void SAL_CALL
122 closeInput(
123 void )
124 throw( com::sun::star::io::NotConnectedException,
125 com::sun::star::io::IOException,
126 com::sun::star::uno::RuntimeException );
128 virtual void SAL_CALL
129 seek(
130 sal_Int64 location )
131 throw( com::sun::star::lang::IllegalArgumentException,
132 com::sun::star::io::IOException,
133 com::sun::star::uno::RuntimeException );
135 virtual sal_Int64 SAL_CALL
136 getPosition(
137 void )
138 throw( com::sun::star::io::IOException,
139 com::sun::star::uno::RuntimeException );
141 virtual sal_Int64 SAL_CALL
142 getLength(
143 void )
144 throw( com::sun::star::io::IOException,
145 com::sun::star::uno::RuntimeException );
147 private:
149 shell* m_pMyShell;
150 com::sun::star::uno::Reference<
151 com::sun::star::ucb::XContentProvider > m_xProvider;
152 sal_Bool m_nIsOpen;
154 sal_Bool m_bLock;
156 ReconnectingFile m_aFile;
158 sal_Int32 m_nErrorCode;
159 sal_Int32 m_nMinorErrorCode;
163 } // end namespace XInputStream_impl
165 #endif
167 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */