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