1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef UCB_UCPEXT_DATA_SUPPLIER_HXX
25 #define UCB_UCPEXT_DATA_SUPPLIER_HXX
26 
27 #include <rtl/ref.hxx>
28 #include <ucbhelper/resultset.hxx>
29 
30 #include <boost/scoped_ptr.hpp>
31 
32 //......................................................................................................................
33 namespace ucb { namespace ucp { namespace ext
34 {
35 //......................................................................................................................
36 
37     struct DataSupplier_Impl;
38     class Content;
39 
40     //==================================================================================================================
41     //= DataSupplier
42     //==================================================================================================================
43     typedef ::ucbhelper::ResultSetDataSupplier  DataSupplier_Base;
44     class DataSupplier : public ::ucbhelper::ResultSetDataSupplier
45     {
46     public:
47 	    DataSupplier(
48             const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& i_rORB,
49             const rtl::Reference< Content >& rContent,
50 			const sal_Int32 nOpenMode
51         );
52 
53         void    fetchData();
54 
55     protected:
56 	    virtual ~DataSupplier();
57 
58 	    virtual rtl::OUString queryContentIdentifierString( sal_uInt32 nIndex );
59 	    virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > queryContentIdentifier( sal_uInt32 nIndex );
60 	    virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContent > queryContent( sal_uInt32 nIndex );
61 
62 	    virtual sal_Bool getResult( sal_uInt32 nIndex );
63 
64 	    virtual sal_uInt32 totalCount();
65 	    virtual sal_uInt32 currentCount();
66 	    virtual sal_Bool isCountFinal();
67 
68 	    virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XRow > queryPropertyValues( sal_uInt32 nIndex  );
69 	    virtual void releasePropertyValues( sal_uInt32 nIndex );
70 
71 	    virtual void close();
72 
73 	    virtual void validate() throw( com::sun::star::ucb::ResultSetException );
74 
75     private:
76         ::boost::scoped_ptr< DataSupplier_Impl >    m_pImpl;
77     };
78 
79 //......................................................................................................................
80 } } }   // namespace ucp::ext
81 //......................................................................................................................
82 
83 #endif  // UCB_UCPEXT_DATA_SUPPLIER_HXX
84