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 _HIERARCHYDATASUPPLIER_HXX
29 #define _HIERARCHYDATASUPPLIER_HXX
30 
31 #include <rtl/ref.hxx>
32 #include <com/sun/star/ucb/OpenMode.hpp>
33 #include <ucbhelper/resultset.hxx>
34 
35 namespace hierarchy_ucp {
36 
37 class HierarchyEntryData;
38 struct DataSupplier_Impl;
39 class HierarchyContent;
40 
41 class HierarchyResultSetDataSupplier :
42         public ::ucbhelper::ResultSetDataSupplier
43 {
44 	DataSupplier_Impl*	m_pImpl;
45 
46 private:
47 	sal_Bool checkResult( const HierarchyEntryData& rResult );
48 
49 public:
50 	HierarchyResultSetDataSupplier(
51 					const com::sun::star::uno::Reference<
52 						com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
53                     const rtl::Reference< HierarchyContent >& rContent,
54 					sal_Int32 nOpenMode = com::sun::star::ucb::OpenMode::ALL );
55 	virtual ~HierarchyResultSetDataSupplier();
56 
57 	virtual rtl::OUString queryContentIdentifierString( sal_uInt32 nIndex );
58 	virtual com::sun::star::uno::Reference<
59 				com::sun::star::ucb::XContentIdentifier >
60 	queryContentIdentifier( sal_uInt32 nIndex );
61 	virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContent >
62 	queryContent( sal_uInt32 nIndex );
63 
64 	virtual sal_Bool getResult( sal_uInt32 nIndex );
65 
66 	virtual sal_uInt32 totalCount();
67 	virtual sal_uInt32 currentCount();
68 	virtual sal_Bool isCountFinal();
69 
70 	virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XRow >
71 	queryPropertyValues( sal_uInt32 nIndex  );
72 	virtual void releasePropertyValues( sal_uInt32 nIndex );
73 
74 	virtual void close();
75 
76 	virtual void validate()
77 		throw( com::sun::star::ucb::ResultSetException );
78 };
79 
80 } // namespace hierarchy_ucp
81 
82 #endif /* !_HIERARCHYDATASUPPLIER_HXX */
83