Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / mysqlc / source / mysqlc_resultset.hxx
blobebe5b860e1a91d180a24f557e5e8a234875765bc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef MYSQLC_SRESULTSET_HXX
21 #define MYSQLC_SRESULTSET_HXX
23 #include "mysqlc_preparedstatement.hxx"
24 #include "mysqlc_statement.hxx"
25 #include "mysqlc_subcomponent.hxx"
27 #include <com/sun/star/sdbc/XCloseable.hpp>
28 #include <com/sun/star/sdbc/XColumnLocate.hpp>
29 #include <com/sun/star/sdbc/XResultSet.hpp>
30 #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
31 #include <com/sun/star/sdbc/XResultSetUpdate.hpp>
32 #include <com/sun/star/sdbc/XRow.hpp>
33 #include <com/sun/star/sdbc/XRowUpdate.hpp>
34 #include <com/sun/star/sdbc/XWarningsSupplier.hpp>
35 #include <com/sun/star/sdbcx/XDeleteRows.hpp>
36 #include <com/sun/star/sdbcx/XRowLocate.hpp>
37 #include <com/sun/star/util/XCancellable.hpp>
39 #include <cppuhelper/compbase12.hxx>
42 namespace connectivity
44 namespace mysqlc
46 using ::rtl::OUString;
47 using ::com::sun::star::sdbc::SQLException;
48 using ::com::sun::star::uno::RuntimeException;
49 using ::com::sun::star::uno::Any;
50 typedef ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > my_XInputStreamRef;
51 typedef my_XNameAccessRef my_XNameAccessRef;
54 ** OResultSet
56 typedef ::cppu::WeakComponentImplHelper12< ::com::sun::star::sdbc::XResultSet,
57 ::com::sun::star::sdbc::XRow,
58 ::com::sun::star::sdbc::XResultSetMetaDataSupplier,
59 ::com::sun::star::util::XCancellable,
60 ::com::sun::star::sdbc::XWarningsSupplier,
61 ::com::sun::star::sdbc::XResultSetUpdate,
62 ::com::sun::star::sdbc::XRowUpdate,
63 ::com::sun::star::sdbcx::XRowLocate,
64 ::com::sun::star::sdbcx::XDeleteRows,
65 ::com::sun::star::sdbc::XCloseable,
66 ::com::sun::star::sdbc::XColumnLocate,
67 ::com::sun::star::lang::XServiceInfo> OResultSet_BASE;
69 class OResultSet : public OBase_Mutex,
70 public OResultSet_BASE,
71 public ::cppu::OPropertySetHelper,
72 public OPropertyArrayUsageHelper<OResultSet>
74 protected:
75 ::com::sun::star::uno::WeakReferenceHelper m_aStatement;
76 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData;
77 sql::ResultSet *m_result;
78 unsigned int fieldCount;
79 rtl_TextEncoding m_encoding;
80 // OPropertyArrayUsageHelper
81 ::cppu::IPropertyArrayHelper* createArrayHelper() const;
82 // OPropertySetHelper
83 ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
85 sal_Bool SAL_CALL convertFastPropertyValue(Any & rConvertedValue, Any & rOldValue, sal_Int32 nHandle, const Any& rValue)
86 throw (::com::sun::star::lang::IllegalArgumentException);
88 void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const Any& rValue)
89 throw (::com::sun::star::uno::Exception);
91 void SAL_CALL getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const;
93 // you can't delete objects of this type
94 virtual ~OResultSet();
96 public:
97 DECLARE_SERVICE_INFO();
99 OResultSet( OCommonStatement* pStmt, sql::ResultSet *result, rtl_TextEncoding _encoding );
101 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *()
103 return ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(*(OResultSet_BASE*)this);
106 // ::cppu::OComponentHelper
107 void SAL_CALL disposing();
109 // XInterface
110 Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type & rType)
111 throw(RuntimeException);
113 void SAL_CALL acquire() throw();
114 void SAL_CALL release() throw();
116 //XTypeProvider
117 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
118 throw(RuntimeException);
120 // XPropertySet
121 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo()
122 throw(RuntimeException);
124 // XResultSet
125 sal_Bool SAL_CALL next() throw(SQLException, RuntimeException);
126 sal_Bool SAL_CALL isBeforeFirst() throw(SQLException, RuntimeException);
127 sal_Bool SAL_CALL isAfterLast() throw(SQLException, RuntimeException);
128 sal_Bool SAL_CALL isFirst() throw(SQLException, RuntimeException);
129 sal_Bool SAL_CALL isLast() throw(SQLException, RuntimeException);
131 void SAL_CALL beforeFirst() throw(SQLException, RuntimeException);
132 void SAL_CALL afterLast() throw(SQLException, RuntimeException);
134 sal_Bool SAL_CALL first() throw(SQLException, RuntimeException);
135 sal_Bool SAL_CALL last() throw(SQLException, RuntimeException);
137 sal_Int32 SAL_CALL getRow() throw(SQLException, RuntimeException);
139 sal_Bool SAL_CALL absolute(sal_Int32 row) throw(SQLException, RuntimeException);
140 sal_Bool SAL_CALL relative(sal_Int32 rows) throw(SQLException, RuntimeException);
141 sal_Bool SAL_CALL previous() throw(SQLException, RuntimeException);
143 void SAL_CALL refreshRow() throw(SQLException, RuntimeException);
145 sal_Bool SAL_CALL rowUpdated() throw(SQLException, RuntimeException);
146 sal_Bool SAL_CALL rowInserted() throw(SQLException, RuntimeException);
147 sal_Bool SAL_CALL rowDeleted() throw(SQLException, RuntimeException);
149 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getStatement()
150 throw(SQLException, RuntimeException);
151 // XRow
152 sal_Bool SAL_CALL wasNull() throw(SQLException, RuntimeException);
154 OUString SAL_CALL getString(sal_Int32 column) throw(SQLException, RuntimeException);
156 sal_Bool SAL_CALL getBoolean(sal_Int32 column) throw(SQLException, RuntimeException);
157 sal_Int8 SAL_CALL getByte(sal_Int32 column) throw(SQLException, RuntimeException);
158 sal_Int16 SAL_CALL getShort(sal_Int32 column) throw(SQLException, RuntimeException);
159 sal_Int32 SAL_CALL getInt(sal_Int32 column) throw(SQLException, RuntimeException);
160 sal_Int64 SAL_CALL getLong(sal_Int32 column) throw(SQLException, RuntimeException);
162 float SAL_CALL getFloat(sal_Int32 column) throw(SQLException, RuntimeException);
163 double SAL_CALL getDouble(sal_Int32 column) throw(SQLException, RuntimeException);
165 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBytes(sal_Int32 column)
166 throw(SQLException, RuntimeException);
167 ::com::sun::star::util::Date SAL_CALL getDate(sal_Int32 column)
168 throw(SQLException, RuntimeException);
169 ::com::sun::star::util::Time SAL_CALL getTime(sal_Int32 column)
170 throw(SQLException, RuntimeException);
171 ::com::sun::star::util::DateTime SAL_CALL getTimestamp(sal_Int32 column)
172 throw(SQLException, RuntimeException);
174 my_XInputStreamRef SAL_CALL getBinaryStream(sal_Int32 column)
175 throw(SQLException, RuntimeException);
176 my_XInputStreamRef SAL_CALL getCharacterStream(sal_Int32 column)
177 throw(SQLException, RuntimeException);
179 Any SAL_CALL getObject(sal_Int32 column, const my_XNameAccessRef& typeMap)
180 throw(SQLException, RuntimeException);
182 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef > SAL_CALL getRef(sal_Int32 column)
183 throw(SQLException, RuntimeException);
184 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob > SAL_CALL getBlob(sal_Int32 column)
185 throw(SQLException, RuntimeException);
186 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL getClob(sal_Int32 column)
187 throw(SQLException, RuntimeException);
188 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL getArray(sal_Int32 column)
189 throw(SQLException, RuntimeException);
191 // XResultSetMetaDataSupplier
192 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData()
193 throw(SQLException, RuntimeException);
195 // XCancellable
196 void SAL_CALL cancel() throw(RuntimeException);
198 // XCloseable
199 void SAL_CALL close() throw(SQLException, RuntimeException);
201 // XWarningsSupplier
202 Any SAL_CALL getWarnings() throw(SQLException, RuntimeException);
204 void SAL_CALL clearWarnings() throw(SQLException, RuntimeException);
206 // XResultSetUpdate
207 void SAL_CALL insertRow() throw(SQLException, RuntimeException);
208 void SAL_CALL updateRow() throw(SQLException, RuntimeException);
209 void SAL_CALL deleteRow() throw(SQLException, RuntimeException);
210 void SAL_CALL cancelRowUpdates() throw(SQLException, RuntimeException);
211 void SAL_CALL moveToInsertRow() throw(SQLException, RuntimeException);
212 void SAL_CALL moveToCurrentRow() throw(SQLException, RuntimeException);
214 // XRowUpdate
215 void SAL_CALL updateNull(sal_Int32 column) throw(SQLException, RuntimeException);
216 void SAL_CALL updateBoolean(sal_Int32 column, sal_Bool x) throw(SQLException, RuntimeException);
217 void SAL_CALL updateByte(sal_Int32 column, sal_Int8 x) throw(SQLException, RuntimeException);
218 void SAL_CALL updateShort(sal_Int32 column, sal_Int16 x) throw(SQLException, RuntimeException);
219 void SAL_CALL updateInt(sal_Int32 column, sal_Int32 x) throw(SQLException, RuntimeException);
220 void SAL_CALL updateLong(sal_Int32 column, sal_Int64 x) throw(SQLException, RuntimeException);
221 void SAL_CALL updateFloat(sal_Int32 column, float x) throw(SQLException, RuntimeException);
222 void SAL_CALL updateDouble(sal_Int32 column, double x) throw(SQLException, RuntimeException);
223 void SAL_CALL updateString(sal_Int32 column, const OUString& x)
224 throw(SQLException, RuntimeException);
225 void SAL_CALL updateBytes(sal_Int32 column, const ::com::sun::star::uno::Sequence< sal_Int8 >& x)
226 throw(SQLException, RuntimeException);
227 void SAL_CALL updateDate(sal_Int32 column, const ::com::sun::star::util::Date& x)
228 throw(SQLException, RuntimeException);
229 void SAL_CALL updateTime(sal_Int32 column, const ::com::sun::star::util::Time& x)
230 throw(SQLException, RuntimeException);
231 void SAL_CALL updateTimestamp(sal_Int32 column, const ::com::sun::star::util::DateTime& x)
232 throw(SQLException, RuntimeException);
233 void SAL_CALL updateBinaryStream(sal_Int32 column, const my_XInputStreamRef& x, sal_Int32 length)
234 throw(SQLException, RuntimeException);
235 void SAL_CALL updateCharacterStream(sal_Int32 column, const my_XInputStreamRef& x, sal_Int32 length)
236 throw(SQLException, RuntimeException);
237 void SAL_CALL updateObject(sal_Int32 column, const Any& x)
238 throw(SQLException, RuntimeException);
239 void SAL_CALL updateNumericObject(sal_Int32 column, const Any& x, sal_Int32 scale)
240 throw(SQLException, RuntimeException);
242 // XColumnLocate
243 sal_Int32 SAL_CALL findColumn(const OUString& columnName)
244 throw(SQLException, RuntimeException);
246 // XRowLocate
247 Any SAL_CALL getBookmark() throw(SQLException, RuntimeException);
249 sal_Bool SAL_CALL moveToBookmark(const Any& bookmark)
250 throw(SQLException, RuntimeException);
251 sal_Bool SAL_CALL moveRelativeToBookmark(const Any& bookmark, sal_Int32 rows)
252 throw(SQLException, RuntimeException);
253 sal_Int32 SAL_CALL compareBookmarks(const Any& first, const Any& second)
254 throw(SQLException, RuntimeException);
255 sal_Bool SAL_CALL hasOrderedBookmarks() throw(SQLException, RuntimeException);
256 sal_Int32 SAL_CALL hashBookmark(const Any& bookmark)
257 throw(SQLException, RuntimeException);
259 // XDeleteRows
260 ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL deleteRows(const ::com::sun::star::uno::Sequence< Any >& rows)
261 throw(SQLException, RuntimeException);
263 void checkColumnIndex(sal_Int32 index) throw(SQLException, RuntimeException);
265 private:
266 using ::cppu::OPropertySetHelper::getFastPropertyValue;
268 } /* mysqlc */
269 } /* connectivity */
270 #endif // CONNECTIVITY_SRESULTSET_HXX
273 * Local variables:
274 * tab-width: 4
275 * c-basic-offset: 4
276 * End:
277 * vim600: noet sw=4 ts=4 fdm=marker
278 * vim<600: noet sw=4 ts=4
281 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */