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 _CACHED_DYNAMIC_RESULTSET_STUB_HXX
25 #define _CACHED_DYNAMIC_RESULTSET_STUB_HXX
26 
27 #include <dynamicresultsetwrapper.hxx>
28 #include <com/sun/star/ucb/XCachedDynamicResultSetStubFactory.hpp>
29 
30 #define CACHED_DRS_STUB_SERVICE_NAME "com.sun.star.ucb.CachedDynamicResultSetStub"
31 #define CACHED_DRS_STUB_FACTORY_NAME "com.sun.star.ucb.CachedDynamicResultSetStubFactory"
32 
33 //=========================================================================
34 
35 class CachedDynamicResultSetStub
36 				: public DynamicResultSetWrapper
37 				, public com::sun::star::lang::XTypeProvider
38 				, public com::sun::star::lang::XServiceInfo
39 {
40 protected:
41 	virtual void SAL_CALL
42 	impl_InitResultSetOne( const com::sun::star::uno::Reference<
43 				com::sun::star::sdbc::XResultSet >& xResultSet );
44 	virtual void SAL_CALL
45 	impl_InitResultSetTwo( const com::sun::star::uno::Reference<
46 				com::sun::star::sdbc::XResultSet >& xResultSet );
47 
48 public:
49 	CachedDynamicResultSetStub( com::sun::star::uno::Reference<
50 						com::sun::star::ucb::XDynamicResultSet > xOrigin
51 		, const com::sun::star::uno::Reference<
52 						com::sun::star::lang::XMultiServiceFactory > & xSMgr );
53 
54 	virtual ~CachedDynamicResultSetStub();
55 
56 
57 	//-----------------------------------------------------------------
58 	// XInterface inherited
59 	//-----------------------------------------------------------------
60 	XINTERFACE_DECL()
61 	//-----------------------------------------------------------------
62 	// XTypeProvider
63 	//-----------------------------------------------------------------
64 	XTYPEPROVIDER_DECL()
65 	//-----------------------------------------------------------------
66     // XServiceInfo
67 	//-----------------------------------------------------------------
68 	XSERVICEINFO_NOFACTORY_DECL()
69 };
70 
71 //=========================================================================
72 
73 class CachedDynamicResultSetStubFactory
74 				: public cppu::OWeakObject
75 				, public com::sun::star::lang::XTypeProvider
76 				, public com::sun::star::lang::XServiceInfo
77 				, public com::sun::star::ucb::XCachedDynamicResultSetStubFactory
78 {
79 protected:
80 	com::sun::star::uno::Reference<
81 		com::sun::star::lang::XMultiServiceFactory >	m_xSMgr;
82 
83 public:
84 
85 	CachedDynamicResultSetStubFactory(
86 		const com::sun::star::uno::Reference<
87 		com::sun::star::lang::XMultiServiceFactory > & rSMgr);
88 
89 	virtual ~CachedDynamicResultSetStubFactory();
90 
91 	//-----------------------------------------------------------------
92 	// XInterface
93 	XINTERFACE_DECL()
94 
95 	//-----------------------------------------------------------------
96 	// XTypeProvider
97 	XTYPEPROVIDER_DECL()
98 
99 	//-----------------------------------------------------------------
100     // XServiceInfo
101 	XSERVICEINFO_DECL()
102 
103 	//-----------------------------------------------------------------
104     // XCachedDynamicResultSetStubFactory
105 
106 	virtual com::sun::star::uno::Reference<
107 		com::sun::star::ucb::XDynamicResultSet > SAL_CALL
108 	createCachedDynamicResultSetStub(
109 				const com::sun::star::uno::Reference<
110 					com::sun::star::ucb::XDynamicResultSet > & Source )
111 				throw( com::sun::star::uno::RuntimeException );
112 
113 
114 	virtual void SAL_CALL connectToCache(
115 				  const com::sun::star::uno::Reference<
116 						com::sun::star::ucb::XDynamicResultSet > & Source
117 				, const com::sun::star::uno::Reference<
118 						com::sun::star::ucb::XDynamicResultSet > & TargetCache
119 				, const com::sun::star::uno::Sequence<
120 						com::sun::star::ucb::NumberedSortingInfo > & SortingInfo
121 				, const com::sun::star::uno::Reference<
122 						com::sun::star::ucb::XAnyCompareFactory > & CompareFactory
123 				)
124 				throw (
125 				  com::sun::star::ucb::ListenerAlreadySetException
126 				, com::sun::star::ucb::AlreadyInitializedException
127 				, com::sun::star::uno::RuntimeException
128 				 );
129 };
130 
131 #endif
132 
133