merge the formfield patch from ooo-build
[ooovba.git] / ucb / source / ucp / gio / gio_datasupplier.hxx
blobc2f2ee12904af9fd00c5e335f50098aaaa5ffcab
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: gio_datasupplier.hxx,v $
10 * $Revision: 1.2 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef GIO_DATASUPPLIER_HXX
32 #define GIO_DATASUPPLIER_HXX
34 #include <ucbhelper/resultset.hxx>
35 #include "gio_content.hxx"
36 #include <vector>
38 namespace gio
41 class Content;
43 struct ResultListEntry
45 ::rtl::OUString aId;
46 com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > xId;
47 com::sun::star::uno::Reference< com::sun::star::ucb::XContent > xContent;
48 com::sun::star::uno::Reference< com::sun::star::sdbc::XRow > xRow;
49 GFileInfo *pInfo;
51 ResultListEntry( GFileInfo *pInInfo ) : pInfo(pInInfo)
53 g_object_ref( pInfo );
56 ~ResultListEntry()
58 g_object_unref( pInfo );
62 typedef std::vector< ResultListEntry* > ResultList;
64 class DataSupplier : public ucbhelper::ResultSetDataSupplier
66 private:
67 com::sun::star::uno::Reference< ::gio::Content > mxContent;
68 com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
69 sal_Int32 mnOpenMode;
70 bool mbCountFinal;
71 bool getData();
72 ResultList maResults;
73 public:
74 DataSupplier( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
75 const com::sun::star::uno::Reference< Content >& rContent, sal_Int32 nOpenMode );
76 virtual ~DataSupplier();
78 virtual rtl::OUString queryContentIdentifierString( sal_uInt32 nIndex );
79 virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >
80 queryContentIdentifier( sal_uInt32 nIndex );
81 virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContent >
82 queryContent( sal_uInt32 nIndex );
84 virtual sal_Bool getResult( sal_uInt32 nIndex );
86 virtual sal_uInt32 totalCount();
87 virtual sal_uInt32 currentCount();
88 virtual sal_Bool isCountFinal();
90 virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XRow >
91 queryPropertyValues( sal_uInt32 nIndex );
92 virtual void releasePropertyValues( sal_uInt32 nIndex );
94 virtual void close();
96 virtual void validate()
97 throw( com::sun::star::ucb::ResultSetException );
102 #endif