1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef _FTP_FTPRESULTSETBASE_HXX_
29 #define _FTP_FTPRESULTSETBASE_HXX_
32 #include <cppuhelper/weak.hxx>
33 #include <cppuhelper/interfacecontainer.hxx>
34 #include <com/sun/star/lang/XComponent.hpp>
35 #include <com/sun/star/ucb/XContentAccess.hpp>
36 #include <com/sun/star/sdbc/XCloseable.hpp>
37 #include <com/sun/star/beans/XPropertySet.hpp>
38 #include <com/sun/star/sdbc/XResultSet.hpp>
39 #include <com/sun/star/sdbc/XRow.hpp>
40 #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
41 #include <com/sun/star/ucb/NumberedSortingInfo.hpp>
42 #include <com/sun/star/ucb/XContentProvider.hpp>
43 #include <com/sun/star/ucb/XContentIdentifier.hpp>
44 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
45 #include <com/sun/star/beans/Property.hpp>
51 : public cppu::OWeakObject
,
52 public com::sun::star::lang::XComponent
,
53 public com::sun::star::sdbc::XRow
,
54 public com::sun::star::sdbc::XResultSet
,
55 public com::sun::star::sdbc::XCloseable
,
56 public com::sun::star::sdbc::XResultSetMetaDataSupplier
,
57 public com::sun::star::beans::XPropertySet
,
58 public com::sun::star::ucb::XContentAccess
62 ResultSetBase(const com::sun::star::uno::Reference
<
63 com::sun::star::lang::XMultiServiceFactory
>& xMSF
,
64 const com::sun::star::uno::Reference
<
65 com::sun::star::ucb::XContentProvider
>& xProvider
,
67 const com::sun::star::uno::Sequence
<
68 com::sun::star::beans::Property
>& seq
,
69 const com::sun::star::uno::Sequence
<
70 com::sun::star::ucb::NumberedSortingInfo
>& seqSort
);
72 virtual ~ResultSetBase();
75 virtual com::sun::star::uno::Any SAL_CALL
77 const com::sun::star::uno::Type
& aType
)
78 throw( com::sun::star::uno::RuntimeException
);
94 throw( com::sun::star::uno::RuntimeException
);
98 const com::sun::star::uno::Reference
<
99 com::sun::star::lang::XEventListener
>& xListener
)
100 throw( com::sun::star::uno::RuntimeException
);
102 virtual void SAL_CALL
103 removeEventListener( const com::sun::star::uno::Reference
<
104 com::sun::star::lang::XEventListener
>& aListener
)
105 throw( com::sun::star::uno::RuntimeException
);
109 virtual sal_Bool SAL_CALL
112 throw( com::sun::star::sdbc::SQLException
,
113 com::sun::star::uno::RuntimeException
)
115 if( 0<= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
116 m_nWasNull
= m_aItems
[m_nRow
]->wasNull();
122 virtual rtl::OUString SAL_CALL
124 sal_Int32 columnIndex
)
125 throw( com::sun::star::sdbc::SQLException
,
126 com::sun::star::uno::RuntimeException
)
129 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
130 ret
= m_aItems
[m_nRow
]->getString( columnIndex
);
135 virtual sal_Bool SAL_CALL
137 sal_Int32 columnIndex
)
138 throw( com::sun::star::sdbc::SQLException
,
139 com::sun::star::uno::RuntimeException
)
141 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
142 return m_aItems
[m_nRow
]->getBoolean( columnIndex
);
147 virtual sal_Int8 SAL_CALL
149 sal_Int32 columnIndex
)
150 throw( com::sun::star::sdbc::SQLException
,
151 com::sun::star::uno::RuntimeException
)
153 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
154 return m_aItems
[m_nRow
]->getByte( columnIndex
);
156 return sal_Int8( 0 );
159 virtual sal_Int16 SAL_CALL
161 sal_Int32 columnIndex
)
163 com::sun::star::sdbc::SQLException
,
164 com::sun::star::uno::RuntimeException
)
166 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
167 return m_aItems
[m_nRow
]->getShort( columnIndex
);
169 return sal_Int16( 0 );
172 virtual sal_Int32 SAL_CALL
174 sal_Int32 columnIndex
)
175 throw( com::sun::star::sdbc::SQLException
,
176 com::sun::star::uno::RuntimeException
)
178 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
179 return m_aItems
[m_nRow
]->getInt( columnIndex
);
181 return sal_Int32( 0 );
184 virtual sal_Int64 SAL_CALL
186 sal_Int32 columnIndex
)
187 throw( com::sun::star::sdbc::SQLException
,
188 com::sun::star::uno::RuntimeException
)
190 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
191 return m_aItems
[m_nRow
]->getLong( columnIndex
);
193 return sal_Int64( 0 );
196 virtual float SAL_CALL
198 sal_Int32 columnIndex
)
199 throw( com::sun::star::sdbc::SQLException
,
200 com::sun::star::uno::RuntimeException
)
202 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
203 return m_aItems
[m_nRow
]->getFloat( columnIndex
);
208 virtual double SAL_CALL
210 sal_Int32 columnIndex
)
211 throw( com::sun::star::sdbc::SQLException
,
212 com::sun::star::uno::RuntimeException
)
214 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
215 return m_aItems
[m_nRow
]->getDouble( columnIndex
);
220 virtual com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
222 sal_Int32 columnIndex
)
223 throw( com::sun::star::sdbc::SQLException
,
224 com::sun::star::uno::RuntimeException
)
226 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
227 return m_aItems
[m_nRow
]->getBytes( columnIndex
);
229 return com::sun::star::uno::Sequence
< sal_Int8
>();
232 virtual com::sun::star::util::Date SAL_CALL
234 sal_Int32 columnIndex
)
235 throw( com::sun::star::sdbc::SQLException
,
236 com::sun::star::uno::RuntimeException
)
238 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
239 return m_aItems
[m_nRow
]->getDate( columnIndex
);
241 return com::sun::star::util::Date();
244 virtual com::sun::star::util::Time SAL_CALL
246 sal_Int32 columnIndex
)
247 throw( com::sun::star::sdbc::SQLException
,
248 com::sun::star::uno::RuntimeException
)
250 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
251 return m_aItems
[m_nRow
]->getTime( columnIndex
);
253 return com::sun::star::util::Time();
256 virtual com::sun::star::util::DateTime SAL_CALL
258 sal_Int32 columnIndex
)
259 throw( com::sun::star::sdbc::SQLException
,
260 com::sun::star::uno::RuntimeException
)
262 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
263 return m_aItems
[m_nRow
]->getTimestamp( columnIndex
);
265 return com::sun::star::util::DateTime();
269 virtual com::sun::star::uno::Reference
<
270 com::sun::star::io::XInputStream
> SAL_CALL
272 sal_Int32 columnIndex
)
273 throw( com::sun::star::sdbc::SQLException
,
274 com::sun::star::uno::RuntimeException
)
276 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
277 return m_aItems
[m_nRow
]->getBinaryStream( columnIndex
);
279 return com::sun::star::uno::Reference
<
280 com::sun::star::io::XInputStream
>();
283 virtual com::sun::star::uno::Reference
<
284 com::sun::star::io::XInputStream
> SAL_CALL
286 sal_Int32 columnIndex
)
287 throw( com::sun::star::sdbc::SQLException
,
288 com::sun::star::uno::RuntimeException
)
290 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
291 return m_aItems
[m_nRow
]->getCharacterStream( columnIndex
);
293 return com::sun::star::uno::Reference
<
294 com::sun::star::io::XInputStream
>();
297 virtual com::sun::star::uno::Any SAL_CALL
299 sal_Int32 columnIndex
,
300 const com::sun::star::uno::Reference
<
301 com::sun::star::container::XNameAccess
>& typeMap
)
302 throw( com::sun::star::sdbc::SQLException
,
303 com::sun::star::uno::RuntimeException
)
305 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
306 return m_aItems
[m_nRow
]->getObject( columnIndex
,typeMap
);
308 return com::sun::star::uno::Any();
311 virtual com::sun::star::uno::Reference
<
312 com::sun::star::sdbc::XRef
> SAL_CALL
314 sal_Int32 columnIndex
)
315 throw( com::sun::star::sdbc::SQLException
,
316 com::sun::star::uno::RuntimeException
)
318 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
319 return m_aItems
[m_nRow
]->getRef( columnIndex
);
321 return com::sun::star::uno::Reference
< com::sun::star::sdbc::XRef
>();
324 virtual com::sun::star::uno::Reference
<
325 com::sun::star::sdbc::XBlob
> SAL_CALL
327 sal_Int32 columnIndex
)
328 throw( com::sun::star::sdbc::SQLException
,
329 com::sun::star::uno::RuntimeException
)
331 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
332 return m_aItems
[m_nRow
]->getBlob( columnIndex
);
334 return com::sun::star::uno::Reference
< com::sun::star::sdbc::XBlob
>();
337 virtual com::sun::star::uno::Reference
<
338 com::sun::star::sdbc::XClob
> SAL_CALL
340 sal_Int32 columnIndex
)
341 throw( com::sun::star::sdbc::SQLException
,
342 com::sun::star::uno::RuntimeException
)
344 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
345 return m_aItems
[m_nRow
]->getClob( columnIndex
);
347 return com::sun::star::uno::Reference
<
348 com::sun::star::sdbc::XClob
>();
351 virtual com::sun::star::uno::Reference
<
352 com::sun::star::sdbc::XArray
> SAL_CALL
354 sal_Int32 columnIndex
)
355 throw( com::sun::star::sdbc::SQLException
,
356 com::sun::star::uno::RuntimeException
)
358 if( 0 <= m_nRow
&& m_nRow
< sal::static_int_cast
<sal_Int32
>(m_aItems
.size()) )
359 return m_aItems
[m_nRow
]->getArray( columnIndex
);
361 return com::sun::star::uno::Reference
<
362 com::sun::star::sdbc::XArray
>();
368 virtual sal_Bool SAL_CALL
371 throw( com::sun::star::sdbc::SQLException
,
372 com::sun::star::uno::RuntimeException
);
374 virtual sal_Bool SAL_CALL
377 throw( com::sun::star::sdbc::SQLException
,
378 com::sun::star::uno::RuntimeException
);
380 virtual sal_Bool SAL_CALL
383 throw( com::sun::star::sdbc::SQLException
,
384 com::sun::star::uno::RuntimeException
);
386 virtual sal_Bool SAL_CALL
389 throw( com::sun::star::sdbc::SQLException
,
390 com::sun::star::uno::RuntimeException
);
392 virtual sal_Bool SAL_CALL
395 throw( com::sun::star::sdbc::SQLException
,
396 com::sun::star::uno::RuntimeException
);
398 virtual void SAL_CALL
401 throw( com::sun::star::sdbc::SQLException
,
402 com::sun::star::uno::RuntimeException
);
404 virtual void SAL_CALL
407 throw( com::sun::star::sdbc::SQLException
,
408 com::sun::star::uno::RuntimeException
);
410 virtual sal_Bool SAL_CALL
413 throw( com::sun::star::sdbc::SQLException
,
414 com::sun::star::uno::RuntimeException
);
416 virtual sal_Bool SAL_CALL
419 throw( com::sun::star::sdbc::SQLException
,
420 com::sun::star::uno::RuntimeException
);
422 virtual sal_Int32 SAL_CALL
425 throw( com::sun::star::sdbc::SQLException
,
426 com::sun::star::uno::RuntimeException
);
428 virtual sal_Bool SAL_CALL
431 throw( com::sun::star::sdbc::SQLException
,
432 com::sun::star::uno::RuntimeException
);
434 virtual sal_Bool SAL_CALL
437 throw( com::sun::star::sdbc::SQLException
,
438 com::sun::star::uno::RuntimeException
);
440 virtual sal_Bool SAL_CALL
443 throw( com::sun::star::sdbc::SQLException
,
444 com::sun::star::uno::RuntimeException
);
446 virtual void SAL_CALL
449 throw( com::sun::star::sdbc::SQLException
,
450 com::sun::star::uno::RuntimeException
);
452 virtual sal_Bool SAL_CALL
455 throw( com::sun::star::sdbc::SQLException
,
456 com::sun::star::uno::RuntimeException
);
458 virtual sal_Bool SAL_CALL
461 throw( com::sun::star::sdbc::SQLException
,
462 com::sun::star::uno::RuntimeException
);
464 virtual sal_Bool SAL_CALL
467 throw( com::sun::star::sdbc::SQLException
,
468 com::sun::star::uno::RuntimeException
);
471 virtual com::sun::star::uno::Reference
<
472 com::sun::star::uno::XInterface
> SAL_CALL
475 throw( com::sun::star::sdbc::SQLException
,
476 com::sun::star::uno::RuntimeException
);
480 virtual void SAL_CALL
483 throw( com::sun::star::sdbc::SQLException
,
484 com::sun::star::uno::RuntimeException
);
488 virtual rtl::OUString SAL_CALL
489 queryContentIdentifierString(
491 throw( com::sun::star::uno::RuntimeException
);
493 virtual com::sun::star::uno::Reference
<
494 com::sun::star::ucb::XContentIdentifier
> SAL_CALL
495 queryContentIdentifier(
497 throw( com::sun::star::uno::RuntimeException
);
499 virtual com::sun::star::uno::Reference
<
500 com::sun::star::ucb::XContent
> SAL_CALL
503 throw( com::sun::star::uno::RuntimeException
);
505 // XResultSetMetaDataSupplier
506 virtual com::sun::star::uno::Reference
<
507 com::sun::star::sdbc::XResultSetMetaData
> SAL_CALL
510 throw( com::sun::star::sdbc::SQLException
,
511 com::sun::star::uno::RuntimeException
);
515 virtual com::sun::star::uno::Reference
<
516 com::sun::star::beans::XPropertySetInfo
> SAL_CALL
518 throw( com::sun::star::uno::RuntimeException
);
520 virtual void SAL_CALL
setPropertyValue(
521 const rtl::OUString
& aPropertyName
,
522 const com::sun::star::uno::Any
& aValue
)
523 throw( com::sun::star::beans::UnknownPropertyException
,
524 com::sun::star::beans::PropertyVetoException
,
525 com::sun::star::lang::IllegalArgumentException
,
526 com::sun::star::lang::WrappedTargetException
,
527 com::sun::star::uno::RuntimeException
);
529 virtual com::sun::star::uno::Any SAL_CALL
531 const rtl::OUString
& PropertyName
)
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 addPropertyChangeListener(
538 const rtl::OUString
& aPropertyName
,
539 const com::sun::star::uno::Reference
<
540 com::sun::star::beans::XPropertyChangeListener
>& xListener
)
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 removePropertyChangeListener(
547 const rtl::OUString
& aPropertyName
,
548 const com::sun::star::uno::Reference
<
549 com::sun::star::beans::XPropertyChangeListener
>& 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
555 addVetoableChangeListener(
556 const rtl::OUString
& PropertyName
,
557 const com::sun::star::uno::Reference
<
558 com::sun::star::beans::XVetoableChangeListener
>& aListener
)
559 throw( com::sun::star::beans::UnknownPropertyException
,
560 com::sun::star::lang::WrappedTargetException
,
561 com::sun::star::uno::RuntimeException
);
563 virtual void SAL_CALL
removeVetoableChangeListener(
564 const rtl::OUString
& PropertyName
,
565 const com::sun::star::uno::Reference
<
566 com::sun::star::beans::XVetoableChangeListener
>& aListener
)
567 throw( com::sun::star::beans::UnknownPropertyException
,
568 com::sun::star::lang::WrappedTargetException
,
569 com::sun::star::uno::RuntimeException
);
573 com::sun::star::uno::Reference
<
574 com::sun::star::lang::XMultiServiceFactory
> m_xMSF
;
575 com::sun::star::uno::Reference
<
576 com::sun::star::ucb::XContentProvider
> m_xProvider
;
579 sal_Int32 m_nOpenMode
;
580 sal_Bool m_bRowCountFinal
;
582 typedef std::vector
< com::sun::star::uno::Reference
<
583 com::sun::star::ucb::XContentIdentifier
> > IdentSet
;
584 typedef std::vector
< com::sun::star::uno::Reference
<
585 com::sun::star::sdbc::XRow
> > ItemSet
;
586 typedef std::vector
< rtl::OUString
>
593 com::sun::star::uno::Sequence
<
594 com::sun::star::beans::Property
> m_sProperty
;
595 com::sun::star::uno::Sequence
<
596 com::sun::star::ucb::NumberedSortingInfo
> m_sSortingInfo
;
599 cppu::OInterfaceContainerHelper
* m_pDisposeEventListeners
;
601 cppu::OInterfaceContainerHelper
* m_pRowCountListeners
;
602 cppu::OInterfaceContainerHelper
* m_pIsFinalListeners
;
606 } // end namespace fileaccess
611 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */