update credits
[LibreOffice.git] / sc / inc / datauno.hxx
blobda1e88495be393e249370c69d627baf841703794
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_INC_DATAUNO_HXX
21 #define INCLUDED_SC_INC_DATAUNO_HXX
23 #include "global.hxx"
24 #include "queryparam.hxx"
25 #include "subtotalparam.hxx"
27 #include <com/sun/star/sheet/TableFilterField.hpp>
28 #include <com/sun/star/sheet/GeneralFunction.hpp>
29 #include <com/sun/star/sheet/XCellRangeReferrer.hpp>
30 #include <com/sun/star/sheet/XSheetFilterDescriptor.hpp>
31 #include <com/sun/star/sheet/XSheetFilterDescriptor2.hpp>
32 #include <com/sun/star/sheet/XSheetFilterDescriptor3.hpp>
33 #include <com/sun/star/sheet/XConsolidationDescriptor.hpp>
34 #include <com/sun/star/sheet/XDatabaseRanges.hpp>
35 #include <com/sun/star/sheet/XDatabaseRange.hpp>
36 #include <com/sun/star/sheet/XUnnamedDatabaseRanges.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 <cppuhelper/implbase2.hxx>
47 #include <cppuhelper/implbase3.hxx>
48 #include <cppuhelper/implbase4.hxx>
49 #include <cppuhelper/implbase5.hxx>
50 #include <cppuhelper/implbase6.hxx>
51 #include <svl/itemprop.hxx>
52 #include <svl/lstner.hxx>
53 #include <boost/ptr_container/ptr_vector.hpp>
55 class ScDBData;
56 class ScDocShell;
58 class ScSubTotalFieldObj;
59 class ScDatabaseRangeObj;
60 class ScDataPilotDescriptorBase;
62 struct ScSortParam;
64 typedef ::com::sun::star::uno::Reference<
65 ::com::sun::star::util::XRefreshListener > XDBRefreshListenerRef;
66 typedef boost::ptr_vector<XDBRefreshListenerRef> XDBRefreshListenerArr_Impl;
68 class ScDataUnoConversion
70 public:
71 static com::sun::star::sheet::GeneralFunction SubTotalToGeneral( ScSubTotalFunc eSubTotal );
74 // ImportDescriptor is not available as Uno-Objekt any longer, only Property-Sequence
76 class ScImportDescriptor
78 public:
79 static void FillImportParam(
80 ScImportParam& rParam,
81 const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rSeq );
82 static void FillProperties(
83 com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rSeq,
84 const ScImportParam& rParam );
85 static long GetPropertyCount() { return 4; }
88 // SortDescriptor is not available as Uno-Objekt any longer, only Property-Sequence
90 class ScSortDescriptor
92 public:
93 static void FillSortParam(
94 ScSortParam& rParam,
95 const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rSeq );
96 static void FillProperties(
97 com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rSeq,
98 const ScSortParam& rParam );
99 //! SortAscending muss aus der SheetSortDescriptor service-Beschreibung raus
100 static long GetPropertyCount()
102 return 9; // TableSortDescriptor and SheetSortDescriptor
107 // ScSubTotalDescriptorBase - base class for SubTotalDescriptor stand alone and in DB area (context?)
109 // to uno, both look the same
111 class ScSubTotalDescriptorBase : public cppu::WeakImplHelper6<
112 com::sun::star::sheet::XSubTotalDescriptor,
113 com::sun::star::container::XEnumerationAccess,
114 com::sun::star::container::XIndexAccess,
115 com::sun::star::beans::XPropertySet,
116 com::sun::star::lang::XUnoTunnel,
117 com::sun::star::lang::XServiceInfo >
119 private:
120 SfxItemPropertySet aPropSet;
122 ScSubTotalFieldObj* GetObjectByIndex_Impl(sal_uInt16 nIndex);
124 public:
125 ScSubTotalDescriptorBase();
126 virtual ~ScSubTotalDescriptorBase();
128 // in derived classes:
129 // (Fields are within the range)
130 virtual void GetData( ScSubTotalParam& rParam ) const = 0;
131 virtual void PutData( const ScSubTotalParam& rParam ) = 0;
133 // XSubTotalDescriptor
134 virtual void SAL_CALL addNew( const ::com::sun::star::uno::Sequence<
135 ::com::sun::star::sheet::SubTotalColumn >& aSubTotalColumns,
136 sal_Int32 nGroupColumn )
137 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
138 virtual void SAL_CALL clear() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
140 // XIndexAccess
141 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
142 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
143 throw(::com::sun::star::lang::IndexOutOfBoundsException,
144 ::com::sun::star::lang::WrappedTargetException,
145 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
147 // XEnumerationAccess
148 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
149 createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
151 // XElementAccess
152 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
153 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
154 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
156 // XPropertySet
157 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
158 SAL_CALL getPropertySetInfo()
159 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
160 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
161 const ::com::sun::star::uno::Any& aValue )
162 throw(::com::sun::star::beans::UnknownPropertyException,
163 ::com::sun::star::beans::PropertyVetoException,
164 ::com::sun::star::lang::IllegalArgumentException,
165 ::com::sun::star::lang::WrappedTargetException,
166 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
167 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
168 const OUString& PropertyName )
169 throw(::com::sun::star::beans::UnknownPropertyException,
170 ::com::sun::star::lang::WrappedTargetException,
171 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
172 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
173 const ::com::sun::star::uno::Reference<
174 ::com::sun::star::beans::XPropertyChangeListener >& xListener )
175 throw(::com::sun::star::beans::UnknownPropertyException,
176 ::com::sun::star::lang::WrappedTargetException,
177 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
178 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
179 const ::com::sun::star::uno::Reference<
180 ::com::sun::star::beans::XPropertyChangeListener >& aListener )
181 throw(::com::sun::star::beans::UnknownPropertyException,
182 ::com::sun::star::lang::WrappedTargetException,
183 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
184 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
185 const ::com::sun::star::uno::Reference<
186 ::com::sun::star::beans::XVetoableChangeListener >& aListener )
187 throw(::com::sun::star::beans::UnknownPropertyException,
188 ::com::sun::star::lang::WrappedTargetException,
189 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
190 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
191 const ::com::sun::star::uno::Reference<
192 ::com::sun::star::beans::XVetoableChangeListener >& aListener )
193 throw(::com::sun::star::beans::UnknownPropertyException,
194 ::com::sun::star::lang::WrappedTargetException,
195 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
197 // XUnoTunnel
198 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
199 sal_Int8 >& aIdentifier )
200 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
202 static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
203 static ScSubTotalDescriptorBase* getImplementation(const css::uno::Reference<css::sheet::XSubTotalDescriptor>& rObj);
205 // XServiceInfo
206 virtual OUString SAL_CALL getImplementationName()
207 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
208 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
209 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
210 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
211 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
214 // ScSubTotalDescriptor - dummy container to use with XImportTarget
216 class ScSubTotalDescriptor : public ScSubTotalDescriptorBase
218 private:
219 ScSubTotalParam aStoredParam;
221 public:
222 ScSubTotalDescriptor();
223 virtual ~ScSubTotalDescriptor();
225 // from ScSubTotalDescriptorBase:
226 virtual void GetData( ScSubTotalParam& rParam ) const SAL_OVERRIDE;
227 virtual void PutData( const ScSubTotalParam& rParam ) SAL_OVERRIDE;
229 // external access:
230 void SetParam( const ScSubTotalParam& rNew );
233 // ScRangeSubTotalDescriptor - SubTotalDescriptor of a data base area
235 class ScRangeSubTotalDescriptor : public ScSubTotalDescriptorBase
237 private:
238 ScDatabaseRangeObj* pParent;
240 public:
241 ScRangeSubTotalDescriptor(ScDatabaseRangeObj* pPar);
242 virtual ~ScRangeSubTotalDescriptor();
244 // from ScSubTotalDescriptorBase:
245 virtual void GetData( ScSubTotalParam& rParam ) const SAL_OVERRIDE;
246 virtual void PutData( const ScSubTotalParam& rParam ) SAL_OVERRIDE;
249 class ScSubTotalFieldObj : public cppu::WeakImplHelper2<
250 com::sun::star::sheet::XSubTotalField,
251 com::sun::star::lang::XServiceInfo >
253 private:
254 com::sun::star::uno::Reference<com::sun::star::sheet::XSubTotalDescriptor> xRef;
255 ScSubTotalDescriptorBase& rParent;
256 sal_uInt16 nPos;
258 public:
259 ScSubTotalFieldObj( ScSubTotalDescriptorBase* pDesc, sal_uInt16 nP );
260 virtual ~ScSubTotalFieldObj();
262 // XSubTotalField
263 virtual sal_Int32 SAL_CALL getGroupColumn() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
264 virtual void SAL_CALL setGroupColumn( sal_Int32 nGroupColumn )
265 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
266 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::SubTotalColumn > SAL_CALL
267 getSubTotalColumns() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
268 virtual void SAL_CALL setSubTotalColumns( const ::com::sun::star::uno::Sequence<
269 ::com::sun::star::sheet::SubTotalColumn >& aSubTotalColumns )
270 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
272 // XServiceInfo
273 virtual OUString SAL_CALL getImplementationName()
274 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
275 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
276 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
277 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
278 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
281 class ScConsolidationDescriptor : public cppu::WeakImplHelper2<
282 com::sun::star::sheet::XConsolidationDescriptor,
283 com::sun::star::lang::XServiceInfo >
285 private:
286 ScConsolidateParam aParam;
288 public:
289 ScConsolidationDescriptor();
290 virtual ~ScConsolidationDescriptor();
292 void SetParam( const ScConsolidateParam& rNew );
293 const ScConsolidateParam& GetParam() const { return aParam; }
295 // XConsolidationDescriptor
296 virtual ::com::sun::star::sheet::GeneralFunction SAL_CALL getFunction()
297 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
298 virtual void SAL_CALL setFunction( ::com::sun::star::sheet::GeneralFunction nFunction )
299 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
300 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress > SAL_CALL
301 getSources( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
302 virtual void SAL_CALL setSources( const ::com::sun::star::uno::Sequence<
303 ::com::sun::star::table::CellRangeAddress >& aSources )
304 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
305 virtual ::com::sun::star::table::CellAddress SAL_CALL getStartOutputPosition()
306 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
307 virtual void SAL_CALL setStartOutputPosition(
308 const ::com::sun::star::table::CellAddress& aStartOutputPosition )
309 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
310 virtual sal_Bool SAL_CALL getUseColumnHeaders() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
311 virtual void SAL_CALL setUseColumnHeaders( sal_Bool bUseColumnHeaders )
312 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
313 virtual sal_Bool SAL_CALL getUseRowHeaders() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
314 virtual void SAL_CALL setUseRowHeaders( sal_Bool bUseRowHeaders )
315 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
316 virtual sal_Bool SAL_CALL getInsertLinks() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
317 virtual void SAL_CALL setInsertLinks( sal_Bool bInsertLinks )
318 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
320 // XServiceInfo
321 virtual OUString SAL_CALL getImplementationName()
322 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
323 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
324 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
325 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
326 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
329 // ScFilterDescriptorBase - base class for FilterDescriptor
330 // stand alone, in a DB area (or context?) and in the DataPilot
332 // to uno, all three look the same
334 class ScFilterDescriptorBase : public cppu::WeakImplHelper5<
335 com::sun::star::sheet::XSheetFilterDescriptor,
336 com::sun::star::sheet::XSheetFilterDescriptor2,
337 com::sun::star::sheet::XSheetFilterDescriptor3,
338 com::sun::star::beans::XPropertySet,
339 com::sun::star::lang::XServiceInfo >,
340 public SfxListener
342 private:
343 SfxItemPropertySet aPropSet;
344 ScDocShell* pDocSh;
346 public:
347 ScFilterDescriptorBase(ScDocShell* pDocShell);
348 virtual ~ScFilterDescriptorBase();
350 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
352 // in the derived classes(?):
353 // (nField[] here within the area)
354 virtual void GetData( ScQueryParam& rParam ) const = 0;
355 virtual void PutData( const ScQueryParam& rParam ) = 0;
357 // XSheetFilterDescriptor
358 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TableFilterField > SAL_CALL
359 getFilterFields() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
360 virtual void SAL_CALL setFilterFields( const ::com::sun::star::uno::Sequence<
361 ::com::sun::star::sheet::TableFilterField >& aFilterFields )
362 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
364 // XSheetFilterDescriptor2
365 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TableFilterField2 > SAL_CALL
366 getFilterFields2() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
367 virtual void SAL_CALL setFilterFields2( const ::com::sun::star::uno::Sequence<
368 ::com::sun::star::sheet::TableFilterField2 >& aFilterFields )
369 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
371 // XSheetFilterDescriptor3
372 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TableFilterField3 > SAL_CALL
373 getFilterFields3() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
374 virtual void SAL_CALL setFilterFields3( const ::com::sun::star::uno::Sequence<
375 ::com::sun::star::sheet::TableFilterField3 >& aFilterFields )
376 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
378 // XPropertySet
379 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
380 SAL_CALL getPropertySetInfo()
381 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
382 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
383 const ::com::sun::star::uno::Any& aValue )
384 throw(::com::sun::star::beans::UnknownPropertyException,
385 ::com::sun::star::beans::PropertyVetoException,
386 ::com::sun::star::lang::IllegalArgumentException,
387 ::com::sun::star::lang::WrappedTargetException,
388 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
389 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
390 const OUString& PropertyName )
391 throw(::com::sun::star::beans::UnknownPropertyException,
392 ::com::sun::star::lang::WrappedTargetException,
393 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
394 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
395 const ::com::sun::star::uno::Reference<
396 ::com::sun::star::beans::XPropertyChangeListener >& xListener )
397 throw(::com::sun::star::beans::UnknownPropertyException,
398 ::com::sun::star::lang::WrappedTargetException,
399 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
400 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
401 const ::com::sun::star::uno::Reference<
402 ::com::sun::star::beans::XPropertyChangeListener >& aListener )
403 throw(::com::sun::star::beans::UnknownPropertyException,
404 ::com::sun::star::lang::WrappedTargetException,
405 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
406 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
407 const ::com::sun::star::uno::Reference<
408 ::com::sun::star::beans::XVetoableChangeListener >& aListener )
409 throw(::com::sun::star::beans::UnknownPropertyException,
410 ::com::sun::star::lang::WrappedTargetException,
411 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
412 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
413 const ::com::sun::star::uno::Reference<
414 ::com::sun::star::beans::XVetoableChangeListener >& aListener )
415 throw(::com::sun::star::beans::UnknownPropertyException,
416 ::com::sun::star::lang::WrappedTargetException,
417 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
419 // XServiceInfo
420 virtual OUString SAL_CALL getImplementationName()
421 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
422 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
423 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
424 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
425 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
428 // ScFilterDescriptor - dummy container to use with XFilterable
430 class ScFilterDescriptor : public ScFilterDescriptorBase
432 private:
433 ScQueryParam aStoredParam; // nField[] here within the area
435 public:
436 ScFilterDescriptor(ScDocShell* pDocSh);
437 virtual ~ScFilterDescriptor();
439 // from ScFilterDescriptorBase:
440 virtual void GetData( ScQueryParam& rParam ) const SAL_OVERRIDE;
441 virtual void PutData( const ScQueryParam& rParam ) SAL_OVERRIDE;
443 // external access:
444 void SetParam( const ScQueryParam& rNew );
445 const ScQueryParam& GetParam() const { return aStoredParam; }
448 // ScRangeFilterDescriptor - FilterDescriptor of a data base area
450 class ScRangeFilterDescriptor : public ScFilterDescriptorBase
452 private:
453 ScDatabaseRangeObj* pParent;
455 public:
456 ScRangeFilterDescriptor(ScDocShell* pDocSh, ScDatabaseRangeObj* pPar);
457 virtual ~ScRangeFilterDescriptor();
459 // from ScFilterDescriptorBase:
460 virtual void GetData( ScQueryParam& rParam ) const SAL_OVERRIDE;
461 virtual void PutData( const ScQueryParam& rParam ) SAL_OVERRIDE;
464 // ScDataPilotFilterDescriptor - FilterDescriptor of a DataPilotDescriptors
466 class ScDataPilotFilterDescriptor : public ScFilterDescriptorBase
468 private:
469 ScDataPilotDescriptorBase* pParent;
471 public:
472 ScDataPilotFilterDescriptor(ScDocShell* pDocSh, ScDataPilotDescriptorBase* pPar);
473 virtual ~ScDataPilotFilterDescriptor();
475 // from ScFilterDescriptorBase:
476 virtual void GetData( ScQueryParam& rParam ) const SAL_OVERRIDE;
477 virtual void PutData( const ScQueryParam& rParam ) SAL_OVERRIDE;
480 class ScDatabaseRangeObj : public cppu::WeakImplHelper6<
481 com::sun::star::sheet::XDatabaseRange,
482 com::sun::star::util::XRefreshable,
483 com::sun::star::container::XNamed,
484 com::sun::star::sheet::XCellRangeReferrer,
485 com::sun::star::beans::XPropertySet,
486 com::sun::star::lang::XServiceInfo >,
487 public SfxListener
489 private:
490 ScDocShell* pDocShell;
491 OUString aName;
492 SfxItemPropertySet aPropSet;
493 XDBRefreshListenerArr_Impl aRefreshListeners;
494 bool bIsUnnamed;
495 SCTAB aTab;
497 private:
498 ScDBData* GetDBData_Impl() const;
499 void Refreshed_Impl();
501 public:
502 ScDatabaseRangeObj(ScDocShell* pDocSh, const OUString& rNm);
503 SC_DLLPUBLIC ScDatabaseRangeObj(ScDocShell* pDocSh, const SCTAB nTab);
504 virtual ~ScDatabaseRangeObj();
506 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
508 // nField[] here within the area:
509 void GetQueryParam(ScQueryParam& rQueryParam) const;
510 void SetQueryParam(const ScQueryParam& rQueryParam);
511 void GetSubTotalParam(ScSubTotalParam& rSubTotalParam) const;
512 void SetSubTotalParam(const ScSubTotalParam& rSubTotalParam);
514 // XNamed
515 virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
516 virtual void SAL_CALL setName( const OUString& aName )
517 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
519 // XDatabaseRange
520 virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getDataArea()
521 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
522 virtual void SAL_CALL setDataArea( const ::com::sun::star::table::CellRangeAddress& aDataArea )
523 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
524 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
525 getSortDescriptor() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
526 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor > SAL_CALL
527 getFilterDescriptor() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
528 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSubTotalDescriptor > SAL_CALL
529 getSubTotalDescriptor() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
530 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
531 getImportDescriptor() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
533 // XRefreshable
534 virtual void SAL_CALL refresh() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
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, std::exception) SAL_OVERRIDE;
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, std::exception) SAL_OVERRIDE;
542 // XCellRangeReferrer
543 virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
544 getReferredCells() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
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, std::exception) SAL_OVERRIDE;
550 virtual void SAL_CALL setPropertyValue( const 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, std::exception) SAL_OVERRIDE;
557 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
558 const OUString& PropertyName )
559 throw(::com::sun::star::beans::UnknownPropertyException,
560 ::com::sun::star::lang::WrappedTargetException,
561 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
562 virtual void SAL_CALL addPropertyChangeListener( const 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, std::exception) SAL_OVERRIDE;
568 virtual void SAL_CALL removePropertyChangeListener( const 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, std::exception) SAL_OVERRIDE;
574 virtual void SAL_CALL addVetoableChangeListener( const 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, std::exception) SAL_OVERRIDE;
580 virtual void SAL_CALL removeVetoableChangeListener( const 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, std::exception) SAL_OVERRIDE;
587 // XServiceInfo
588 virtual OUString SAL_CALL getImplementationName()
589 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
590 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
591 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
592 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
593 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
596 class ScDatabaseRangesObj : public cppu::WeakImplHelper4<
597 com::sun::star::sheet::XDatabaseRanges,
598 com::sun::star::container::XEnumerationAccess,
599 com::sun::star::container::XIndexAccess,
600 com::sun::star::lang::XServiceInfo >,
601 public SfxListener
603 private:
604 ScDocShell* pDocShell;
606 ScDatabaseRangeObj* GetObjectByIndex_Impl(size_t nIndex);
607 ScDatabaseRangeObj* GetObjectByName_Impl(const OUString& aName);
609 public:
610 ScDatabaseRangesObj(ScDocShell* pDocSh);
611 virtual ~ScDatabaseRangesObj();
613 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
615 // XDatabaseRanges
616 virtual void SAL_CALL addNewByName( const OUString& aName,
617 const ::com::sun::star::table::CellRangeAddress& aRange )
618 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
619 virtual void SAL_CALL removeByName( const OUString& aName )
620 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
622 // XEnumerationAccess
623 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
624 createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
626 // XIndexAccess
627 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
628 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
629 throw(::com::sun::star::lang::IndexOutOfBoundsException,
630 ::com::sun::star::lang::WrappedTargetException,
631 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
633 // XElementAccess
634 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
635 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
636 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
638 // XNameAccess
639 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
640 throw(::com::sun::star::container::NoSuchElementException,
641 ::com::sun::star::lang::WrappedTargetException,
642 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
643 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
644 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
645 virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
646 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
648 // XServiceInfo
649 virtual OUString SAL_CALL getImplementationName()
650 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
651 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
652 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
653 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
654 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
657 class ScUnnamedDatabaseRangesObj : public cppu::WeakImplHelper1<
658 com::sun::star::sheet::XUnnamedDatabaseRanges>,
659 public SfxListener
661 private:
662 ScDocShell* pDocShell;
664 public:
665 ScUnnamedDatabaseRangesObj(ScDocShell* pDocSh);
666 virtual ~ScUnnamedDatabaseRangesObj();
668 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
670 // XUnnamedDatabaseRanges
671 virtual void SAL_CALL setByTable( const ::com::sun::star::table::CellRangeAddress& aRange )
672 throw(::com::sun::star::uno::RuntimeException,
673 ::com::sun::star::lang::IndexOutOfBoundsException, std::exception ) SAL_OVERRIDE;
674 virtual com::sun::star::uno::Any SAL_CALL getByTable( sal_Int32 nTab )
675 throw(::com::sun::star::uno::RuntimeException,
676 ::com::sun::star::lang::IndexOutOfBoundsException,
677 ::com::sun::star::container::NoSuchElementException, std::exception ) SAL_OVERRIDE;
678 virtual sal_Bool SAL_CALL hasByTable( sal_Int32 nTab )
679 throw (::com::sun::star::uno::RuntimeException,
680 ::com::sun::star::lang::IndexOutOfBoundsException, std::exception) SAL_OVERRIDE;
683 #endif
685 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */