xref: /trunk/main/ucb/source/cacher/cacheddynamicresultset.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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_HXX
25 #define _CACHED_DYNAMIC_RESULTSET_HXX
26 
27 #include <dynamicresultsetwrapper.hxx>
28 #include <com/sun/star/ucb/XContentIdentifierMapping.hpp>
29 #include <com/sun/star/ucb/XCachedDynamicResultSetFactory.hpp>
30 
31 #define CACHED_DRS_SERVICE_NAME "com.sun.star.ucb.CachedDynamicResultSet"
32 #define CACHED_DRS_FACTORY_NAME "com.sun.star.ucb.CachedDynamicResultSetFactory"
33 
34 //=========================================================================
35 
36 class CachedDynamicResultSet
37                 : public DynamicResultSetWrapper
38                 , public com::sun::star::lang::XTypeProvider
39                 , public com::sun::star::lang::XServiceInfo
40 {
41     com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifierMapping >
42                             m_xContentIdentifierMapping;
43 
44 protected:
45     virtual void SAL_CALL
46     impl_InitResultSetOne( const com::sun::star::uno::Reference<
47                 com::sun::star::sdbc::XResultSet >& xResultSet );
48     virtual void SAL_CALL
49     impl_InitResultSetTwo( const com::sun::star::uno::Reference<
50                 com::sun::star::sdbc::XResultSet >& xResultSet );
51 
52 public:
53     CachedDynamicResultSet( com::sun::star::uno::Reference<
54                         com::sun::star::ucb::XDynamicResultSet > xOrigin
55         , const com::sun::star::uno::Reference<
56                         com::sun::star::ucb::XContentIdentifierMapping > & xContentMapping
57         , const com::sun::star::uno::Reference<
58                         com::sun::star::lang::XMultiServiceFactory > & xSMgr );
59 
60     virtual ~CachedDynamicResultSet();
61 
62 
63     //-----------------------------------------------------------------
64     // XInterface inherited
65     //-----------------------------------------------------------------
66     XINTERFACE_DECL()
67     //-----------------------------------------------------------------
68     // XTypeProvider
69     //-----------------------------------------------------------------
70     XTYPEPROVIDER_DECL()
71     //-----------------------------------------------------------------
72     // XServiceInfo
73     //-----------------------------------------------------------------
74     XSERVICEINFO_NOFACTORY_DECL()
75 
76     //-----------------------------------------------------------------
77     // own methods ( inherited )
78     //-----------------------------------------------------------------
79     virtual void SAL_CALL
80     impl_disposing( const com::sun::star::lang::EventObject& Source );
81 };
82 
83 //=========================================================================
84 
85 class CachedDynamicResultSetFactory
86                 : public cppu::OWeakObject
87                 , public com::sun::star::lang::XTypeProvider
88                 , public com::sun::star::lang::XServiceInfo
89                 , public com::sun::star::ucb::XCachedDynamicResultSetFactory
90 {
91 protected:
92     com::sun::star::uno::Reference<
93         com::sun::star::lang::XMultiServiceFactory >    m_xSMgr;
94 
95 public:
96 
97     CachedDynamicResultSetFactory(
98         const com::sun::star::uno::Reference<
99         com::sun::star::lang::XMultiServiceFactory > & rSMgr);
100 
101     virtual ~CachedDynamicResultSetFactory();
102 
103     //-----------------------------------------------------------------
104     // XInterface
105     XINTERFACE_DECL()
106 
107     //-----------------------------------------------------------------
108     // XTypeProvider
109     XTYPEPROVIDER_DECL()
110 
111     //-----------------------------------------------------------------
112     // XServiceInfo
113     XSERVICEINFO_DECL()
114 
115     //-----------------------------------------------------------------
116     // XCachedDynamicResultSetFactory
117 
118     virtual com::sun::star::uno::Reference<
119                 com::sun::star::ucb::XDynamicResultSet > SAL_CALL
120     createCachedDynamicResultSet(
121                   const com::sun::star::uno::Reference<
122                     com::sun::star::ucb::XDynamicResultSet > &
123                         SourceStub
124                 , const com::sun::star::uno::Reference<
125                     com::sun::star::ucb::XContentIdentifierMapping > &
126                         ContentIdentifierMapping
127                 );
128 };
129 
130 #endif
131