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 .
19 #ifndef INCLUDED_XMLHELP_SOURCE_CXXHELP_PROVIDER_RESULTSETBASE_HXX
20 #define INCLUDED_XMLHELP_SOURCE_CXXHELP_PROVIDER_RESULTSETBASE_HXX
23 #include <cppuhelper/weak.hxx>
24 #include <cppuhelper/interfacecontainer.hxx>
25 #include <com/sun/star/lang/XComponent.hpp>
26 #include <com/sun/star/ucb/XContentAccess.hpp>
27 #include <com/sun/star/sdbc/XCloseable.hpp>
28 #include <com/sun/star/beans/XPropertySet.hpp>
29 #include <com/sun/star/sdbc/XResultSet.hpp>
30 #include <com/sun/star/sdbc/XRow.hpp>
31 #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
32 #include <com/sun/star/ucb/NumberedSortingInfo.hpp>
33 #include <com/sun/star/ucb/XContentProvider.hpp>
34 #include <com/sun/star/ucb/XContentIdentifier.hpp>
35 #include <com/sun/star/uno/XComponentContext.hpp>
36 #include <com/sun/star/beans/Property.hpp>
42 : public cppu::OWeakObject
,
43 public com::sun::star::lang::XComponent
,
44 public com::sun::star::sdbc::XRow
,
45 public com::sun::star::sdbc::XResultSet
,
46 public com::sun::star::sdbc::XCloseable
,
47 public com::sun::star::sdbc::XResultSetMetaDataSupplier
,
48 public com::sun::star::beans::XPropertySet
,
49 public com::sun::star::ucb::XContentAccess
53 ResultSetBase( const com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>& rxContext
,
54 const com::sun::star::uno::Reference
< com::sun::star::ucb::XContentProvider
>& xProvider
,
56 const com::sun::star::uno::Sequence
< com::sun::star::beans::Property
>& seq
,
57 const com::sun::star::uno::Sequence
< com::sun::star::ucb::NumberedSortingInfo
>& seqSort
);
59 virtual ~ResultSetBase();
62 virtual com::sun::star::uno::Any SAL_CALL
64 const com::sun::star::uno::Type
& aType
)
65 throw( com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
81 throw( com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
85 const com::sun::star::uno::Reference
< com::sun::star::lang::XEventListener
>& xListener
)
86 throw( com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
89 removeEventListener( const com::sun::star::uno::Reference
< com::sun::star::lang::XEventListener
>& aListener
)
90 throw( com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
94 virtual sal_Bool SAL_CALL
97 throw( com::sun::star::sdbc::SQLException
,
98 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
100 if( 0<= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
101 m_nWasNull
= m_aItems
[m_nRow
]->wasNull();
107 virtual OUString SAL_CALL
109 sal_Int32 columnIndex
)
110 throw( com::sun::star::sdbc::SQLException
,
111 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
113 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
114 return m_aItems
[m_nRow
]->getString( columnIndex
);
119 virtual sal_Bool SAL_CALL
121 sal_Int32 columnIndex
)
122 throw( com::sun::star::sdbc::SQLException
,
123 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
125 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
126 return m_aItems
[m_nRow
]->getBoolean( columnIndex
);
131 virtual sal_Int8 SAL_CALL
133 sal_Int32 columnIndex
)
134 throw( com::sun::star::sdbc::SQLException
,
135 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
137 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
138 return m_aItems
[m_nRow
]->getByte( columnIndex
);
140 return sal_Int8( 0 );
143 virtual sal_Int16 SAL_CALL
145 sal_Int32 columnIndex
)
147 com::sun::star::sdbc::SQLException
,
148 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
150 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
151 return m_aItems
[m_nRow
]->getShort( columnIndex
);
153 return sal_Int16( 0 );
156 virtual sal_Int32 SAL_CALL
158 sal_Int32 columnIndex
)
159 throw( com::sun::star::sdbc::SQLException
,
160 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
162 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
163 return m_aItems
[m_nRow
]->getInt( columnIndex
);
165 return sal_Int32( 0 );
168 virtual sal_Int64 SAL_CALL
170 sal_Int32 columnIndex
)
171 throw( com::sun::star::sdbc::SQLException
,
172 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
174 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
175 return m_aItems
[m_nRow
]->getLong( columnIndex
);
177 return sal_Int64( 0 );
180 virtual float SAL_CALL
182 sal_Int32 columnIndex
)
183 throw( com::sun::star::sdbc::SQLException
,
184 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
186 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
187 return m_aItems
[m_nRow
]->getFloat( columnIndex
);
192 virtual double SAL_CALL
194 sal_Int32 columnIndex
)
195 throw( com::sun::star::sdbc::SQLException
,
196 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
198 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
199 return m_aItems
[m_nRow
]->getDouble( columnIndex
);
204 virtual com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
206 sal_Int32 columnIndex
)
207 throw( com::sun::star::sdbc::SQLException
,
208 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
210 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
211 return m_aItems
[m_nRow
]->getBytes( columnIndex
);
213 return com::sun::star::uno::Sequence
< sal_Int8
>();
216 virtual com::sun::star::util::Date SAL_CALL
218 sal_Int32 columnIndex
)
219 throw( com::sun::star::sdbc::SQLException
,
220 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
222 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
223 return m_aItems
[m_nRow
]->getDate( columnIndex
);
225 return com::sun::star::util::Date();
228 virtual com::sun::star::util::Time SAL_CALL
230 sal_Int32 columnIndex
)
231 throw( com::sun::star::sdbc::SQLException
,
232 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
234 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
235 return m_aItems
[m_nRow
]->getTime( columnIndex
);
237 return com::sun::star::util::Time();
240 virtual com::sun::star::util::DateTime SAL_CALL
242 sal_Int32 columnIndex
)
243 throw( com::sun::star::sdbc::SQLException
,
244 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
246 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
247 return m_aItems
[m_nRow
]->getTimestamp( columnIndex
);
249 return com::sun::star::util::DateTime();
252 virtual com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
> SAL_CALL
254 sal_Int32 columnIndex
)
255 throw( com::sun::star::sdbc::SQLException
,
256 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
258 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
259 return m_aItems
[m_nRow
]->getBinaryStream( columnIndex
);
261 return com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
>();
264 virtual com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
> SAL_CALL
266 sal_Int32 columnIndex
)
267 throw( com::sun::star::sdbc::SQLException
,
268 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
270 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
271 return m_aItems
[m_nRow
]->getCharacterStream( columnIndex
);
273 return com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
>();
276 virtual com::sun::star::uno::Any SAL_CALL
278 sal_Int32 columnIndex
,
279 const com::sun::star::uno::Reference
< com::sun::star::container::XNameAccess
>& typeMap
)
280 throw( com::sun::star::sdbc::SQLException
,
281 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
283 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
284 return m_aItems
[m_nRow
]->getObject( columnIndex
,typeMap
);
286 return com::sun::star::uno::Any();
289 virtual com::sun::star::uno::Reference
< com::sun::star::sdbc::XRef
> SAL_CALL
291 sal_Int32 columnIndex
)
292 throw( com::sun::star::sdbc::SQLException
,
293 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
295 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
296 return m_aItems
[m_nRow
]->getRef( columnIndex
);
298 return com::sun::star::uno::Reference
< com::sun::star::sdbc::XRef
>();
301 virtual com::sun::star::uno::Reference
< com::sun::star::sdbc::XBlob
> SAL_CALL
303 sal_Int32 columnIndex
)
304 throw( com::sun::star::sdbc::SQLException
,
305 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
307 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
308 return m_aItems
[m_nRow
]->getBlob( columnIndex
);
310 return com::sun::star::uno::Reference
< com::sun::star::sdbc::XBlob
>();
313 virtual com::sun::star::uno::Reference
< com::sun::star::sdbc::XClob
> SAL_CALL
315 sal_Int32 columnIndex
)
316 throw( com::sun::star::sdbc::SQLException
,
317 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
319 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
320 return m_aItems
[m_nRow
]->getClob( columnIndex
);
322 return com::sun::star::uno::Reference
< com::sun::star::sdbc::XClob
>();
325 virtual com::sun::star::uno::Reference
< com::sun::star::sdbc::XArray
> SAL_CALL
327 sal_Int32 columnIndex
)
328 throw( com::sun::star::sdbc::SQLException
,
329 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
331 if( 0 <= m_nRow
&& sal::static_int_cast
<sal_uInt32
>( m_nRow
) < m_aItems
.size() )
332 return m_aItems
[m_nRow
]->getArray( columnIndex
);
334 return com::sun::star::uno::Reference
< com::sun::star::sdbc::XArray
>();
340 virtual sal_Bool SAL_CALL
343 throw( com::sun::star::sdbc::SQLException
,
344 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
346 virtual sal_Bool SAL_CALL
349 throw( com::sun::star::sdbc::SQLException
,
350 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
352 virtual sal_Bool SAL_CALL
355 throw( com::sun::star::sdbc::SQLException
,
356 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
358 virtual sal_Bool SAL_CALL
361 throw( com::sun::star::sdbc::SQLException
,
362 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
364 virtual sal_Bool SAL_CALL
367 throw( com::sun::star::sdbc::SQLException
,
368 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
370 virtual void SAL_CALL
373 throw( com::sun::star::sdbc::SQLException
,
374 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
376 virtual void SAL_CALL
379 throw( com::sun::star::sdbc::SQLException
,
380 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
382 virtual sal_Bool SAL_CALL
385 throw( com::sun::star::sdbc::SQLException
,
386 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
388 virtual sal_Bool SAL_CALL
391 throw( com::sun::star::sdbc::SQLException
,
392 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
394 virtual sal_Int32 SAL_CALL
397 throw( com::sun::star::sdbc::SQLException
,
398 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
400 virtual sal_Bool SAL_CALL
403 throw( com::sun::star::sdbc::SQLException
,
404 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
406 virtual sal_Bool SAL_CALL
409 throw( com::sun::star::sdbc::SQLException
,
410 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
412 virtual sal_Bool SAL_CALL
415 throw( com::sun::star::sdbc::SQLException
,
416 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
418 virtual void SAL_CALL
421 throw( com::sun::star::sdbc::SQLException
,
422 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
424 virtual sal_Bool SAL_CALL
427 throw( com::sun::star::sdbc::SQLException
,
428 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
430 virtual sal_Bool SAL_CALL
433 throw( com::sun::star::sdbc::SQLException
,
434 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
436 virtual sal_Bool SAL_CALL
439 throw( com::sun::star::sdbc::SQLException
,
440 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
443 virtual com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> SAL_CALL
446 throw( com::sun::star::sdbc::SQLException
,
447 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
451 virtual void SAL_CALL
454 throw( com::sun::star::sdbc::SQLException
,
455 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
459 virtual OUString SAL_CALL
460 queryContentIdentifierString(
462 throw( com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
464 virtual com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
> SAL_CALL
465 queryContentIdentifier(
467 throw( com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
469 virtual com::sun::star::uno::Reference
< com::sun::star::ucb::XContent
> SAL_CALL
472 throw( com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
474 // XResultSetMetaDataSupplier
475 virtual com::sun::star::uno::Reference
< com::sun::star::sdbc::XResultSetMetaData
> SAL_CALL
478 throw( com::sun::star::sdbc::SQLException
,
479 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
483 virtual com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySetInfo
> SAL_CALL
485 throw( com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
487 virtual void SAL_CALL
setPropertyValue(
488 const OUString
& aPropertyName
,
489 const com::sun::star::uno::Any
& aValue
)
490 throw( com::sun::star::beans::UnknownPropertyException
,
491 com::sun::star::beans::PropertyVetoException
,
492 com::sun::star::lang::IllegalArgumentException
,
493 com::sun::star::lang::WrappedTargetException
,
494 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
496 virtual com::sun::star::uno::Any SAL_CALL
498 const OUString
& PropertyName
)
499 throw( com::sun::star::beans::UnknownPropertyException
,
500 com::sun::star::lang::WrappedTargetException
,
501 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
503 virtual void SAL_CALL
504 addPropertyChangeListener(
505 const OUString
& aPropertyName
,
506 const com::sun::star::uno::Reference
< com::sun::star::beans::XPropertyChangeListener
>& xListener
)
507 throw( com::sun::star::beans::UnknownPropertyException
,
508 com::sun::star::lang::WrappedTargetException
,
509 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
511 virtual void SAL_CALL
512 removePropertyChangeListener(
513 const OUString
& aPropertyName
,
514 const com::sun::star::uno::Reference
< com::sun::star::beans::XPropertyChangeListener
>& aListener
)
515 throw( com::sun::star::beans::UnknownPropertyException
,
516 com::sun::star::lang::WrappedTargetException
,
517 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
519 virtual void SAL_CALL
520 addVetoableChangeListener(
521 const OUString
& PropertyName
,
522 const com::sun::star::uno::Reference
< com::sun::star::beans::XVetoableChangeListener
>& aListener
)
523 throw( com::sun::star::beans::UnknownPropertyException
,
524 com::sun::star::lang::WrappedTargetException
,
525 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
527 virtual void SAL_CALL
removeVetoableChangeListener(
528 const OUString
& PropertyName
,
529 const com::sun::star::uno::Reference
< com::sun::star::beans::XVetoableChangeListener
>& aListener
)
530 throw( com::sun::star::beans::UnknownPropertyException
,
531 com::sun::star::lang::WrappedTargetException
,
532 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
536 com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
> m_xContext
;
537 com::sun::star::uno::Reference
< com::sun::star::ucb::XContentProvider
> m_xProvider
;
540 sal_Int32 m_nOpenMode
;
541 bool m_bRowCountFinal
;
543 typedef std::vector
< com::sun::star::uno::Reference
< com::sun::star::ucb::XContentIdentifier
> > IdentSet
;
544 typedef std::vector
< com::sun::star::uno::Reference
< com::sun::star::sdbc::XRow
> > ItemSet
;
545 typedef std::vector
< OUString
> PathSet
;
551 com::sun::star::uno::Sequence
< com::sun::star::beans::Property
> m_sProperty
;
552 com::sun::star::uno::Sequence
< com::sun::star::ucb::NumberedSortingInfo
> m_sSortingInfo
;
555 cppu::OInterfaceContainerHelper
* m_pDisposeEventListeners
;
557 cppu::OInterfaceContainerHelper
* m_pRowCountListeners
;
558 cppu::OInterfaceContainerHelper
* m_pIsFinalListeners
;
562 } // end namespace fileaccess
567 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */