xref: /AOO41X/main/connectivity/source/inc/dbase/DResultSet.hxx (revision caf5cd79edad04a48dcaf209068b3b89eae4622e)
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_DBASE_DRESULTSET_HXX_
24 #define _CONNECTIVITY_DBASE_DRESULTSET_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 dbase
34     {
35         class ODbaseResultSet;
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> ODbaseResultSet_BASE;
39         typedef file::OResultSet                                            ODbaseResultSet_BASE2;
40         typedef ::comphelper::OPropertyArrayUsageHelper<ODbaseResultSet>    ODbaseResultSet_BASE3;
41 
42 
43         class ODbaseResultSet : public ODbaseResultSet_BASE2,
44                                 public ODbaseResultSet_BASE,
45                                 public ODbaseResultSet_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             virtual file::OSQLAnalyzer* createAnalyzer();
55         public:
56             DECLARE_SERVICE_INFO();
57 
58             ODbaseResultSet( file::OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator&  _aSQLIterator);
59 
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 
79             // own methods
80             sal_Int32 getCurrentFilePos() const;
81 
82         };
83     }
84 }
85 #endif //_CONNECTIVITY_DBASE_DRESULTSET_HXX_
86 
87