1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef INCLUDED_TDOC_DATASUPPLIER_HXX
29 #define INCLUDED_TDOC_DATASUPPLIER_HXX
30 
31 #include <rtl/ref.hxx>
32 #include <com/sun/star/ucb/OpenMode.hpp>
33 #include <ucbhelper/resultset.hxx>
34 
35 namespace tdoc_ucp {
36 
37 struct DataSupplier_Impl;
38 class Content;
39 
40 class ResultSetDataSupplier : public ::ucbhelper::ResultSetDataSupplier
41 {
42 	DataSupplier_Impl*	m_pImpl;
43 
44 private:
45     bool queryNamesOfChildren();
46     ::rtl::OUString assembleChildURL( const ::rtl::OUString& aName );
47 
48 public:
49     ResultSetDataSupplier(
50         const com::sun::star::uno::Reference<
51             com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
52         const rtl::Reference< Content >& rContent,
53             sal_Int32 nOpenMode = com::sun::star::ucb::OpenMode::ALL );
54     virtual ~ResultSetDataSupplier();
55 
56 	virtual rtl::OUString queryContentIdentifierString( sal_uInt32 nIndex );
57 	virtual com::sun::star::uno::Reference<
58 				com::sun::star::ucb::XContentIdentifier >
59 	queryContentIdentifier( sal_uInt32 nIndex );
60 	virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContent >
61 	queryContent( sal_uInt32 nIndex );
62 
63 	virtual sal_Bool getResult( sal_uInt32 nIndex );
64 
65 	virtual sal_uInt32 totalCount();
66 	virtual sal_uInt32 currentCount();
67     virtual sal_Bool   isCountFinal();
68 
69 	virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XRow >
70 	queryPropertyValues( sal_uInt32 nIndex  );
71 	virtual void releasePropertyValues( sal_uInt32 nIndex );
72 
73 	virtual void close();
74 
75 	virtual void validate()
76 		throw( com::sun::star::ucb::ResultSetException );
77 };
78 
79 } // namespace tdoc_ucp
80 
81 #endif /* !INCLUDED_TDOC_DATASUPPLIER_HXX */
82