xref: /aoo42x/main/sc/inc/datauno.hxx (revision 38d50f7b)
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 SC_DATAUNO_HXX
25 #define SC_DATAUNO_HXX
26 
27 #include "global.hxx"
28 #include "queryparam.hxx"
29 
30 #include <com/sun/star/sheet/TableFilterField.hpp>
31 #include <com/sun/star/sheet/GeneralFunction.hpp>
32 #include <com/sun/star/sheet/XCellRangeReferrer.hpp>
33 #include <com/sun/star/sheet/XSheetFilterDescriptor.hpp>
34 #include <com/sun/star/sheet/XConsolidationDescriptor.hpp>
35 #include <com/sun/star/sheet/XDatabaseRanges.hpp>
36 #include <com/sun/star/sheet/XDatabaseRange.hpp>
37 #include <com/sun/star/sheet/XSubTotalDescriptor.hpp>
38 #include <com/sun/star/sheet/XSubTotalField.hpp>
39 #include <com/sun/star/lang/XServiceInfo.hpp>
40 #include <com/sun/star/container/XEnumerationAccess.hpp>
41 #include <com/sun/star/container/XIndexAccess.hpp>
42 #include <com/sun/star/beans/XPropertySet.hpp>
43 #include <com/sun/star/lang/XUnoTunnel.hpp>
44 #include <com/sun/star/container/XNamed.hpp>
45 #include <com/sun/star/util/XRefreshable.hpp>
46 #include <com/sun/star/sheet/XSheetFilterDescriptor2.hpp>
47 #include <cppuhelper/implbase2.hxx>
48 #include <cppuhelper/implbase3.hxx>
49 #include <cppuhelper/implbase4.hxx>
50 #include <cppuhelper/implbase5.hxx>
51 #include <cppuhelper/implbase6.hxx>
52 #include "svl/itemprop.hxx"
53 #include "svl/lstner.hxx"
54 
55 class ScDBData;
56 class ScDocShell;
57 
58 class ScSubTotalFieldObj;
59 class ScDatabaseRangeObj;
60 class ScDataPilotDescriptorBase;
61 
62 struct ScSortParam;
63 
64 typedef ::com::sun::star::uno::Reference<
65 			::com::sun::star::util::XRefreshListener >* XDBRefreshListenerPtr;
66 SV_DECL_PTRARR_DEL( XDBRefreshListenerArr_Impl, XDBRefreshListenerPtr, 4, 4 )
67 
68 class ScDataUnoConversion
69 {
70 public:
71 	static ScSubTotalFunc	GeneralToSubTotal( com::sun::star::sheet::GeneralFunction eSummary );
72 	static com::sun::star::sheet::GeneralFunction SubTotalToGeneral( ScSubTotalFunc eSubTotal );
73 };
74 
75 
76 //	ImportDescriptor gibt's nicht mehr als Uno-Objekt, nur noch Property-Sequence
77 
78 class ScImportDescriptor
79 {
80 public:
81 	static void	FillImportParam(
82 					ScImportParam& rParam,
83 					const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rSeq );
84 	static void	FillProperties(
85 					com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rSeq,
86 					const ScImportParam& rParam );
87 	static long GetPropertyCount();
88 };
89 
90 //	SortDescriptor gibt's nicht mehr als Uno-Objekt, nur noch Property-Sequence
91 
92 class ScSortDescriptor
93 {
94 public:
95 	static void	FillSortParam(
96 					ScSortParam& rParam,
97 					const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rSeq );
98 	static void	FillProperties(
99 					com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rSeq,
100 					const ScSortParam& rParam );
101 	static long GetPropertyCount();
102 };
103 
104 
105 //	ScSubTotalDescriptorBase - Basisklasse fuer SubTotalDescriptor alleine und im DB-Bereich
106 
107 //	to uno, both look the same
108 
109 class ScSubTotalDescriptorBase : public cppu::WeakImplHelper6<
110 										com::sun::star::sheet::XSubTotalDescriptor,
111 										com::sun::star::container::XEnumerationAccess,
112 										com::sun::star::container::XIndexAccess,
113 										com::sun::star::beans::XPropertySet,
114 										com::sun::star::lang::XUnoTunnel,
115 										com::sun::star::lang::XServiceInfo >
116 {
117 private:
118 	SfxItemPropertySet		aPropSet;
119 
120 	ScSubTotalFieldObj*		GetObjectByIndex_Impl(sal_uInt16 nIndex);
121 
122 public:
123 							ScSubTotalDescriptorBase();
124 	virtual					~ScSubTotalDescriptorBase();
125 
126 							// in derived classes:
127 							// (Fields are within the range)
128 	virtual void			GetData( ScSubTotalParam& rParam ) const = 0;
129 	virtual void			PutData( const ScSubTotalParam& rParam ) = 0;
130 
131 							// XSubTotalDescriptor
132 	virtual void SAL_CALL	addNew( const ::com::sun::star::uno::Sequence<
133 									::com::sun::star::sheet::SubTotalColumn >& aSubTotalColumns,
134 								sal_Int32 nGroupColumn )
135 									throw(::com::sun::star::uno::RuntimeException);
136 	virtual void SAL_CALL	clear() throw(::com::sun::star::uno::RuntimeException);
137 
138 							// XIndexAccess
139 	virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
140 	virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
141 								throw(::com::sun::star::lang::IndexOutOfBoundsException,
142 									::com::sun::star::lang::WrappedTargetException,
143 									::com::sun::star::uno::RuntimeException);
144 
145 							// XEnumerationAccess
146 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
147 							createEnumeration() throw(::com::sun::star::uno::RuntimeException);
148 
149 							// XElementAccess
150 	virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
151 								throw(::com::sun::star::uno::RuntimeException);
152 	virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
153 
154 							// XPropertySet
155 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
156 							SAL_CALL getPropertySetInfo()
157 								throw(::com::sun::star::uno::RuntimeException);
158 	virtual void SAL_CALL	setPropertyValue( const ::rtl::OUString& aPropertyName,
159 									const ::com::sun::star::uno::Any& aValue )
160 								throw(::com::sun::star::beans::UnknownPropertyException,
161 									::com::sun::star::beans::PropertyVetoException,
162 									::com::sun::star::lang::IllegalArgumentException,
163 									::com::sun::star::lang::WrappedTargetException,
164 									::com::sun::star::uno::RuntimeException);
165 	virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
166 									const ::rtl::OUString& PropertyName )
167 								throw(::com::sun::star::beans::UnknownPropertyException,
168 									::com::sun::star::lang::WrappedTargetException,
169 									::com::sun::star::uno::RuntimeException);
170 	virtual void SAL_CALL	addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
171 									const ::com::sun::star::uno::Reference<
172 										::com::sun::star::beans::XPropertyChangeListener >& xListener )
173 								throw(::com::sun::star::beans::UnknownPropertyException,
174 									::com::sun::star::lang::WrappedTargetException,
175 									::com::sun::star::uno::RuntimeException);
176 	virtual void SAL_CALL	removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
177 									const ::com::sun::star::uno::Reference<
178 										::com::sun::star::beans::XPropertyChangeListener >& aListener )
179 								throw(::com::sun::star::beans::UnknownPropertyException,
180 									::com::sun::star::lang::WrappedTargetException,
181 									::com::sun::star::uno::RuntimeException);
182 	virtual void SAL_CALL	addVetoableChangeListener( const ::rtl::OUString& PropertyName,
183 									const ::com::sun::star::uno::Reference<
184 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
185 								throw(::com::sun::star::beans::UnknownPropertyException,
186 									::com::sun::star::lang::WrappedTargetException,
187 									::com::sun::star::uno::RuntimeException);
188 	virtual void SAL_CALL	removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
189 									const ::com::sun::star::uno::Reference<
190 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
191 								throw(::com::sun::star::beans::UnknownPropertyException,
192 									::com::sun::star::lang::WrappedTargetException,
193 									::com::sun::star::uno::RuntimeException);
194 
195 							// XUnoTunnel
196 	virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
197 									sal_Int8 >& aIdentifier )
198 								throw(::com::sun::star::uno::RuntimeException);
199 
200 	static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
201 	static ScSubTotalDescriptorBase* getImplementation( const com::sun::star::uno::Reference<
202 									com::sun::star::sheet::XSubTotalDescriptor> xObj );
203 
204 							// XServiceInfo
205 	virtual ::rtl::OUString SAL_CALL getImplementationName()
206 								throw(::com::sun::star::uno::RuntimeException);
207 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
208 								throw(::com::sun::star::uno::RuntimeException);
209 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
210 								throw(::com::sun::star::uno::RuntimeException);
211 };
212 
213 
214 //	ScSubTotalDescriptor - dummer Container zur Benutzung mit XImportTarget
215 
216 class ScSubTotalDescriptor : public ScSubTotalDescriptorBase
217 {
218 private:
219 	ScSubTotalParam			aStoredParam;
220 
221 public:
222 							ScSubTotalDescriptor();
223 	virtual					~ScSubTotalDescriptor();
224 
225 							// von ScSubTotalDescriptorBase:
226 	virtual void			GetData( ScSubTotalParam& rParam ) const;
227 	virtual void			PutData( const ScSubTotalParam& rParam );
228 
229 							// Zugriff von aussen:
230 	void					SetParam( const ScSubTotalParam& rNew );
231 //	const ScSubTotalParam&	GetParam() const	{ return aStoredParam; }
232 };
233 
234 
235 //	ScRangeSubTotalDescriptor - SubTotalDescriptor eines Datenbank-Bereichs
236 
237 class ScRangeSubTotalDescriptor : public ScSubTotalDescriptorBase
238 {
239 private:
240 	ScDatabaseRangeObj*		pParent;
241 
242 public:
243 							ScRangeSubTotalDescriptor(ScDatabaseRangeObj* pPar);
244 	virtual					~ScRangeSubTotalDescriptor();
245 
246 							// von ScSubTotalDescriptorBase:
247 	virtual void			GetData( ScSubTotalParam& rParam ) const;
248 	virtual void			PutData( const ScSubTotalParam& rParam );
249 };
250 
251 
252 class ScSubTotalFieldObj : public cppu::WeakImplHelper2<
253 								com::sun::star::sheet::XSubTotalField,
254 								com::sun::star::lang::XServiceInfo >
255 {
256 private:
257 	com::sun::star::uno::Reference<com::sun::star::sheet::XSubTotalDescriptor> xRef;
258 	ScSubTotalDescriptorBase&	rParent;
259 	sal_uInt16						nPos;
260 
261 public:
262 							ScSubTotalFieldObj( ScSubTotalDescriptorBase* pDesc, sal_uInt16 nP );
263 	virtual					~ScSubTotalFieldObj();
264 
265 							// XSubTotalField
266 	virtual sal_Int32 SAL_CALL getGroupColumn() throw(::com::sun::star::uno::RuntimeException);
267 	virtual void SAL_CALL	setGroupColumn( sal_Int32 nGroupColumn )
268 								throw(::com::sun::star::uno::RuntimeException);
269 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::SubTotalColumn > SAL_CALL
270 							getSubTotalColumns() throw(::com::sun::star::uno::RuntimeException);
271 	virtual void SAL_CALL	setSubTotalColumns( const ::com::sun::star::uno::Sequence<
272 								::com::sun::star::sheet::SubTotalColumn >& aSubTotalColumns )
273 									throw(::com::sun::star::uno::RuntimeException);
274 
275 							// XServiceInfo
276 	virtual ::rtl::OUString SAL_CALL getImplementationName()
277 								throw(::com::sun::star::uno::RuntimeException);
278 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
279 								throw(::com::sun::star::uno::RuntimeException);
280 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
281 								throw(::com::sun::star::uno::RuntimeException);
282 };
283 
284 
285 class ScConsolidationDescriptor : public cppu::WeakImplHelper2<
286 										com::sun::star::sheet::XConsolidationDescriptor,
287 										com::sun::star::lang::XServiceInfo >
288 {
289 private:
290 	ScConsolidateParam		aParam;
291 
292 public:
293 							ScConsolidationDescriptor();
294 	virtual					~ScConsolidationDescriptor();
295 
296 	void					SetParam( const ScConsolidateParam& rNew );
GetParam() const297 	const ScConsolidateParam& GetParam() const	{ return aParam; }
298 
299 							// XConsolidationDescriptor
300 	virtual ::com::sun::star::sheet::GeneralFunction SAL_CALL getFunction()
301 								throw(::com::sun::star::uno::RuntimeException);
302 	virtual void SAL_CALL	setFunction( ::com::sun::star::sheet::GeneralFunction nFunction )
303 								throw(::com::sun::star::uno::RuntimeException);
304 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress > SAL_CALL
305 							getSources(  ) throw(::com::sun::star::uno::RuntimeException);
306 	virtual void SAL_CALL	setSources( const ::com::sun::star::uno::Sequence<
307 								::com::sun::star::table::CellRangeAddress >& aSources )
308 									throw(::com::sun::star::uno::RuntimeException);
309 	virtual ::com::sun::star::table::CellAddress SAL_CALL getStartOutputPosition()
310 								throw(::com::sun::star::uno::RuntimeException);
311 	virtual void SAL_CALL	setStartOutputPosition(
312 								const ::com::sun::star::table::CellAddress& aStartOutputPosition )
313 									throw(::com::sun::star::uno::RuntimeException);
314 	virtual sal_Bool SAL_CALL getUseColumnHeaders() throw(::com::sun::star::uno::RuntimeException);
315 	virtual void SAL_CALL	setUseColumnHeaders( sal_Bool bUseColumnHeaders )
316 								throw(::com::sun::star::uno::RuntimeException);
317 	virtual sal_Bool SAL_CALL getUseRowHeaders() throw(::com::sun::star::uno::RuntimeException);
318 	virtual void SAL_CALL	setUseRowHeaders( sal_Bool bUseRowHeaders )
319 								throw(::com::sun::star::uno::RuntimeException);
320 	virtual sal_Bool SAL_CALL getInsertLinks() throw(::com::sun::star::uno::RuntimeException);
321 	virtual void SAL_CALL	setInsertLinks( sal_Bool bInsertLinks )
322 								throw(::com::sun::star::uno::RuntimeException);
323 
324 							// XServiceInfo
325 	virtual ::rtl::OUString SAL_CALL getImplementationName()
326 								throw(::com::sun::star::uno::RuntimeException);
327 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
328 								throw(::com::sun::star::uno::RuntimeException);
329 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
330 								throw(::com::sun::star::uno::RuntimeException);
331 };
332 
333 
334 //	ScFilterDescriptorBase - Basisklasse fuer FilterDescriptor
335 //							 alleine, im DB-Bereich und im DataPilot
336 
337 //	to uno, all three look the same
338 
339 class ScFilterDescriptorBase : public cppu::WeakImplHelper4<
340 									com::sun::star::sheet::XSheetFilterDescriptor,
341                                     com::sun::star::sheet::XSheetFilterDescriptor2,
342 									com::sun::star::beans::XPropertySet,
343 									com::sun::star::lang::XServiceInfo >,
344 						       public SfxListener
345 {
346 private:
347 	SfxItemPropertySet		aPropSet;
348     ScDocShell*             pDocSh;
349 
350 public:
351 							ScFilterDescriptorBase(ScDocShell* pDocShell);
352 	virtual					~ScFilterDescriptorBase();
353 
354 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
355 
356 							// in den Ableitungen:
357 							// (nField[] hier innerhalb des Bereichs)
358 	virtual void			GetData( ScQueryParam& rParam ) const = 0;
359 	virtual void			PutData( const ScQueryParam& rParam ) = 0;
360 
361 							// XSheetFilterDescriptor
362 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TableFilterField > SAL_CALL
363 							getFilterFields() throw(::com::sun::star::uno::RuntimeException);
364 	virtual void SAL_CALL	setFilterFields( const ::com::sun::star::uno::Sequence<
365 								::com::sun::star::sheet::TableFilterField >& aFilterFields )
366 									throw(::com::sun::star::uno::RuntimeException);
367 
368                             // XSheetFilterDescriptor2
369     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TableFilterField2 > SAL_CALL
370                             getFilterFields2() throw(::com::sun::star::uno::RuntimeException);
371     virtual void SAL_CALL	setFilterFields2( const ::com::sun::star::uno::Sequence<
372                                 ::com::sun::star::sheet::TableFilterField2 >& aFilterFields )
373                                     throw(::com::sun::star::uno::RuntimeException);
374 
375 							// XPropertySet
376 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
377 							SAL_CALL getPropertySetInfo()
378 								throw(::com::sun::star::uno::RuntimeException);
379 	virtual void SAL_CALL	setPropertyValue( const ::rtl::OUString& aPropertyName,
380 									const ::com::sun::star::uno::Any& aValue )
381 								throw(::com::sun::star::beans::UnknownPropertyException,
382 									::com::sun::star::beans::PropertyVetoException,
383 									::com::sun::star::lang::IllegalArgumentException,
384 									::com::sun::star::lang::WrappedTargetException,
385 									::com::sun::star::uno::RuntimeException);
386 	virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
387 									const ::rtl::OUString& PropertyName )
388 								throw(::com::sun::star::beans::UnknownPropertyException,
389 									::com::sun::star::lang::WrappedTargetException,
390 									::com::sun::star::uno::RuntimeException);
391 	virtual void SAL_CALL	addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
392 									const ::com::sun::star::uno::Reference<
393 										::com::sun::star::beans::XPropertyChangeListener >& xListener )
394 								throw(::com::sun::star::beans::UnknownPropertyException,
395 									::com::sun::star::lang::WrappedTargetException,
396 									::com::sun::star::uno::RuntimeException);
397 	virtual void SAL_CALL	removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
398 									const ::com::sun::star::uno::Reference<
399 										::com::sun::star::beans::XPropertyChangeListener >& aListener )
400 								throw(::com::sun::star::beans::UnknownPropertyException,
401 									::com::sun::star::lang::WrappedTargetException,
402 									::com::sun::star::uno::RuntimeException);
403 	virtual void SAL_CALL	addVetoableChangeListener( const ::rtl::OUString& PropertyName,
404 									const ::com::sun::star::uno::Reference<
405 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
406 								throw(::com::sun::star::beans::UnknownPropertyException,
407 									::com::sun::star::lang::WrappedTargetException,
408 									::com::sun::star::uno::RuntimeException);
409 	virtual void SAL_CALL	removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
410 									const ::com::sun::star::uno::Reference<
411 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
412 								throw(::com::sun::star::beans::UnknownPropertyException,
413 									::com::sun::star::lang::WrappedTargetException,
414 									::com::sun::star::uno::RuntimeException);
415 
416 							// XServiceInfo
417 	virtual ::rtl::OUString SAL_CALL getImplementationName()
418 								throw(::com::sun::star::uno::RuntimeException);
419 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
420 								throw(::com::sun::star::uno::RuntimeException);
421 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
422 								throw(::com::sun::star::uno::RuntimeException);
423 };
424 
425 
426 //	ScFilterDescriptor - dummer Container zur Benutzung mit XFilterable
427 
428 class ScFilterDescriptor : public ScFilterDescriptorBase
429 {
430 private:
431 	ScQueryParam			aStoredParam;		// nField[] hier innerhalb des Bereichs
432 
433 public:
434 							ScFilterDescriptor(ScDocShell* pDocSh);
435 	virtual					~ScFilterDescriptor();
436 
437 							// von ScFilterDescriptorBase:
438 	virtual void			GetData( ScQueryParam& rParam ) const;
439 	virtual void			PutData( const ScQueryParam& rParam );
440 
441 							// Zugriff von aussen:
442 	void					SetParam( const ScQueryParam& rNew );
GetParam() const443 	const ScQueryParam&		GetParam() const	{ return aStoredParam; }
444 };
445 
446 
447 //	ScRangeFilterDescriptor - FilterDescriptor eines Datenbank-Bereichs
448 
449 class ScRangeFilterDescriptor : public ScFilterDescriptorBase
450 {
451 private:
452 	ScDatabaseRangeObj*		pParent;
453 
454 public:
455 							ScRangeFilterDescriptor(ScDocShell* pDocSh, ScDatabaseRangeObj* pPar);
456 	virtual					~ScRangeFilterDescriptor();
457 
458 							// von ScFilterDescriptorBase:
459 	virtual void			GetData( ScQueryParam& rParam ) const;
460 	virtual void			PutData( const ScQueryParam& rParam );
461 };
462 
463 
464 //	ScDataPilotFilterDescriptor - FilterDescriptor eines DataPilotDescriptors
465 
466 class ScDataPilotFilterDescriptor : public ScFilterDescriptorBase
467 {
468 private:
469 	ScDataPilotDescriptorBase*	pParent;
470 
471 public:
472 							ScDataPilotFilterDescriptor(ScDocShell* pDocSh, ScDataPilotDescriptorBase* pPar);
473 	virtual					~ScDataPilotFilterDescriptor();
474 
475 							// von ScFilterDescriptorBase:
476 	virtual void			GetData( ScQueryParam& rParam ) const;
477 	virtual void			PutData( const ScQueryParam& rParam );
478 };
479 
480 
481 class ScDatabaseRangeObj : public cppu::WeakImplHelper6<
482 								com::sun::star::sheet::XDatabaseRange,
483     							com::sun::star::util::XRefreshable,
484 								com::sun::star::container::XNamed,
485 								com::sun::star::sheet::XCellRangeReferrer,
486 								com::sun::star::beans::XPropertySet,
487 								com::sun::star::lang::XServiceInfo >,
488 						   public SfxListener
489 {
490 private:
491 	ScDocShell*				pDocShell;
492 	String					aName;
493 	SfxItemPropertySet		aPropSet;
494 	XDBRefreshListenerArr_Impl aRefreshListeners;
495 
496 private:
497 	ScDBData*				GetDBData_Impl() const;
498 	void					Refreshed_Impl();
499 
500 public:
501 							ScDatabaseRangeObj(ScDocShell* pDocSh, const String& rNm);
502 	virtual					~ScDatabaseRangeObj();
503 
504 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
505 
506 							// nField[] hier innerhalb des Bereichs:
507 	void					GetQueryParam(ScQueryParam& rQueryParam) const;
508 	void					SetQueryParam(const ScQueryParam& rQueryParam);
509 	void					GetSubTotalParam(ScSubTotalParam& rSubTotalParam) const;
510 	void					SetSubTotalParam(const ScSubTotalParam& rSubTotalParam);
511 
512                             // XNamed
513 	virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
514 	virtual void SAL_CALL	setName( const ::rtl::OUString& aName )
515 								throw(::com::sun::star::uno::RuntimeException);
516 
517 							// XDatabaseRange
518     virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getDataArea()
519     							throw(::com::sun::star::uno::RuntimeException);
520     virtual void SAL_CALL	setDataArea( const ::com::sun::star::table::CellRangeAddress& aDataArea )
521     							throw(::com::sun::star::uno::RuntimeException);
522     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
523     						getSortDescriptor() throw(::com::sun::star::uno::RuntimeException);
524     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor > SAL_CALL
525     						getFilterDescriptor() throw(::com::sun::star::uno::RuntimeException);
526     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSubTotalDescriptor > SAL_CALL
527     						getSubTotalDescriptor() throw(::com::sun::star::uno::RuntimeException);
528     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
529     						getImportDescriptor() throw(::com::sun::star::uno::RuntimeException);
530 // implemented for the XRefreshable Interface
531 //    virtual void SAL_CALL	refresh() throw(::com::sun::star::uno::RuntimeException);
532 
533 							// XRefreshable
534 	virtual void SAL_CALL	refresh() throw(::com::sun::star::uno::RuntimeException);
535 	virtual void SAL_CALL	addRefreshListener( const ::com::sun::star::uno::Reference<
536 									::com::sun::star::util::XRefreshListener >& l )
537 								throw(::com::sun::star::uno::RuntimeException);
538 	virtual void SAL_CALL	removeRefreshListener( const ::com::sun::star::uno::Reference<
539 									::com::sun::star::util::XRefreshListener >& l )
540 								throw(::com::sun::star::uno::RuntimeException);
541 
542 							// XCellRangeReferrer
543 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
544 							getReferredCells() throw(::com::sun::star::uno::RuntimeException);
545 
546 							// XPropertySet
547 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
548 							SAL_CALL getPropertySetInfo()
549 								throw(::com::sun::star::uno::RuntimeException);
550 	virtual void SAL_CALL	setPropertyValue( const ::rtl::OUString& aPropertyName,
551 									const ::com::sun::star::uno::Any& aValue )
552 								throw(::com::sun::star::beans::UnknownPropertyException,
553 									::com::sun::star::beans::PropertyVetoException,
554 									::com::sun::star::lang::IllegalArgumentException,
555 									::com::sun::star::lang::WrappedTargetException,
556 									::com::sun::star::uno::RuntimeException);
557 	virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
558 									const ::rtl::OUString& PropertyName )
559 								throw(::com::sun::star::beans::UnknownPropertyException,
560 									::com::sun::star::lang::WrappedTargetException,
561 									::com::sun::star::uno::RuntimeException);
562 	virtual void SAL_CALL	addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
563 									const ::com::sun::star::uno::Reference<
564 										::com::sun::star::beans::XPropertyChangeListener >& xListener )
565 								throw(::com::sun::star::beans::UnknownPropertyException,
566 									::com::sun::star::lang::WrappedTargetException,
567 									::com::sun::star::uno::RuntimeException);
568 	virtual void SAL_CALL	removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
569 									const ::com::sun::star::uno::Reference<
570 										::com::sun::star::beans::XPropertyChangeListener >& aListener )
571 								throw(::com::sun::star::beans::UnknownPropertyException,
572 									::com::sun::star::lang::WrappedTargetException,
573 									::com::sun::star::uno::RuntimeException);
574 	virtual void SAL_CALL	addVetoableChangeListener( const ::rtl::OUString& PropertyName,
575 									const ::com::sun::star::uno::Reference<
576 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
577 								throw(::com::sun::star::beans::UnknownPropertyException,
578 									::com::sun::star::lang::WrappedTargetException,
579 									::com::sun::star::uno::RuntimeException);
580 	virtual void SAL_CALL	removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
581 									const ::com::sun::star::uno::Reference<
582 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
583 								throw(::com::sun::star::beans::UnknownPropertyException,
584 									::com::sun::star::lang::WrappedTargetException,
585 									::com::sun::star::uno::RuntimeException);
586 
587 							// XServiceInfo
588 	virtual ::rtl::OUString SAL_CALL getImplementationName()
589 								throw(::com::sun::star::uno::RuntimeException);
590 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
591 								throw(::com::sun::star::uno::RuntimeException);
592 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
593 								throw(::com::sun::star::uno::RuntimeException);
594 };
595 
596 
597 class ScDatabaseRangesObj : public cppu::WeakImplHelper4<
598 								com::sun::star::sheet::XDatabaseRanges,
599 								com::sun::star::container::XEnumerationAccess,
600 								com::sun::star::container::XIndexAccess,
601 								com::sun::star::lang::XServiceInfo >,
602 						    public SfxListener
603 {
604 private:
605 	ScDocShell*				pDocShell;
606 
607 	ScDatabaseRangeObj*		GetObjectByIndex_Impl(sal_uInt16 nIndex);
608 	ScDatabaseRangeObj*		GetObjectByName_Impl(const ::rtl::OUString& aName);
609 
610 public:
611 							ScDatabaseRangesObj(ScDocShell* pDocSh);
612 	virtual					~ScDatabaseRangesObj();
613 
614 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
615 
616 							// XDatabaseRanges
617 	virtual void SAL_CALL	addNewByName( const ::rtl::OUString& aName,
618 								const ::com::sun::star::table::CellRangeAddress& aRange )
619 									throw(::com::sun::star::uno::RuntimeException);
620 	virtual void SAL_CALL	removeByName( const ::rtl::OUString& aName )
621 								throw(::com::sun::star::uno::RuntimeException);
622 
623 							// XEnumerationAccess
624 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
625 							createEnumeration() throw(::com::sun::star::uno::RuntimeException);
626 
627 							// XIndexAccess
628 	virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
629 	virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
630 								throw(::com::sun::star::lang::IndexOutOfBoundsException,
631 									::com::sun::star::lang::WrappedTargetException,
632 									::com::sun::star::uno::RuntimeException);
633 
634 							// XElementAccess
635 	virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
636 								throw(::com::sun::star::uno::RuntimeException);
637 	virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
638 
639 							// XNameAccess
640 	virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
641 								throw(::com::sun::star::container::NoSuchElementException,
642 									::com::sun::star::lang::WrappedTargetException,
643 									::com::sun::star::uno::RuntimeException);
644 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
645 								throw(::com::sun::star::uno::RuntimeException);
646 	virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
647 								throw(::com::sun::star::uno::RuntimeException);
648 
649 							// XServiceInfo
650 	virtual ::rtl::OUString SAL_CALL getImplementationName()
651 								throw(::com::sun::star::uno::RuntimeException);
652 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
653 								throw(::com::sun::star::uno::RuntimeException);
654 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
655 								throw(::com::sun::star::uno::RuntimeException);
656 };
657 
658 
659 
660 #endif
661 
662