merge the formfield patch from ooo-build
[ooovba.git] / ucb / source / ucp / file / filrec.hxx
blob40d98aa4373d0b1e8c16ab6b25451715e490a5a8
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: filrec.hxx,v $
10 * $Revision: 1.3.22.1 $
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 _FILREC_HXX_
32 #define _FILREC_HXX_
34 #include <osl/file.hxx>
36 namespace fileaccess {
38 class ReconnectingFile
40 ::osl::File m_aFile;
42 sal_uInt32 m_nFlags;
43 sal_Bool m_bFlagsSet;
45 sal_Bool m_bDisconnect;
47 ReconnectingFile( ReconnectingFile& );
49 ReconnectingFile& operator=( ReconnectingFile& );
51 public:
53 ReconnectingFile( const ::rtl::OUString& aFileURL )
54 : m_aFile( aFileURL )
55 , m_nFlags( 0 )
56 , m_bFlagsSet( sal_False )
57 , m_bDisconnect( sal_False )
60 ~ReconnectingFile()
62 close();
65 void disconnect();
66 sal_Bool reconnect();
68 ::osl::FileBase::RC open( sal_uInt32 uFlags );
70 ::osl::FileBase::RC close();
72 ::osl::FileBase::RC setPos( sal_uInt32 uHow, sal_Int64 uPos );
74 ::osl::FileBase::RC getPos( sal_uInt64& uPos );
76 ::osl::FileBase::RC setSize( sal_uInt64 uSize );
78 ::osl::FileBase::RC getSize( sal_uInt64 &rSize );
80 ::osl::FileBase::RC read( void *pBuffer, sal_uInt64 uBytesRequested, sal_uInt64& rBytesRead );
82 ::osl::FileBase::RC write(const void *pBuffer, sal_uInt64 uBytesToWrite, sal_uInt64& rBytesWritten);
84 ::osl::FileBase::RC sync() const;
87 } // namespace fileaccess
88 #endif // _FILREC_HXX_