nss: upgrade to release 3.73
[LibreOffice.git] / connectivity / source / drivers / postgresql / pq_baseresultset.hxx
blob8b062ddf9ac0ec18992c639322bb17854539357d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * Effective License of whole file:
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License version 2.1, as published by the Free Software Foundation.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 * MA 02111-1307 USA
20 * Parts "Copyright by Sun Microsystems, Inc" prior to August 2011:
22 * The Contents of this file are made available subject to the terms of
23 * the GNU Lesser General Public License Version 2.1
25 * Copyright: 2000 by Sun Microsystems, Inc.
27 * Contributor(s): Joerg Budischewski
29 * All parts contributed on or after August 2011:
31 * This Source Code Form is subject to the terms of the Mozilla Public
32 * License, v. 2.0. If a copy of the MPL was not distributed with this
33 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
35 ************************************************************************/
37 #ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_BASERESULTSET_HXX
38 #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_BASERESULTSET_HXX
40 #include <cppuhelper/propshlp.hxx>
41 #include <cppuhelper/component.hxx>
43 #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
44 #include <com/sun/star/sdbc/XRow.hpp>
45 #include <com/sun/star/sdbc/XCloseable.hpp>
46 #include <com/sun/star/sdbc/XColumnLocate.hpp>
47 #include "pq_connection.hxx"
49 namespace pq_sdbc_driver
52 const sal_Int32 BASERESULTSET_CURSOR_NAME = 0;
53 const sal_Int32 BASERESULTSET_ESCAPE_PROCESSING = 1;
54 const sal_Int32 BASERESULTSET_FETCH_DIRECTION = 2;
55 const sal_Int32 BASERESULTSET_FETCH_SIZE = 3;
56 const sal_Int32 BASERESULTSET_IS_BOOKMARKABLE = 4;
57 const sal_Int32 BASERESULTSET_RESULT_SET_CONCURRENCY = 5;
58 const sal_Int32 BASERESULTSET_RESULT_SET_TYPE = 6;
60 #define BASERESULTSET_SIZE 7
62 typedef ::cppu::WeakComponentImplHelper< css::sdbc::XCloseable,
63 css::sdbc::XResultSetMetaDataSupplier,
64 css::sdbc::XResultSet,
65 css::sdbc::XRow,
66 css::sdbc::XColumnLocate
67 > BaseResultSet_BASE;
68 class BaseResultSet : public BaseResultSet_BASE,
69 public cppu::OPropertySetHelper
71 protected:
72 css::uno::Any m_props[BASERESULTSET_SIZE];
73 css::uno::Reference< css::uno::XInterface > m_owner;
74 css::uno::Reference< css::script::XTypeConverter > m_tc;
75 ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex;
76 sal_Int32 m_row;
77 sal_Int32 m_rowCount;
78 sal_Int32 m_fieldCount;
79 bool m_wasNull;
81 protected:
82 /** mutex should be locked before called
84 @throws css::sdbc::SQLException
85 @throws css::uno::RuntimeException
87 virtual void checkClosed() = 0;
88 /// @throws css::sdbc::SQLException
89 /// @throws css::uno::RuntimeException
90 void checkColumnIndex( sal_Int32 index );
91 void checkRowIndex();
93 virtual css::uno::Any getValue( sal_Int32 columnIndex ) = 0;
94 css::uno::Any convertTo(
95 const css::uno::Any &str, const css::uno::Type &type );
97 protected:
98 BaseResultSet(
99 const ::rtl::Reference< comphelper::RefCountedMutex > & mutex,
100 const css::uno::Reference< css::uno::XInterface > &owner,
101 sal_Int32 rowCount,
102 sal_Int32 columnCount,
103 const css::uno::Reference< css::script::XTypeConverter > &tc );
104 virtual ~BaseResultSet() override;
106 public: // XInterface
107 virtual void SAL_CALL acquire() throw() override { BaseResultSet_BASE::acquire(); }
108 virtual void SAL_CALL release() throw() override { BaseResultSet_BASE::release(); }
109 virtual css::uno::Any SAL_CALL queryInterface(
110 const css::uno::Type & reqType ) override;
112 public: // XCloseable
113 // virtual void SAL_CALL close( )
114 // throw (css::sdbc::SQLException, css::uno::RuntimeException) = 0;
116 public: // XTypeProvider, first implemented by OPropertySetHelper
117 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
118 virtual css::uno::Sequence< sal_Int8> SAL_CALL getImplementationId() override;
120 public: // XResultSetMetaDataSupplier
121 // virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( )
122 // throw (css::sdbc::SQLException, css::uno::RuntimeException) = 0;
124 public: // XResultSet
125 // Methods
126 virtual sal_Bool SAL_CALL next( ) override;
127 virtual sal_Bool SAL_CALL isBeforeFirst( ) override;
128 virtual sal_Bool SAL_CALL isAfterLast( ) override;
129 virtual sal_Bool SAL_CALL isFirst( ) override;
130 virtual sal_Bool SAL_CALL isLast( ) override;
131 virtual void SAL_CALL beforeFirst( ) override;
132 virtual void SAL_CALL afterLast( ) override;
133 virtual sal_Bool SAL_CALL first( ) override;
134 virtual sal_Bool SAL_CALL last( ) override;
135 virtual sal_Int32 SAL_CALL getRow( ) override;
136 virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) override;
137 virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) override;
138 virtual sal_Bool SAL_CALL previous( ) override;
139 virtual void SAL_CALL refreshRow( ) override;
140 virtual sal_Bool SAL_CALL rowUpdated( ) override;
141 virtual sal_Bool SAL_CALL rowInserted( ) override;
142 virtual sal_Bool SAL_CALL rowDeleted( ) override;
143 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement() override;
146 public: // XRow
147 virtual sal_Bool SAL_CALL wasNull( ) override;
148 virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) override;
149 virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) override;
150 virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) override;
151 virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) override;
152 virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) override;
153 virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) override;
154 virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) override;
155 virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) override;
156 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) override;
157 virtual css::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) override;
158 virtual css::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) override;
159 virtual css::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) override;
160 virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) override;
161 virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) override;
162 virtual css::uno::Any SAL_CALL getObject(
163 sal_Int32 columnIndex,
164 const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
165 virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) override;
166 virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) override;
167 virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) override;
168 virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) override;
170 public: // XColumnLocate
171 // virtual sal_Int32 SAL_CALL findColumn( const OUString& columnName )
172 // throw (css::sdbc::SQLException, css::uno::RuntimeException) = 0;
174 public: // OPropertySetHelper
175 virtual cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
177 virtual sal_Bool SAL_CALL convertFastPropertyValue(
178 css::uno::Any & rConvertedValue,
179 css::uno::Any & rOldValue,
180 sal_Int32 nHandle,
181 const css::uno::Any& rValue ) override;
183 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
184 sal_Int32 nHandle,
185 const css::uno::Any& rValue ) override;
187 using ::cppu::OPropertySetHelper::getFastPropertyValue;
189 void SAL_CALL getFastPropertyValue(
190 css::uno::Any& rValue,
191 sal_Int32 nHandle ) const override;
193 // XPropertySet
194 css::uno::Reference < css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override;
196 public: // OComponentHelper
197 virtual void SAL_CALL disposing() override;
203 #endif
205 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */