xref: /trunk/main/connectivity/source/inc/calc/CResultSet.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _CONNECTIVITY_CALC_RESULTSET_HXX_
28 #define _CONNECTIVITY_CALC_RESULTSET_HXX_
29 
30 #include "file/FResultSet.hxx"
31 #include <com/sun/star/sdbcx/XRowLocate.hpp>
32 #include <com/sun/star/sdbcx/XDeleteRows.hpp>
33 #include <cppuhelper/implbase2.hxx>
34 
35 namespace connectivity
36 {
37     namespace calc
38     {
39         class OCalcResultSet;
40         // these typedef's are only necessary for the compiler
41         typedef ::cppu::ImplHelper2<  ::com::sun::star::sdbcx::XRowLocate,
42                                       ::com::sun::star::sdbcx::XDeleteRows> OCalcResultSet_BASE;
43         typedef file::OResultSet                                            OCalcResultSet_BASE2;
44         typedef ::comphelper::OPropertyArrayUsageHelper<OCalcResultSet> OCalcResultSet_BASE3;
45 
46 
47         class OCalcResultSet : public OCalcResultSet_BASE2,
48                                 public OCalcResultSet_BASE,
49                                 public OCalcResultSet_BASE3
50         {
51             sal_Bool m_bBookmarkable;
52         protected:
53             // OPropertyArrayUsageHelper
54             virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
55             // OPropertySetHelper
56             virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
57             virtual sal_Bool fillIndexValues(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier> &_xIndex);
58         public:
59             DECLARE_SERVICE_INFO();
60 
61             OCalcResultSet( file::OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator&   _aSQLIterator);
62 
63         private:
64             // XInterface
65             virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
66             virtual void SAL_CALL acquire() throw();
67             virtual void SAL_CALL release() throw();
68             //XTypeProvider
69             virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
70             // XPropertySet
71             virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
72 
73             // XRowLocate
74             virtual ::com::sun::star::uno::Any SAL_CALL getBookmark(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
75             virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
76             virtual sal_Bool SAL_CALL moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
77             virtual sal_Int32 SAL_CALL compareBookmarks( const ::com::sun::star::uno::Any& first, const ::com::sun::star::uno::Any& second ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
78             virtual sal_Bool SAL_CALL hasOrderedBookmarks(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
79             virtual sal_Int32 SAL_CALL hashBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
80             // XDeleteRows
81             virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
82 
83             virtual sal_Bool isRowDeleted() const { return sal_False; }
84 
85         };
86     }
87 }
88 
89 #endif //_CONNECTIVITY_CALC_RESULTSET_HXX_
90 
91