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