Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_SC_INC_DATAUNO_HXX
21 : #define INCLUDED_SC_INC_DATAUNO_HXX
22 :
23 : #include "global.hxx"
24 : #include "queryparam.hxx"
25 : #include "subtotalparam.hxx"
26 :
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>
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 > XDBRefreshListenerRef;
66 : typedef boost::ptr_vector<XDBRefreshListenerRef> XDBRefreshListenerArr_Impl;
67 :
68 : class ScDataUnoConversion
69 : {
70 : public:
71 : static com::sun::star::sheet::GeneralFunction SubTotalToGeneral( ScSubTotalFunc eSubTotal );
72 : };
73 :
74 : // ImportDescriptor is not available as Uno-Objekt any longer, only Property-Sequence
75 :
76 : class ScImportDescriptor
77 : {
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();
86 : };
87 :
88 : // SortDescriptor is not available as Uno-Objekt any longer, only Property-Sequence
89 :
90 : class ScSortDescriptor
91 : {
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 : static long GetPropertyCount();
100 : };
101 :
102 : // ScSubTotalDescriptorBase - base class for SubTotalDescriptor stand alone and in DB area (context?)
103 :
104 : // to uno, both look the same
105 :
106 : class ScSubTotalDescriptorBase : public cppu::WeakImplHelper6<
107 : com::sun::star::sheet::XSubTotalDescriptor,
108 : com::sun::star::container::XEnumerationAccess,
109 : com::sun::star::container::XIndexAccess,
110 : com::sun::star::beans::XPropertySet,
111 : com::sun::star::lang::XUnoTunnel,
112 : com::sun::star::lang::XServiceInfo >
113 : {
114 : private:
115 : SfxItemPropertySet aPropSet;
116 :
117 : ScSubTotalFieldObj* GetObjectByIndex_Impl(sal_uInt16 nIndex);
118 :
119 : public:
120 : ScSubTotalDescriptorBase();
121 : virtual ~ScSubTotalDescriptorBase();
122 :
123 : // in derived classes:
124 : // (Fields are within the range)
125 : virtual void GetData( ScSubTotalParam& rParam ) const = 0;
126 : virtual void PutData( const ScSubTotalParam& rParam ) = 0;
127 :
128 : // XSubTotalDescriptor
129 : virtual void SAL_CALL addNew( const ::com::sun::star::uno::Sequence<
130 : ::com::sun::star::sheet::SubTotalColumn >& aSubTotalColumns,
131 : sal_Int32 nGroupColumn )
132 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
133 : virtual void SAL_CALL clear() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
134 :
135 : // XIndexAccess
136 : virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
137 : virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
138 : throw(::com::sun::star::lang::IndexOutOfBoundsException,
139 : ::com::sun::star::lang::WrappedTargetException,
140 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
141 :
142 : // XEnumerationAccess
143 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
144 : createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
145 :
146 : // XElementAccess
147 : virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
148 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
149 : virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
150 :
151 : // XPropertySet
152 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
153 : SAL_CALL getPropertySetInfo()
154 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
155 : virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
156 : const ::com::sun::star::uno::Any& aValue )
157 : throw(::com::sun::star::beans::UnknownPropertyException,
158 : ::com::sun::star::beans::PropertyVetoException,
159 : ::com::sun::star::lang::IllegalArgumentException,
160 : ::com::sun::star::lang::WrappedTargetException,
161 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
162 : virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
163 : const OUString& PropertyName )
164 : throw(::com::sun::star::beans::UnknownPropertyException,
165 : ::com::sun::star::lang::WrappedTargetException,
166 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
167 : virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
168 : const ::com::sun::star::uno::Reference<
169 : ::com::sun::star::beans::XPropertyChangeListener >& xListener )
170 : throw(::com::sun::star::beans::UnknownPropertyException,
171 : ::com::sun::star::lang::WrappedTargetException,
172 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
173 : virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
174 : const ::com::sun::star::uno::Reference<
175 : ::com::sun::star::beans::XPropertyChangeListener >& aListener )
176 : throw(::com::sun::star::beans::UnknownPropertyException,
177 : ::com::sun::star::lang::WrappedTargetException,
178 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
179 : virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
180 : const ::com::sun::star::uno::Reference<
181 : ::com::sun::star::beans::XVetoableChangeListener >& aListener )
182 : throw(::com::sun::star::beans::UnknownPropertyException,
183 : ::com::sun::star::lang::WrappedTargetException,
184 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
185 : virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
186 : const ::com::sun::star::uno::Reference<
187 : ::com::sun::star::beans::XVetoableChangeListener >& aListener )
188 : throw(::com::sun::star::beans::UnknownPropertyException,
189 : ::com::sun::star::lang::WrappedTargetException,
190 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
191 :
192 : // XUnoTunnel
193 : virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
194 : sal_Int8 >& aIdentifier )
195 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
196 :
197 : static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
198 : static ScSubTotalDescriptorBase* getImplementation( const com::sun::star::uno::Reference<
199 : com::sun::star::sheet::XSubTotalDescriptor> xObj );
200 :
201 : // XServiceInfo
202 : virtual OUString SAL_CALL getImplementationName()
203 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
204 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
205 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
206 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
207 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
208 : };
209 :
210 : // ScSubTotalDescriptor - dummy container to use with XImportTarget
211 :
212 : class ScSubTotalDescriptor : public ScSubTotalDescriptorBase
213 : {
214 : private:
215 : ScSubTotalParam aStoredParam;
216 :
217 : public:
218 : ScSubTotalDescriptor();
219 : virtual ~ScSubTotalDescriptor();
220 :
221 : // from ScSubTotalDescriptorBase:
222 : virtual void GetData( ScSubTotalParam& rParam ) const SAL_OVERRIDE;
223 : virtual void PutData( const ScSubTotalParam& rParam ) SAL_OVERRIDE;
224 :
225 : // external access:
226 : void SetParam( const ScSubTotalParam& rNew );
227 : };
228 :
229 : // ScRangeSubTotalDescriptor - SubTotalDescriptor of a data base area
230 :
231 : class ScRangeSubTotalDescriptor : public ScSubTotalDescriptorBase
232 : {
233 : private:
234 : ScDatabaseRangeObj* pParent;
235 :
236 : public:
237 : ScRangeSubTotalDescriptor(ScDatabaseRangeObj* pPar);
238 : virtual ~ScRangeSubTotalDescriptor();
239 :
240 : // from ScSubTotalDescriptorBase:
241 : virtual void GetData( ScSubTotalParam& rParam ) const SAL_OVERRIDE;
242 : virtual void PutData( const ScSubTotalParam& rParam ) SAL_OVERRIDE;
243 : };
244 :
245 : class ScSubTotalFieldObj : public cppu::WeakImplHelper2<
246 : com::sun::star::sheet::XSubTotalField,
247 : com::sun::star::lang::XServiceInfo >
248 : {
249 : private:
250 : com::sun::star::uno::Reference<com::sun::star::sheet::XSubTotalDescriptor> xRef;
251 : ScSubTotalDescriptorBase& rParent;
252 : sal_uInt16 nPos;
253 :
254 : public:
255 : ScSubTotalFieldObj( ScSubTotalDescriptorBase* pDesc, sal_uInt16 nP );
256 : virtual ~ScSubTotalFieldObj();
257 :
258 : // XSubTotalField
259 : virtual sal_Int32 SAL_CALL getGroupColumn() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
260 : virtual void SAL_CALL setGroupColumn( sal_Int32 nGroupColumn )
261 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
262 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::SubTotalColumn > SAL_CALL
263 : getSubTotalColumns() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
264 : virtual void SAL_CALL setSubTotalColumns( const ::com::sun::star::uno::Sequence<
265 : ::com::sun::star::sheet::SubTotalColumn >& aSubTotalColumns )
266 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
267 :
268 : // XServiceInfo
269 : virtual OUString SAL_CALL getImplementationName()
270 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
271 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
272 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
273 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
274 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
275 : };
276 :
277 : class ScConsolidationDescriptor : public cppu::WeakImplHelper2<
278 : com::sun::star::sheet::XConsolidationDescriptor,
279 : com::sun::star::lang::XServiceInfo >
280 : {
281 : private:
282 : ScConsolidateParam aParam;
283 :
284 : public:
285 : ScConsolidationDescriptor();
286 : virtual ~ScConsolidationDescriptor();
287 :
288 : void SetParam( const ScConsolidateParam& rNew );
289 2 : const ScConsolidateParam& GetParam() const { return aParam; }
290 :
291 : // XConsolidationDescriptor
292 : virtual ::com::sun::star::sheet::GeneralFunction SAL_CALL getFunction()
293 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
294 : virtual void SAL_CALL setFunction( ::com::sun::star::sheet::GeneralFunction nFunction )
295 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
296 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress > SAL_CALL
297 : getSources( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
298 : virtual void SAL_CALL setSources( const ::com::sun::star::uno::Sequence<
299 : ::com::sun::star::table::CellRangeAddress >& aSources )
300 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
301 : virtual ::com::sun::star::table::CellAddress SAL_CALL getStartOutputPosition()
302 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
303 : virtual void SAL_CALL setStartOutputPosition(
304 : const ::com::sun::star::table::CellAddress& aStartOutputPosition )
305 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
306 : virtual sal_Bool SAL_CALL getUseColumnHeaders() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
307 : virtual void SAL_CALL setUseColumnHeaders( sal_Bool bUseColumnHeaders )
308 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
309 : virtual sal_Bool SAL_CALL getUseRowHeaders() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
310 : virtual void SAL_CALL setUseRowHeaders( sal_Bool bUseRowHeaders )
311 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
312 : virtual sal_Bool SAL_CALL getInsertLinks() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
313 : virtual void SAL_CALL setInsertLinks( sal_Bool bInsertLinks )
314 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
315 :
316 : // XServiceInfo
317 : virtual OUString SAL_CALL getImplementationName()
318 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
319 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
320 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
321 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
322 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
323 : };
324 :
325 : // ScFilterDescriptorBase - base class for FilterDescriptor
326 : // stand alone, in a DB area (or context?) and in the DataPilot
327 :
328 : // to uno, all three look the same
329 :
330 : class ScFilterDescriptorBase : public cppu::WeakImplHelper5<
331 : com::sun::star::sheet::XSheetFilterDescriptor,
332 : com::sun::star::sheet::XSheetFilterDescriptor2,
333 : com::sun::star::sheet::XSheetFilterDescriptor3,
334 : com::sun::star::beans::XPropertySet,
335 : com::sun::star::lang::XServiceInfo >,
336 : public SfxListener
337 : {
338 : private:
339 : SfxItemPropertySet aPropSet;
340 : ScDocShell* pDocSh;
341 :
342 : public:
343 : ScFilterDescriptorBase(ScDocShell* pDocShell);
344 : virtual ~ScFilterDescriptorBase();
345 :
346 : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
347 :
348 : // in the derived classes(?):
349 : // (nField[] here within the area)
350 : virtual void GetData( ScQueryParam& rParam ) const = 0;
351 : virtual void PutData( const ScQueryParam& rParam ) = 0;
352 :
353 : // XSheetFilterDescriptor
354 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TableFilterField > SAL_CALL
355 : getFilterFields() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
356 : virtual void SAL_CALL setFilterFields( const ::com::sun::star::uno::Sequence<
357 : ::com::sun::star::sheet::TableFilterField >& aFilterFields )
358 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
359 :
360 : // XSheetFilterDescriptor2
361 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TableFilterField2 > SAL_CALL
362 : getFilterFields2() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
363 : virtual void SAL_CALL setFilterFields2( const ::com::sun::star::uno::Sequence<
364 : ::com::sun::star::sheet::TableFilterField2 >& aFilterFields )
365 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
366 :
367 : // XSheetFilterDescriptor3
368 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TableFilterField3 > SAL_CALL
369 : getFilterFields3() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
370 : virtual void SAL_CALL setFilterFields3( const ::com::sun::star::uno::Sequence<
371 : ::com::sun::star::sheet::TableFilterField3 >& aFilterFields )
372 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
373 :
374 : // XPropertySet
375 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
376 : SAL_CALL getPropertySetInfo()
377 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
378 : virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
379 : const ::com::sun::star::uno::Any& aValue )
380 : throw(::com::sun::star::beans::UnknownPropertyException,
381 : ::com::sun::star::beans::PropertyVetoException,
382 : ::com::sun::star::lang::IllegalArgumentException,
383 : ::com::sun::star::lang::WrappedTargetException,
384 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
385 : virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
386 : const OUString& PropertyName )
387 : throw(::com::sun::star::beans::UnknownPropertyException,
388 : ::com::sun::star::lang::WrappedTargetException,
389 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
390 : virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
391 : const ::com::sun::star::uno::Reference<
392 : ::com::sun::star::beans::XPropertyChangeListener >& xListener )
393 : throw(::com::sun::star::beans::UnknownPropertyException,
394 : ::com::sun::star::lang::WrappedTargetException,
395 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
396 : virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
397 : const ::com::sun::star::uno::Reference<
398 : ::com::sun::star::beans::XPropertyChangeListener >& aListener )
399 : throw(::com::sun::star::beans::UnknownPropertyException,
400 : ::com::sun::star::lang::WrappedTargetException,
401 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
402 : virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
403 : const ::com::sun::star::uno::Reference<
404 : ::com::sun::star::beans::XVetoableChangeListener >& aListener )
405 : throw(::com::sun::star::beans::UnknownPropertyException,
406 : ::com::sun::star::lang::WrappedTargetException,
407 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
408 : virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
409 : const ::com::sun::star::uno::Reference<
410 : ::com::sun::star::beans::XVetoableChangeListener >& aListener )
411 : throw(::com::sun::star::beans::UnknownPropertyException,
412 : ::com::sun::star::lang::WrappedTargetException,
413 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
414 :
415 : // XServiceInfo
416 : virtual OUString SAL_CALL getImplementationName()
417 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
418 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
419 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
420 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
421 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
422 : };
423 :
424 : // ScFilterDescriptor - dummy container to use with XFilterable
425 :
426 : class ScFilterDescriptor : public ScFilterDescriptorBase
427 : {
428 : private:
429 : ScQueryParam aStoredParam; // nField[] here within the area
430 :
431 : public:
432 : ScFilterDescriptor(ScDocShell* pDocSh);
433 : virtual ~ScFilterDescriptor();
434 :
435 : // from ScFilterDescriptorBase:
436 : virtual void GetData( ScQueryParam& rParam ) const SAL_OVERRIDE;
437 : virtual void PutData( const ScQueryParam& rParam ) SAL_OVERRIDE;
438 :
439 : // external access:
440 : void SetParam( const ScQueryParam& rNew );
441 4 : const ScQueryParam& GetParam() const { return aStoredParam; }
442 : };
443 :
444 : // ScRangeFilterDescriptor - FilterDescriptor of a data base area
445 :
446 : class ScRangeFilterDescriptor : public ScFilterDescriptorBase
447 : {
448 : private:
449 : ScDatabaseRangeObj* pParent;
450 :
451 : public:
452 : ScRangeFilterDescriptor(ScDocShell* pDocSh, ScDatabaseRangeObj* pPar);
453 : virtual ~ScRangeFilterDescriptor();
454 :
455 : // from ScFilterDescriptorBase:
456 : virtual void GetData( ScQueryParam& rParam ) const SAL_OVERRIDE;
457 : virtual void PutData( const ScQueryParam& rParam ) SAL_OVERRIDE;
458 : };
459 :
460 : // ScDataPilotFilterDescriptor - FilterDescriptor of a DataPilotDescriptors
461 :
462 : class ScDataPilotFilterDescriptor : public ScFilterDescriptorBase
463 : {
464 : private:
465 : ScDataPilotDescriptorBase* pParent;
466 :
467 : public:
468 : ScDataPilotFilterDescriptor(ScDocShell* pDocSh, ScDataPilotDescriptorBase* pPar);
469 : virtual ~ScDataPilotFilterDescriptor();
470 :
471 : // from ScFilterDescriptorBase:
472 : virtual void GetData( ScQueryParam& rParam ) const SAL_OVERRIDE;
473 : virtual void PutData( const ScQueryParam& rParam ) SAL_OVERRIDE;
474 : };
475 :
476 : class ScDatabaseRangeObj : public cppu::WeakImplHelper6<
477 : com::sun::star::sheet::XDatabaseRange,
478 : com::sun::star::util::XRefreshable,
479 : com::sun::star::container::XNamed,
480 : com::sun::star::sheet::XCellRangeReferrer,
481 : com::sun::star::beans::XPropertySet,
482 : com::sun::star::lang::XServiceInfo >,
483 : public SfxListener
484 : {
485 : private:
486 : ScDocShell* pDocShell;
487 : OUString aName;
488 : SfxItemPropertySet aPropSet;
489 : XDBRefreshListenerArr_Impl aRefreshListeners;
490 : bool bIsUnnamed;
491 : SCTAB aTab;
492 :
493 : private:
494 : ScDBData* GetDBData_Impl() const;
495 : void Refreshed_Impl();
496 :
497 : public:
498 : ScDatabaseRangeObj(ScDocShell* pDocSh, const OUString& rNm);
499 : SC_DLLPUBLIC ScDatabaseRangeObj(ScDocShell* pDocSh, const SCTAB nTab);
500 : virtual ~ScDatabaseRangeObj();
501 :
502 : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
503 :
504 : // nField[] here within the area:
505 : void GetQueryParam(ScQueryParam& rQueryParam) const;
506 : void SetQueryParam(const ScQueryParam& rQueryParam);
507 : void GetSubTotalParam(ScSubTotalParam& rSubTotalParam) const;
508 : void SetSubTotalParam(const ScSubTotalParam& rSubTotalParam);
509 :
510 : // XNamed
511 : virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
512 : virtual void SAL_CALL setName( const OUString& aName )
513 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
514 :
515 : // XDatabaseRange
516 : virtual ::com::sun::star::table::CellRangeAddress SAL_CALL getDataArea()
517 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
518 : virtual void SAL_CALL setDataArea( const ::com::sun::star::table::CellRangeAddress& aDataArea )
519 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
520 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
521 : getSortDescriptor() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
522 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor > SAL_CALL
523 : getFilterDescriptor() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
524 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSubTotalDescriptor > SAL_CALL
525 : getSubTotalDescriptor() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
526 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
527 : getImportDescriptor() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
528 :
529 : // XRefreshable
530 : virtual void SAL_CALL refresh() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
531 : virtual void SAL_CALL addRefreshListener( const ::com::sun::star::uno::Reference<
532 : ::com::sun::star::util::XRefreshListener >& l )
533 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
534 : virtual void SAL_CALL removeRefreshListener( const ::com::sun::star::uno::Reference<
535 : ::com::sun::star::util::XRefreshListener >& l )
536 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
537 :
538 : // XCellRangeReferrer
539 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > SAL_CALL
540 : getReferredCells() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
541 :
542 : // XPropertySet
543 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
544 : SAL_CALL getPropertySetInfo()
545 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
546 : virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
547 : const ::com::sun::star::uno::Any& aValue )
548 : throw(::com::sun::star::beans::UnknownPropertyException,
549 : ::com::sun::star::beans::PropertyVetoException,
550 : ::com::sun::star::lang::IllegalArgumentException,
551 : ::com::sun::star::lang::WrappedTargetException,
552 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
553 : virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
554 : const OUString& PropertyName )
555 : throw(::com::sun::star::beans::UnknownPropertyException,
556 : ::com::sun::star::lang::WrappedTargetException,
557 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
558 : virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
559 : const ::com::sun::star::uno::Reference<
560 : ::com::sun::star::beans::XPropertyChangeListener >& xListener )
561 : throw(::com::sun::star::beans::UnknownPropertyException,
562 : ::com::sun::star::lang::WrappedTargetException,
563 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
564 : virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
565 : const ::com::sun::star::uno::Reference<
566 : ::com::sun::star::beans::XPropertyChangeListener >& aListener )
567 : throw(::com::sun::star::beans::UnknownPropertyException,
568 : ::com::sun::star::lang::WrappedTargetException,
569 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
570 : virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
571 : const ::com::sun::star::uno::Reference<
572 : ::com::sun::star::beans::XVetoableChangeListener >& aListener )
573 : throw(::com::sun::star::beans::UnknownPropertyException,
574 : ::com::sun::star::lang::WrappedTargetException,
575 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
576 : virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
577 : const ::com::sun::star::uno::Reference<
578 : ::com::sun::star::beans::XVetoableChangeListener >& aListener )
579 : throw(::com::sun::star::beans::UnknownPropertyException,
580 : ::com::sun::star::lang::WrappedTargetException,
581 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
582 :
583 : // XServiceInfo
584 : virtual OUString SAL_CALL getImplementationName()
585 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
586 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
587 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
588 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
589 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
590 : };
591 :
592 : class ScDatabaseRangesObj : public cppu::WeakImplHelper4<
593 : com::sun::star::sheet::XDatabaseRanges,
594 : com::sun::star::container::XEnumerationAccess,
595 : com::sun::star::container::XIndexAccess,
596 : com::sun::star::lang::XServiceInfo >,
597 : public SfxListener
598 : {
599 : private:
600 : ScDocShell* pDocShell;
601 :
602 : ScDatabaseRangeObj* GetObjectByIndex_Impl(size_t nIndex);
603 : ScDatabaseRangeObj* GetObjectByName_Impl(const OUString& aName);
604 :
605 : public:
606 : ScDatabaseRangesObj(ScDocShell* pDocSh);
607 : virtual ~ScDatabaseRangesObj();
608 :
609 : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
610 :
611 : // XDatabaseRanges
612 : virtual void SAL_CALL addNewByName( const OUString& aName,
613 : const ::com::sun::star::table::CellRangeAddress& aRange )
614 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
615 : virtual void SAL_CALL removeByName( const OUString& aName )
616 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
617 :
618 : // XEnumerationAccess
619 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
620 : createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
621 :
622 : // XIndexAccess
623 : virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
624 : virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
625 : throw(::com::sun::star::lang::IndexOutOfBoundsException,
626 : ::com::sun::star::lang::WrappedTargetException,
627 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
628 :
629 : // XElementAccess
630 : virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
631 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
632 : virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
633 :
634 : // XNameAccess
635 : virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
636 : throw(::com::sun::star::container::NoSuchElementException,
637 : ::com::sun::star::lang::WrappedTargetException,
638 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
639 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
640 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
641 : virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
642 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
643 :
644 : // XServiceInfo
645 : virtual OUString SAL_CALL getImplementationName()
646 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
647 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
648 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
649 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
650 : throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
651 : };
652 :
653 : class ScUnnamedDatabaseRangesObj : public cppu::WeakImplHelper1<
654 : com::sun::star::sheet::XUnnamedDatabaseRanges>,
655 : public SfxListener
656 : {
657 : private:
658 : ScDocShell* pDocShell;
659 :
660 : public:
661 : ScUnnamedDatabaseRangesObj(ScDocShell* pDocSh);
662 : virtual ~ScUnnamedDatabaseRangesObj();
663 :
664 : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
665 :
666 : // XUnnamedDatabaseRanges
667 : virtual void SAL_CALL setByTable( const ::com::sun::star::table::CellRangeAddress& aRange )
668 : throw(::com::sun::star::uno::RuntimeException,
669 : ::com::sun::star::lang::IndexOutOfBoundsException, std::exception ) SAL_OVERRIDE;
670 : virtual com::sun::star::uno::Any SAL_CALL getByTable( sal_Int32 nTab )
671 : throw(::com::sun::star::uno::RuntimeException,
672 : ::com::sun::star::lang::IndexOutOfBoundsException,
673 : ::com::sun::star::container::NoSuchElementException, std::exception ) SAL_OVERRIDE;
674 : virtual sal_Bool SAL_CALL hasByTable( sal_Int32 nTab )
675 : throw (::com::sun::star::uno::RuntimeException,
676 : ::com::sun::star::lang::IndexOutOfBoundsException, std::exception) SAL_OVERRIDE;
677 : };
678 :
679 : #endif
680 :
681 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|