merge the formfield patch from ooo-build
[ooovba.git] / forms / source / component / cachedrowset.hxx
blobe8be180c5958d07f6dec9fa5d546a28bcb93b9f8
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: cachedrowset.hxx,v $
10 * $Revision: 1.4 $
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 CACHEDROWSET_HXX
32 #define CACHEDROWSET_HXX
34 /** === begin UNO includes === **/
35 #include <com/sun/star/sdbc/XResultSet.hpp>
36 #include <com/sun/star/sdbc/XConnection.hpp>
37 /** === end UNO includes === **/
39 #include <comphelper/componentcontext.hxx>
40 #include <unotools/sharedunocomponent.hxx>
42 #include <memory>
44 //........................................................................
45 namespace frm
47 //........................................................................
49 struct CachedRowSet_Data;
50 //====================================================================
51 //= CachedRowSet
52 //====================================================================
53 /** caches a result set obtained from a SQL statement
55 class CachedRowSet
57 public:
58 CachedRowSet( const ::comphelper::ComponentContext& _rContext );
59 ~CachedRowSet();
61 public:
62 /** executes the statement
64 @return
65 the result set produced by the statement. The caller takes ownership of the
66 given object.
68 @throws ::com::sun::star::sdbc::SQLException
69 if such an exception is thrown when executing the statement
71 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >
72 execute();
74 /// determines whether the row set properties are dirty, i.e. have changed since the last call to execute
75 bool isDirty() const;
77 /// disposes the instance and frees all associated resources
78 void dispose();
80 /** sets the command of a query as command to be executed
82 A connection must have been set before.
84 @throws Exception
86 void setCommandFromQuery ( const ::rtl::OUString& _rQueryName );
88 void setCommand ( const ::rtl::OUString& _rCommand );
89 void setEscapeProcessing ( const sal_Bool _bEscapeProcessing );
90 void setConnection ( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection );
92 private:
93 ::std::auto_ptr< CachedRowSet_Data > m_pData;
96 //........................................................................
97 } // namespace frm
98 //........................................................................
100 #endif // CACHEDROWSET_HXX