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 _FTP_FTPRESULTSETBASE_HXX_
20 #define _FTP_FTPRESULTSETBASE_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/lang/XMultiServiceFactory.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
<
54 com::sun::star::uno::XComponentContext
>& rxContext
,
55 const com::sun::star::uno::Reference
<
56 com::sun::star::ucb::XContentProvider
>& xProvider
,
58 const com::sun::star::uno::Sequence
<
59 com::sun::star::beans::Property
>& seq
,
60 const com::sun::star::uno::Sequence
<
61 com::sun::star::ucb::NumberedSortingInfo
>& seqSort
);
63 virtual ~ResultSetBase();
66 virtual com::sun::star::uno::Any SAL_CALL
68 const com::sun::star::uno::Type
& aType
)
69 throw( com::sun::star::uno::RuntimeException
);
85 throw( com::sun::star::uno::RuntimeException
);
89 const com::sun::star::uno::Reference
<
90 com::sun::star::lang::XEventListener
>& xListener
)
91 throw( com::sun::star::uno::RuntimeException
);
94 removeEventListener( const com::sun::star::uno::Reference
<
95 com::sun::star::lang::XEventListener
>& aListener
)
96 throw( com::sun::star::uno::RuntimeException
);
100 virtual sal_Bool SAL_CALL
103 throw( com::sun::star::sdbc::SQLException
,
104 com::sun::star::uno::RuntimeException
)
106 if( 0<= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
107 m_nWasNull
= m_aItems
[m_nRow
]->wasNull();
113 virtual rtl::OUString SAL_CALL
115 sal_Int32 columnIndex
)
116 throw( com::sun::star::sdbc::SQLException
,
117 com::sun::star::uno::RuntimeException
)
120 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
121 ret
= m_aItems
[m_nRow
]->getString( columnIndex
);
126 virtual sal_Bool SAL_CALL
128 sal_Int32 columnIndex
)
129 throw( com::sun::star::sdbc::SQLException
,
130 com::sun::star::uno::RuntimeException
)
132 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
133 return m_aItems
[m_nRow
]->getBoolean( columnIndex
);
138 virtual sal_Int8 SAL_CALL
140 sal_Int32 columnIndex
)
141 throw( com::sun::star::sdbc::SQLException
,
142 com::sun::star::uno::RuntimeException
)
144 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
145 return m_aItems
[m_nRow
]->getByte( columnIndex
);
147 return sal_Int8( 0 );
150 virtual sal_Int16 SAL_CALL
152 sal_Int32 columnIndex
)
154 com::sun::star::sdbc::SQLException
,
155 com::sun::star::uno::RuntimeException
)
157 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
158 return m_aItems
[m_nRow
]->getShort( columnIndex
);
160 return sal_Int16( 0 );
163 virtual sal_Int32 SAL_CALL
165 sal_Int32 columnIndex
)
166 throw( com::sun::star::sdbc::SQLException
,
167 com::sun::star::uno::RuntimeException
)
169 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
170 return m_aItems
[m_nRow
]->getInt( columnIndex
);
172 return sal_Int32( 0 );
175 virtual sal_Int64 SAL_CALL
177 sal_Int32 columnIndex
)
178 throw( com::sun::star::sdbc::SQLException
,
179 com::sun::star::uno::RuntimeException
)
181 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
182 return m_aItems
[m_nRow
]->getLong( columnIndex
);
184 return sal_Int64( 0 );
187 virtual float SAL_CALL
189 sal_Int32 columnIndex
)
190 throw( com::sun::star::sdbc::SQLException
,
191 com::sun::star::uno::RuntimeException
)
193 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
194 return m_aItems
[m_nRow
]->getFloat( columnIndex
);
199 virtual double SAL_CALL
201 sal_Int32 columnIndex
)
202 throw( com::sun::star::sdbc::SQLException
,
203 com::sun::star::uno::RuntimeException
)
205 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
206 return m_aItems
[m_nRow
]->getDouble( columnIndex
);
211 virtual com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
213 sal_Int32 columnIndex
)
214 throw( com::sun::star::sdbc::SQLException
,
215 com::sun::star::uno::RuntimeException
)
217 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
218 return m_aItems
[m_nRow
]->getBytes( columnIndex
);
220 return com::sun::star::uno::Sequence
< sal_Int8
>();
223 virtual com::sun::star::util::Date SAL_CALL
225 sal_Int32 columnIndex
)
226 throw( com::sun::star::sdbc::SQLException
,
227 com::sun::star::uno::RuntimeException
)
229 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
230 return m_aItems
[m_nRow
]->getDate( columnIndex
);
232 return com::sun::star::util::Date();
235 virtual com::sun::star::util::Time SAL_CALL
237 sal_Int32 columnIndex
)
238 throw( com::sun::star::sdbc::SQLException
,
239 com::sun::star::uno::RuntimeException
)
241 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
242 return m_aItems
[m_nRow
]->getTime( columnIndex
);
244 return com::sun::star::util::Time();
247 virtual com::sun::star::util::DateTime SAL_CALL
249 sal_Int32 columnIndex
)
250 throw( com::sun::star::sdbc::SQLException
,
251 com::sun::star::uno::RuntimeException
)
253 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
254 return m_aItems
[m_nRow
]->getTimestamp( columnIndex
);
256 return com::sun::star::util::DateTime();
260 virtual com::sun::star::uno::Reference
<
261 com::sun::star::io::XInputStream
> SAL_CALL
263 sal_Int32 columnIndex
)
264 throw( com::sun::star::sdbc::SQLException
,
265 com::sun::star::uno::RuntimeException
)
267 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
268 return m_aItems
[m_nRow
]->getBinaryStream( columnIndex
);
270 return com::sun::star::uno::Reference
<
271 com::sun::star::io::XInputStream
>();
274 virtual com::sun::star::uno::Reference
<
275 com::sun::star::io::XInputStream
> SAL_CALL
277 sal_Int32 columnIndex
)
278 throw( com::sun::star::sdbc::SQLException
,
279 com::sun::star::uno::RuntimeException
)
281 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
282 return m_aItems
[m_nRow
]->getCharacterStream( columnIndex
);
284 return com::sun::star::uno::Reference
<
285 com::sun::star::io::XInputStream
>();
288 virtual com::sun::star::uno::Any SAL_CALL
290 sal_Int32 columnIndex
,
291 const com::sun::star::uno::Reference
<
292 com::sun::star::container::XNameAccess
>& typeMap
)
293 throw( com::sun::star::sdbc::SQLException
,
294 com::sun::star::uno::RuntimeException
)
296 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
297 return m_aItems
[m_nRow
]->getObject( columnIndex
,typeMap
);
299 return com::sun::star::uno::Any();
302 virtual com::sun::star::uno::Reference
<
303 com::sun::star::sdbc::XRef
> SAL_CALL
305 sal_Int32 columnIndex
)
306 throw( com::sun::star::sdbc::SQLException
,
307 com::sun::star::uno::RuntimeException
)
309 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
310 return m_aItems
[m_nRow
]->getRef( columnIndex
);
312 return com::sun::star::uno::Reference
< com::sun::star::sdbc::XRef
>();
315 virtual com::sun::star::uno::Reference
<
316 com::sun::star::sdbc::XBlob
> SAL_CALL
318 sal_Int32 columnIndex
)
319 throw( com::sun::star::sdbc::SQLException
,
320 com::sun::star::uno::RuntimeException
)
322 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
323 return m_aItems
[m_nRow
]->getBlob( columnIndex
);
325 return com::sun::star::uno::Reference
< com::sun::star::sdbc::XBlob
>();
328 virtual com::sun::star::uno::Reference
<
329 com::sun::star::sdbc::XClob
> SAL_CALL
331 sal_Int32 columnIndex
)
332 throw( com::sun::star::sdbc::SQLException
,
333 com::sun::star::uno::RuntimeException
)
335 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
336 return m_aItems
[m_nRow
]->getClob( columnIndex
);
338 return com::sun::star::uno::Reference
<
339 com::sun::star::sdbc::XClob
>();
342 virtual com::sun::star::uno::Reference
<
343 com::sun::star::sdbc::XArray
> SAL_CALL
345 sal_Int32 columnIndex
)
346 throw( com::sun::star::sdbc::SQLException
,
347 com::sun::star::uno::RuntimeException
)
349 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
350 return m_aItems
[m_nRow
]->getArray( columnIndex
);
352 return com::sun::star::uno::Reference
<
353 com::sun::star::sdbc::XArray
>();
359 virtual sal_Bool SAL_CALL
362 throw( com::sun::star::sdbc::SQLException
,
363 com::sun::star::uno::RuntimeException
);
365 virtual sal_Bool SAL_CALL
368 throw( com::sun::star::sdbc::SQLException
,
369 com::sun::star::uno::RuntimeException
);
371 virtual sal_Bool SAL_CALL
374 throw( com::sun::star::sdbc::SQLException
,
375 com::sun::star::uno::RuntimeException
);
377 virtual sal_Bool SAL_CALL
380 throw( com::sun::star::sdbc::SQLException
,
381 com::sun::star::uno::RuntimeException
);
383 virtual sal_Bool SAL_CALL
386 throw( com::sun::star::sdbc::SQLException
,
387 com::sun::star::uno::RuntimeException
);
389 virtual void SAL_CALL
392 throw( com::sun::star::sdbc::SQLException
,
393 com::sun::star::uno::RuntimeException
);
395 virtual void SAL_CALL
398 throw( com::sun::star::sdbc::SQLException
,
399 com::sun::star::uno::RuntimeException
);
401 virtual sal_Bool SAL_CALL
404 throw( com::sun::star::sdbc::SQLException
,
405 com::sun::star::uno::RuntimeException
);
407 virtual sal_Bool SAL_CALL
410 throw( com::sun::star::sdbc::SQLException
,
411 com::sun::star::uno::RuntimeException
);
413 virtual sal_Int32 SAL_CALL
416 throw( com::sun::star::sdbc::SQLException
,
417 com::sun::star::uno::RuntimeException
);
419 virtual sal_Bool SAL_CALL
422 throw( com::sun::star::sdbc::SQLException
,
423 com::sun::star::uno::RuntimeException
);
425 virtual sal_Bool SAL_CALL
428 throw( com::sun::star::sdbc::SQLException
,
429 com::sun::star::uno::RuntimeException
);
431 virtual sal_Bool SAL_CALL
434 throw( com::sun::star::sdbc::SQLException
,
435 com::sun::star::uno::RuntimeException
);
437 virtual void SAL_CALL
440 throw( com::sun::star::sdbc::SQLException
,
441 com::sun::star::uno::RuntimeException
);
443 virtual sal_Bool SAL_CALL
446 throw( com::sun::star::sdbc::SQLException
,
447 com::sun::star::uno::RuntimeException
);
449 virtual sal_Bool SAL_CALL
452 throw( com::sun::star::sdbc::SQLException
,
453 com::sun::star::uno::RuntimeException
);
455 virtual sal_Bool SAL_CALL
458 throw( com::sun::star::sdbc::SQLException
,
459 com::sun::star::uno::RuntimeException
);
462 virtual com::sun::star::uno::Reference
<
463 com::sun::star::uno::XInterface
> SAL_CALL
466 throw( com::sun::star::sdbc::SQLException
,
467 com::sun::star::uno::RuntimeException
);
471 virtual void SAL_CALL
474 throw( com::sun::star::sdbc::SQLException
,
475 com::sun::star::uno::RuntimeException
);
479 virtual rtl::OUString SAL_CALL
480 queryContentIdentifierString(
482 throw( com::sun::star::uno::RuntimeException
);
484 virtual com::sun::star::uno::Reference
<
485 com::sun::star::ucb::XContentIdentifier
> SAL_CALL
486 queryContentIdentifier(
488 throw( com::sun::star::uno::RuntimeException
);
490 virtual com::sun::star::uno::Reference
<
491 com::sun::star::ucb::XContent
> SAL_CALL
494 throw( com::sun::star::uno::RuntimeException
);
496 // XResultSetMetaDataSupplier
497 virtual com::sun::star::uno::Reference
<
498 com::sun::star::sdbc::XResultSetMetaData
> SAL_CALL
501 throw( com::sun::star::sdbc::SQLException
,
502 com::sun::star::uno::RuntimeException
);
506 virtual com::sun::star::uno::Reference
<
507 com::sun::star::beans::XPropertySetInfo
> SAL_CALL
509 throw( com::sun::star::uno::RuntimeException
);
511 virtual void SAL_CALL
setPropertyValue(
512 const rtl::OUString
& aPropertyName
,
513 const com::sun::star::uno::Any
& aValue
)
514 throw( com::sun::star::beans::UnknownPropertyException
,
515 com::sun::star::beans::PropertyVetoException
,
516 com::sun::star::lang::IllegalArgumentException
,
517 com::sun::star::lang::WrappedTargetException
,
518 com::sun::star::uno::RuntimeException
);
520 virtual com::sun::star::uno::Any SAL_CALL
522 const rtl::OUString
& PropertyName
)
523 throw( com::sun::star::beans::UnknownPropertyException
,
524 com::sun::star::lang::WrappedTargetException
,
525 com::sun::star::uno::RuntimeException
);
527 virtual void SAL_CALL
528 addPropertyChangeListener(
529 const rtl::OUString
& aPropertyName
,
530 const com::sun::star::uno::Reference
<
531 com::sun::star::beans::XPropertyChangeListener
>& xListener
)
532 throw( com::sun::star::beans::UnknownPropertyException
,
533 com::sun::star::lang::WrappedTargetException
,
534 com::sun::star::uno::RuntimeException
);
536 virtual void SAL_CALL
537 removePropertyChangeListener(
538 const rtl::OUString
& aPropertyName
,
539 const com::sun::star::uno::Reference
<
540 com::sun::star::beans::XPropertyChangeListener
>& aListener
)
541 throw( com::sun::star::beans::UnknownPropertyException
,
542 com::sun::star::lang::WrappedTargetException
,
543 com::sun::star::uno::RuntimeException
);
545 virtual void SAL_CALL
546 addVetoableChangeListener(
547 const rtl::OUString
& PropertyName
,
548 const com::sun::star::uno::Reference
<
549 com::sun::star::beans::XVetoableChangeListener
>& aListener
)
550 throw( com::sun::star::beans::UnknownPropertyException
,
551 com::sun::star::lang::WrappedTargetException
,
552 com::sun::star::uno::RuntimeException
);
554 virtual void SAL_CALL
removeVetoableChangeListener(
555 const rtl::OUString
& PropertyName
,
556 const com::sun::star::uno::Reference
<
557 com::sun::star::beans::XVetoableChangeListener
>& aListener
)
558 throw( com::sun::star::beans::UnknownPropertyException
,
559 com::sun::star::lang::WrappedTargetException
,
560 com::sun::star::uno::RuntimeException
);
564 com::sun::star::uno::Reference
<
565 com::sun::star::uno::XComponentContext
> m_xContext
;
566 com::sun::star::uno::Reference
<
567 com::sun::star::ucb::XContentProvider
> m_xProvider
;
570 sal_Int32 m_nOpenMode
;
571 sal_Bool m_bRowCountFinal
;
573 typedef std::vector
< com::sun::star::uno::Reference
<
574 com::sun::star::ucb::XContentIdentifier
> > IdentSet
;
575 typedef std::vector
< com::sun::star::uno::Reference
<
576 com::sun::star::sdbc::XRow
> > ItemSet
;
577 typedef std::vector
< rtl::OUString
>
584 com::sun::star::uno::Sequence
<
585 com::sun::star::beans::Property
> m_sProperty
;
586 com::sun::star::uno::Sequence
<
587 com::sun::star::ucb::NumberedSortingInfo
> m_sSortingInfo
;
590 cppu::OInterfaceContainerHelper
* m_pDisposeEventListeners
;
592 cppu::OInterfaceContainerHelper
* m_pRowCountListeners
;
593 cppu::OInterfaceContainerHelper
* m_pIsFinalListeners
;
597 } // end namespace fileaccess
602 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */