1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _CONNECTIVITY_CALC_RESULTSET_HXX_
24 #define _CONNECTIVITY_CALC_RESULTSET_HXX_
25 
26 #include "file/FResultSet.hxx"
27 #include <com/sun/star/sdbcx/XRowLocate.hpp>
28 #include <com/sun/star/sdbcx/XDeleteRows.hpp>
29 #include <cppuhelper/implbase2.hxx>
30 
31 namespace connectivity
32 {
33 	namespace calc
34 	{
35 		class OCalcResultSet;
36 		// these typedef's are only necessary for the compiler
37 		typedef ::cppu::ImplHelper2<  ::com::sun::star::sdbcx::XRowLocate,
38                                       ::com::sun::star::sdbcx::XDeleteRows> OCalcResultSet_BASE;
39 		typedef file::OResultSet											OCalcResultSet_BASE2;
40 		typedef ::comphelper::OPropertyArrayUsageHelper<OCalcResultSet>	OCalcResultSet_BASE3;
41 
42 
43 		class OCalcResultSet : public OCalcResultSet_BASE2,
44 								public OCalcResultSet_BASE,
45 								public OCalcResultSet_BASE3
46 		{
47 			sal_Bool m_bBookmarkable;
48 		protected:
49 			// OPropertyArrayUsageHelper
50 			virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
51 			// OPropertySetHelper
52 			virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
53 			virtual sal_Bool fillIndexValues(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier> &_xIndex);
54 		public:
55 			DECLARE_SERVICE_INFO();
56 
57 			OCalcResultSet( file::OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator&	_aSQLIterator);
58 
59         private:
60 			// XInterface
61             virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
62 			virtual void SAL_CALL acquire() throw();
63             virtual void SAL_CALL release() throw();
64 			//XTypeProvider
65             virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
66 			// XPropertySet
67             virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
68 
69 			// XRowLocate
70             virtual ::com::sun::star::uno::Any SAL_CALL getBookmark(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
71             virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
72             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);
73             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);
74             virtual sal_Bool SAL_CALL hasOrderedBookmarks(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
75             virtual sal_Int32 SAL_CALL hashBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
76 			// XDeleteRows
77             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);
78 
isRowDeleted() const79             virtual sal_Bool isRowDeleted() const { return sal_False; }
80 
81 		};
82 	}
83 }
84 
85 #endif //_CONNECTIVITY_CALC_RESULTSET_HXX_
86 
87