1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
46 using ::com::sun::star::sdbc::SQLException
;
47 using ::com::sun::star::uno::RuntimeException
;
48 using ::com::sun::star::uno::Any
;
49 typedef ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
> my_XInputStreamRef
;
50 typedef my_XNameAccessRef my_XNameAccessRef
;
55 typedef ::cppu::WeakComponentImplHelper12
< ::com::sun::star::sdbc::XResultSet
,
56 ::com::sun::star::sdbc::XRow
,
57 ::com::sun::star::sdbc::XResultSetMetaDataSupplier
,
58 ::com::sun::star::util::XCancellable
,
59 ::com::sun::star::sdbc::XWarningsSupplier
,
60 ::com::sun::star::sdbc::XResultSetUpdate
,
61 ::com::sun::star::sdbc::XRowUpdate
,
62 ::com::sun::star::sdbcx::XRowLocate
,
63 ::com::sun::star::sdbcx::XDeleteRows
,
64 ::com::sun::star::sdbc::XCloseable
,
65 ::com::sun::star::sdbc::XColumnLocate
,
66 ::com::sun::star::lang::XServiceInfo
> OResultSet_BASE
;
68 class OResultSet
: public OBase_Mutex
,
69 public OResultSet_BASE
,
70 public ::cppu::OPropertySetHelper
,
71 public OPropertyArrayUsageHelper
<OResultSet
>
74 ::com::sun::star::uno::WeakReferenceHelper m_aStatement
;
75 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XResultSetMetaData
> m_xMetaData
;
76 sql::ResultSet
*m_result
;
77 unsigned int fieldCount
;
78 rtl_TextEncoding m_encoding
;
79 // OPropertyArrayUsageHelper
80 ::cppu::IPropertyArrayHelper
* createArrayHelper() const;
82 ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
84 sal_Bool SAL_CALL
convertFastPropertyValue(Any
& rConvertedValue
, Any
& rOldValue
, sal_Int32 nHandle
, const Any
& rValue
)
85 throw (::com::sun::star::lang::IllegalArgumentException
);
87 void SAL_CALL
setFastPropertyValue_NoBroadcast(sal_Int32 nHandle
, const Any
& rValue
)
88 throw (::com::sun::star::uno::Exception
);
90 void SAL_CALL
getFastPropertyValue(Any
& rValue
, sal_Int32 nHandle
) const;
92 // you can't delete objects of this type
93 virtual ~OResultSet();
96 DECLARE_SERVICE_INFO();
98 OResultSet( OCommonStatement
* pStmt
, sql::ResultSet
*result
, rtl_TextEncoding _encoding
);
100 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> operator *()
102 return ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>(*(OResultSet_BASE
*)this);
105 // ::cppu::OComponentHelper
106 void SAL_CALL
disposing();
109 Any SAL_CALL
queryInterface(const ::com::sun::star::uno::Type
& rType
)
110 throw(RuntimeException
);
112 void SAL_CALL
acquire() throw();
113 void SAL_CALL
release() throw();
116 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes()
117 throw(RuntimeException
);
120 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo()
121 throw(RuntimeException
);
124 sal_Bool SAL_CALL
next() throw(SQLException
, RuntimeException
);
125 sal_Bool SAL_CALL
isBeforeFirst() throw(SQLException
, RuntimeException
);
126 sal_Bool SAL_CALL
isAfterLast() throw(SQLException
, RuntimeException
);
127 sal_Bool SAL_CALL
isFirst() throw(SQLException
, RuntimeException
);
128 sal_Bool SAL_CALL
isLast() throw(SQLException
, RuntimeException
);
130 void SAL_CALL
beforeFirst() throw(SQLException
, RuntimeException
);
131 void SAL_CALL
afterLast() throw(SQLException
, RuntimeException
);
133 sal_Bool SAL_CALL
first() throw(SQLException
, RuntimeException
);
134 sal_Bool SAL_CALL
last() throw(SQLException
, RuntimeException
);
136 sal_Int32 SAL_CALL
getRow() throw(SQLException
, RuntimeException
);
138 sal_Bool SAL_CALL
absolute(sal_Int32 row
) throw(SQLException
, RuntimeException
);
139 sal_Bool SAL_CALL
relative(sal_Int32 rows
) throw(SQLException
, RuntimeException
);
140 sal_Bool SAL_CALL
previous() throw(SQLException
, RuntimeException
);
142 void SAL_CALL
refreshRow() throw(SQLException
, RuntimeException
);
144 sal_Bool SAL_CALL
rowUpdated() throw(SQLException
, RuntimeException
);
145 sal_Bool SAL_CALL
rowInserted() throw(SQLException
, RuntimeException
);
146 sal_Bool SAL_CALL
rowDeleted() throw(SQLException
, RuntimeException
);
148 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
getStatement()
149 throw(SQLException
, RuntimeException
);
151 sal_Bool SAL_CALL
wasNull() throw(SQLException
, RuntimeException
);
153 OUString SAL_CALL
getString(sal_Int32 column
) throw(SQLException
, RuntimeException
);
155 sal_Bool SAL_CALL
getBoolean(sal_Int32 column
) throw(SQLException
, RuntimeException
);
156 sal_Int8 SAL_CALL
getByte(sal_Int32 column
) throw(SQLException
, RuntimeException
);
157 sal_Int16 SAL_CALL
getShort(sal_Int32 column
) throw(SQLException
, RuntimeException
);
158 sal_Int32 SAL_CALL
getInt(sal_Int32 column
) throw(SQLException
, RuntimeException
);
159 sal_Int64 SAL_CALL
getLong(sal_Int32 column
) throw(SQLException
, RuntimeException
);
161 float SAL_CALL
getFloat(sal_Int32 column
) throw(SQLException
, RuntimeException
);
162 double SAL_CALL
getDouble(sal_Int32 column
) throw(SQLException
, RuntimeException
);
164 ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getBytes(sal_Int32 column
)
165 throw(SQLException
, RuntimeException
);
166 ::com::sun::star::util::Date SAL_CALL
getDate(sal_Int32 column
)
167 throw(SQLException
, RuntimeException
);
168 ::com::sun::star::util::Time SAL_CALL
getTime(sal_Int32 column
)
169 throw(SQLException
, RuntimeException
);
170 ::com::sun::star::util::DateTime SAL_CALL
getTimestamp(sal_Int32 column
)
171 throw(SQLException
, RuntimeException
);
173 my_XInputStreamRef SAL_CALL
getBinaryStream(sal_Int32 column
)
174 throw(SQLException
, RuntimeException
);
175 my_XInputStreamRef SAL_CALL
getCharacterStream(sal_Int32 column
)
176 throw(SQLException
, RuntimeException
);
178 Any SAL_CALL
getObject(sal_Int32 column
, const my_XNameAccessRef
& typeMap
)
179 throw(SQLException
, RuntimeException
);
181 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XRef
> SAL_CALL
getRef(sal_Int32 column
)
182 throw(SQLException
, RuntimeException
);
183 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XBlob
> SAL_CALL
getBlob(sal_Int32 column
)
184 throw(SQLException
, RuntimeException
);
185 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XClob
> SAL_CALL
getClob(sal_Int32 column
)
186 throw(SQLException
, RuntimeException
);
187 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XArray
> SAL_CALL
getArray(sal_Int32 column
)
188 throw(SQLException
, RuntimeException
);
190 // XResultSetMetaDataSupplier
191 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XResultSetMetaData
> SAL_CALL
getMetaData()
192 throw(SQLException
, RuntimeException
);
195 void SAL_CALL
cancel() throw(RuntimeException
);
198 void SAL_CALL
close() throw(SQLException
, RuntimeException
);
201 Any SAL_CALL
getWarnings() throw(SQLException
, RuntimeException
);
203 void SAL_CALL
clearWarnings() throw(SQLException
, RuntimeException
);
206 void SAL_CALL
insertRow() throw(SQLException
, RuntimeException
);
207 void SAL_CALL
updateRow() throw(SQLException
, RuntimeException
);
208 void SAL_CALL
deleteRow() throw(SQLException
, RuntimeException
);
209 void SAL_CALL
cancelRowUpdates() throw(SQLException
, RuntimeException
);
210 void SAL_CALL
moveToInsertRow() throw(SQLException
, RuntimeException
);
211 void SAL_CALL
moveToCurrentRow() throw(SQLException
, RuntimeException
);
214 void SAL_CALL
updateNull(sal_Int32 column
) throw(SQLException
, RuntimeException
);
215 void SAL_CALL
updateBoolean(sal_Int32 column
, sal_Bool x
) throw(SQLException
, RuntimeException
);
216 void SAL_CALL
updateByte(sal_Int32 column
, sal_Int8 x
) throw(SQLException
, RuntimeException
);
217 void SAL_CALL
updateShort(sal_Int32 column
, sal_Int16 x
) throw(SQLException
, RuntimeException
);
218 void SAL_CALL
updateInt(sal_Int32 column
, sal_Int32 x
) throw(SQLException
, RuntimeException
);
219 void SAL_CALL
updateLong(sal_Int32 column
, sal_Int64 x
) throw(SQLException
, RuntimeException
);
220 void SAL_CALL
updateFloat(sal_Int32 column
, float x
) throw(SQLException
, RuntimeException
);
221 void SAL_CALL
updateDouble(sal_Int32 column
, double x
) throw(SQLException
, RuntimeException
);
222 void SAL_CALL
updateString(sal_Int32 column
, const OUString
& x
)
223 throw(SQLException
, RuntimeException
);
224 void SAL_CALL
updateBytes(sal_Int32 column
, const ::com::sun::star::uno::Sequence
< sal_Int8
>& x
)
225 throw(SQLException
, RuntimeException
);
226 void SAL_CALL
updateDate(sal_Int32 column
, const ::com::sun::star::util::Date
& x
)
227 throw(SQLException
, RuntimeException
);
228 void SAL_CALL
updateTime(sal_Int32 column
, const ::com::sun::star::util::Time
& x
)
229 throw(SQLException
, RuntimeException
);
230 void SAL_CALL
updateTimestamp(sal_Int32 column
, const ::com::sun::star::util::DateTime
& x
)
231 throw(SQLException
, RuntimeException
);
232 void SAL_CALL
updateBinaryStream(sal_Int32 column
, const my_XInputStreamRef
& x
, sal_Int32 length
)
233 throw(SQLException
, RuntimeException
);
234 void SAL_CALL
updateCharacterStream(sal_Int32 column
, const my_XInputStreamRef
& x
, sal_Int32 length
)
235 throw(SQLException
, RuntimeException
);
236 void SAL_CALL
updateObject(sal_Int32 column
, const Any
& x
)
237 throw(SQLException
, RuntimeException
);
238 void SAL_CALL
updateNumericObject(sal_Int32 column
, const Any
& x
, sal_Int32 scale
)
239 throw(SQLException
, RuntimeException
);
242 sal_Int32 SAL_CALL
findColumn(const OUString
& columnName
)
243 throw(SQLException
, RuntimeException
);
246 Any SAL_CALL
getBookmark() throw(SQLException
, RuntimeException
);
248 sal_Bool SAL_CALL
moveToBookmark(const Any
& bookmark
)
249 throw(SQLException
, RuntimeException
);
250 sal_Bool SAL_CALL
moveRelativeToBookmark(const Any
& bookmark
, sal_Int32 rows
)
251 throw(SQLException
, RuntimeException
);
252 sal_Int32 SAL_CALL
compareBookmarks(const Any
& first
, const Any
& second
)
253 throw(SQLException
, RuntimeException
);
254 sal_Bool SAL_CALL
hasOrderedBookmarks() throw(SQLException
, RuntimeException
);
255 sal_Int32 SAL_CALL
hashBookmark(const Any
& bookmark
)
256 throw(SQLException
, RuntimeException
);
259 ::com::sun::star::uno::Sequence
< sal_Int32
> SAL_CALL
deleteRows(const ::com::sun::star::uno::Sequence
< Any
>& rows
)
260 throw(SQLException
, RuntimeException
);
262 void checkColumnIndex(sal_Int32 index
) throw(SQLException
, RuntimeException
);
265 using ::cppu::OPropertySetHelper::getFastPropertyValue
;
269 #endif // CONNECTIVITY_SRESULTSET_HXX
276 * vim600: noet sw=4 ts=4 fdm=marker
277 * vim<600: noet sw=4 ts=4
280 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */