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