/src/libreoffice/sc/inc/datauno.hxx
Line | Count | Source |
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 | | #pragma once |
21 | | |
22 | | #include "global.hxx" |
23 | | #include "queryparam.hxx" |
24 | | #include "subtotalparam.hxx" |
25 | | #include "dapiuno.hxx" |
26 | | #include <com/sun/star/sheet/GeneralFunction.hpp> |
27 | | #include <com/sun/star/sheet/XCellRangeReferrer.hpp> |
28 | | #include <com/sun/star/sheet/XSheetFilterDescriptor.hpp> |
29 | | #include <com/sun/star/sheet/XSheetFilterDescriptor2.hpp> |
30 | | #include <com/sun/star/sheet/XSheetFilterDescriptor3.hpp> |
31 | | #include <com/sun/star/sheet/XConsolidationDescriptor.hpp> |
32 | | #include <com/sun/star/sheet/XDatabaseRanges.hpp> |
33 | | #include <com/sun/star/sheet/XDatabaseRange.hpp> |
34 | | #include <com/sun/star/sheet/XUnnamedDatabaseRanges.hpp> |
35 | | #include <com/sun/star/sheet/XSubTotalDescriptor.hpp> |
36 | | #include <com/sun/star/sheet/XSubTotalField.hpp> |
37 | | #include <com/sun/star/lang/XServiceInfo.hpp> |
38 | | #include <com/sun/star/container/XEnumerationAccess.hpp> |
39 | | #include <com/sun/star/container/XIndexAccess.hpp> |
40 | | #include <com/sun/star/beans/XPropertySet.hpp> |
41 | | #include <com/sun/star/container/XNamed.hpp> |
42 | | #include <com/sun/star/util/XRefreshable.hpp> |
43 | | #include <cppuhelper/implbase.hxx> |
44 | | #include <rtl/ref.hxx> |
45 | | #include <sal/types.h> |
46 | | #include <svl/itemprop.hxx> |
47 | | #include <svl/lstner.hxx> |
48 | | |
49 | | #include <vector> |
50 | | |
51 | | class ScDBData; |
52 | | class ScDocShell; |
53 | | |
54 | | class ScSubTotalFieldObj; |
55 | | class ScDatabaseRangeObj; |
56 | | class ScDataPilotDescriptorBase; |
57 | | |
58 | | struct ScSortParam; |
59 | | |
60 | | class ScDataUnoConversion |
61 | | { |
62 | | public: |
63 | | static css::sheet::GeneralFunction SubTotalToGeneral( ScSubTotalFunc eSubTotal ); |
64 | | }; |
65 | | |
66 | | // ImportDescriptor is not available as Uno-object any longer, only Property-Sequence |
67 | | |
68 | | class ScImportDescriptor |
69 | | { |
70 | | public: |
71 | | static void FillImportParam( |
72 | | ScImportParam& rParam, |
73 | | const css::uno::Sequence<css::beans::PropertyValue>& rSeq ); |
74 | | static void FillProperties( |
75 | | css::uno::Sequence<css::beans::PropertyValue>& rSeq, |
76 | | const ScImportParam& rParam ); |
77 | 0 | static tools::Long GetPropertyCount() { return 4; } |
78 | | }; |
79 | | |
80 | | // SortDescriptor is not available as Uno-object any longer, only Property-Sequence |
81 | | |
82 | | class ScSortDescriptor |
83 | | { |
84 | | public: |
85 | | static void FillSortParam( |
86 | | ScSortParam& rParam, |
87 | | const css::uno::Sequence<css::beans::PropertyValue>& rSeq ); |
88 | | static void FillProperties( |
89 | | css::uno::Sequence<css::beans::PropertyValue>& rSeq, |
90 | | const ScSortParam& rParam ); |
91 | | static tools::Long GetPropertyCount() |
92 | 0 | { |
93 | 0 | return 10; // TableSortDescriptor2 (3) and SheetSortDescriptor2 (7) |
94 | 0 | } |
95 | | |
96 | | }; |
97 | | |
98 | | // ScSubTotalDescriptorBase - base class for SubTotalDescriptor stand alone and in DB area (context?) |
99 | | |
100 | | // to uno, both look the same |
101 | | |
102 | | class ScSubTotalDescriptorBase : public cppu::WeakImplHelper< |
103 | | css::sheet::XSubTotalDescriptor, |
104 | | css::container::XEnumerationAccess, |
105 | | css::container::XIndexAccess, |
106 | | css::beans::XPropertySet, |
107 | | css::lang::XServiceInfo > |
108 | | { |
109 | | private: |
110 | | SfxItemPropertySet aPropSet; |
111 | | |
112 | | rtl::Reference<ScSubTotalFieldObj> GetObjectByIndex_Impl(sal_uInt16 nIndex); |
113 | | |
114 | | public: |
115 | | ScSubTotalDescriptorBase(); |
116 | | virtual ~ScSubTotalDescriptorBase() override; |
117 | | |
118 | | // in derived classes: |
119 | | // (Fields are within the range) |
120 | | virtual void GetData( ScSubTotalParam& rParam ) const = 0; |
121 | | virtual void PutData( const ScSubTotalParam& rParam ) = 0; |
122 | | |
123 | | // XSubTotalDescriptor |
124 | | virtual void SAL_CALL addNew( const css::uno::Sequence< css::sheet::SubTotalColumn >& aSubTotalColumns, |
125 | | sal_Int32 nGroupColumn ) override; |
126 | | virtual void SAL_CALL clear() override; |
127 | | |
128 | | // XIndexAccess |
129 | | virtual sal_Int32 SAL_CALL getCount() override; |
130 | | virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override; |
131 | | |
132 | | // XEnumerationAccess |
133 | | virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL |
134 | | createEnumeration() override; |
135 | | |
136 | | // XElementAccess |
137 | | virtual css::uno::Type SAL_CALL getElementType() override; |
138 | | virtual sal_Bool SAL_CALL hasElements() override; |
139 | | |
140 | | // XPropertySet |
141 | | virtual css::uno::Reference< css::beans::XPropertySetInfo > |
142 | | SAL_CALL getPropertySetInfo() override; |
143 | | virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, |
144 | | const css::uno::Any& aValue ) override; |
145 | | virtual css::uno::Any SAL_CALL getPropertyValue( |
146 | | const OUString& PropertyName ) override; |
147 | | virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, |
148 | | const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; |
149 | | virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, |
150 | | const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; |
151 | | virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, |
152 | | const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; |
153 | | virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, |
154 | | const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; |
155 | | |
156 | | // XServiceInfo |
157 | | virtual OUString SAL_CALL getImplementationName() override; |
158 | | virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; |
159 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
160 | | }; |
161 | | |
162 | | // ScSubTotalDescriptor - dummy container to use with XImportTarget |
163 | | |
164 | | class ScSubTotalDescriptor final : public ScSubTotalDescriptorBase |
165 | | { |
166 | | private: |
167 | | ScSubTotalParam aStoredParam; |
168 | | |
169 | | public: |
170 | | ScSubTotalDescriptor(); |
171 | | virtual ~ScSubTotalDescriptor() override; |
172 | | |
173 | | // from ScSubTotalDescriptorBase: |
174 | | virtual void GetData( ScSubTotalParam& rParam ) const override; |
175 | | virtual void PutData( const ScSubTotalParam& rParam ) override; |
176 | | |
177 | | // external access: |
178 | | void SetParam( const ScSubTotalParam& rNew ); |
179 | | }; |
180 | | |
181 | | // ScRangeSubTotalDescriptor - SubTotalDescriptor of a data base area |
182 | | |
183 | | class ScRangeSubTotalDescriptor final : public ScSubTotalDescriptorBase |
184 | | { |
185 | | private: |
186 | | rtl::Reference<ScDatabaseRangeObj> mxParent; |
187 | | |
188 | | public: |
189 | | ScRangeSubTotalDescriptor(ScDatabaseRangeObj* pPar); |
190 | | virtual ~ScRangeSubTotalDescriptor() override; |
191 | | |
192 | | // from ScSubTotalDescriptorBase: |
193 | | virtual void GetData( ScSubTotalParam& rParam ) const override; |
194 | | virtual void PutData( const ScSubTotalParam& rParam ) override; |
195 | | }; |
196 | | |
197 | | class ScSubTotalFieldObj final : public cppu::WeakImplHelper< |
198 | | css::sheet::XSubTotalField, |
199 | | css::lang::XServiceInfo > |
200 | | { |
201 | | private: |
202 | | rtl::Reference<ScSubTotalDescriptorBase> xParent; |
203 | | sal_uInt16 nPos; |
204 | | |
205 | | public: |
206 | | ScSubTotalFieldObj( ScSubTotalDescriptorBase* pDesc, sal_uInt16 nP ); |
207 | | virtual ~ScSubTotalFieldObj() override; |
208 | | |
209 | | // XSubTotalField |
210 | | virtual sal_Int32 SAL_CALL getGroupColumn() override; |
211 | | virtual void SAL_CALL setGroupColumn( sal_Int32 nGroupColumn ) override; |
212 | | virtual css::uno::Sequence< css::sheet::SubTotalColumn > SAL_CALL |
213 | | getSubTotalColumns() override; |
214 | | virtual void SAL_CALL setSubTotalColumns( const css::uno::Sequence< |
215 | | css::sheet::SubTotalColumn >& aSubTotalColumns ) override; |
216 | | |
217 | | // XServiceInfo |
218 | | virtual OUString SAL_CALL getImplementationName() override; |
219 | | virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; |
220 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
221 | | }; |
222 | | |
223 | | class ScConsolidationDescriptor final : public cppu::WeakImplHelper< |
224 | | css::sheet::XConsolidationDescriptor, |
225 | | css::lang::XServiceInfo > |
226 | | { |
227 | | private: |
228 | | ScConsolidateParam aParam; |
229 | | |
230 | | public: |
231 | | ScConsolidationDescriptor(); |
232 | | virtual ~ScConsolidationDescriptor() override; |
233 | | |
234 | | void SetParam( const ScConsolidateParam& rNew ); |
235 | 0 | const ScConsolidateParam& GetParam() const { return aParam; } |
236 | | |
237 | | // XConsolidationDescriptor |
238 | | virtual css::sheet::GeneralFunction SAL_CALL getFunction() override; |
239 | | virtual void SAL_CALL setFunction( css::sheet::GeneralFunction nFunction ) override; |
240 | | virtual css::uno::Sequence< css::table::CellRangeAddress > SAL_CALL |
241 | | getSources( ) override; |
242 | | virtual void SAL_CALL setSources( const css::uno::Sequence< css::table::CellRangeAddress >& aSources ) override; |
243 | | virtual css::table::CellAddress SAL_CALL getStartOutputPosition() override; |
244 | | virtual void SAL_CALL setStartOutputPosition( |
245 | | const css::table::CellAddress& aStartOutputPosition ) override; |
246 | | virtual sal_Bool SAL_CALL getUseColumnHeaders() override; |
247 | | virtual void SAL_CALL setUseColumnHeaders( sal_Bool bUseColumnHeaders ) override; |
248 | | virtual sal_Bool SAL_CALL getUseRowHeaders() override; |
249 | | virtual void SAL_CALL setUseRowHeaders( sal_Bool bUseRowHeaders ) override; |
250 | | virtual sal_Bool SAL_CALL getInsertLinks() override; |
251 | | virtual void SAL_CALL setInsertLinks( sal_Bool bInsertLinks ) override; |
252 | | |
253 | | // XServiceInfo |
254 | | virtual OUString SAL_CALL getImplementationName() override; |
255 | | virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; |
256 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
257 | | }; |
258 | | |
259 | | // ScFilterDescriptorBase - base class for FilterDescriptor |
260 | | // stand alone, in a DB area (or context?) and in the DataPilot |
261 | | |
262 | | // to uno, all three look the same |
263 | | |
264 | | class SAL_DLLPUBLIC_RTTI ScFilterDescriptorBase : public cppu::WeakImplHelper< |
265 | | css::sheet::XSheetFilterDescriptor, |
266 | | css::sheet::XSheetFilterDescriptor2, |
267 | | css::sheet::XSheetFilterDescriptor3, |
268 | | css::beans::XPropertySet, |
269 | | css::lang::XServiceInfo >, |
270 | | public SfxListener |
271 | | { |
272 | | private: |
273 | | SfxItemPropertySet aPropSet; |
274 | | ScDocShell* pDocSh; |
275 | | |
276 | | public: |
277 | | ScFilterDescriptorBase(ScDocShell* pDocShell); |
278 | | virtual ~ScFilterDescriptorBase() override; |
279 | | |
280 | | SC_DLLPUBLIC virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; |
281 | | |
282 | | // in the derived classes(?): |
283 | | // (nField[] here within the area) |
284 | | virtual void GetData( ScQueryParam& rParam ) const = 0; |
285 | | virtual void PutData( const ScQueryParam& rParam ) = 0; |
286 | | |
287 | | // XSheetFilterDescriptor |
288 | | virtual css::uno::Sequence< css::sheet::TableFilterField > SAL_CALL |
289 | | getFilterFields() override; |
290 | | virtual void SAL_CALL setFilterFields( const css::uno::Sequence< |
291 | | css::sheet::TableFilterField >& aFilterFields ) override; |
292 | | |
293 | | // XSheetFilterDescriptor2 |
294 | | virtual css::uno::Sequence< css::sheet::TableFilterField2 > SAL_CALL |
295 | | getFilterFields2() override; |
296 | | virtual void SAL_CALL setFilterFields2( const css::uno::Sequence< |
297 | | css::sheet::TableFilterField2 >& aFilterFields ) override; |
298 | | |
299 | | // XSheetFilterDescriptor3 |
300 | | SC_DLLPUBLIC virtual css::uno::Sequence< css::sheet::TableFilterField3 > SAL_CALL |
301 | | getFilterFields3() override; |
302 | | SC_DLLPUBLIC virtual void SAL_CALL setFilterFields3( const css::uno::Sequence< |
303 | | css::sheet::TableFilterField3 >& aFilterFields ) override; |
304 | | |
305 | | // XPropertySet |
306 | | virtual css::uno::Reference< css::beans::XPropertySetInfo > |
307 | | SAL_CALL getPropertySetInfo() override; |
308 | | SC_DLLPUBLIC virtual void SAL_CALL setPropertyValue(const OUString& aPropertyName, |
309 | | const css::uno::Any& aValue ) override; |
310 | | SC_DLLPUBLIC virtual css::uno::Any SAL_CALL getPropertyValue( |
311 | | const OUString& PropertyName ) override; |
312 | | virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, |
313 | | const css::uno::Reference< |
314 | | css::beans::XPropertyChangeListener >& xListener ) override; |
315 | | virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, |
316 | | const css::uno::Reference< |
317 | | css::beans::XPropertyChangeListener >& aListener ) override; |
318 | | virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, |
319 | | const css::uno::Reference< |
320 | | css::beans::XVetoableChangeListener >& aListener ) override; |
321 | | virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, |
322 | | const css::uno::Reference< |
323 | | css::beans::XVetoableChangeListener >& aListener ) override; |
324 | | |
325 | | // XServiceInfo |
326 | | virtual OUString SAL_CALL getImplementationName() override; |
327 | | virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; |
328 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
329 | | }; |
330 | | |
331 | | // ScFilterDescriptor - dummy container to use with XFilterable |
332 | | |
333 | | class ScFilterDescriptor final : public ScFilterDescriptorBase |
334 | | { |
335 | | private: |
336 | | ScQueryParam aStoredParam; // nField[] here within the area |
337 | | |
338 | | public: |
339 | | ScFilterDescriptor(ScDocShell* pDocSh); |
340 | | virtual ~ScFilterDescriptor() override; |
341 | | |
342 | | // from ScFilterDescriptorBase: |
343 | | virtual void GetData( ScQueryParam& rParam ) const override; |
344 | | virtual void PutData( const ScQueryParam& rParam ) override; |
345 | | |
346 | | // external access: |
347 | | void SetParam( const ScQueryParam& rNew ); |
348 | 0 | const ScQueryParam& GetParam() const { return aStoredParam; } |
349 | | }; |
350 | | |
351 | | // ScRangeFilterDescriptor - FilterDescriptor of a data base area |
352 | | |
353 | | class SC_DLLPUBLIC ScRangeFilterDescriptor final : public ScFilterDescriptorBase |
354 | | { |
355 | | private: |
356 | | rtl::Reference<ScDatabaseRangeObj> mxParent; |
357 | | |
358 | | public: |
359 | | ScRangeFilterDescriptor(ScDocShell* pDocSh, ScDatabaseRangeObj* pPar); |
360 | | virtual ~ScRangeFilterDescriptor() override; |
361 | | |
362 | | // from ScFilterDescriptorBase: |
363 | | virtual void GetData( ScQueryParam& rParam ) const override; |
364 | | virtual void PutData( const ScQueryParam& rParam ) override; |
365 | | }; |
366 | | |
367 | | // ScDataPilotFilterDescriptor - FilterDescriptor of a DataPilotDescriptors |
368 | | |
369 | | class SC_DLLPUBLIC ScDataPilotFilterDescriptor final : public ScFilterDescriptorBase |
370 | | { |
371 | | private: |
372 | | rtl::Reference<ScDataPilotDescriptorBase> mxParent; |
373 | | |
374 | | public: |
375 | | ScDataPilotFilterDescriptor(ScDocShell* pDocSh, ScDataPilotDescriptorBase* pPar); |
376 | | virtual ~ScDataPilotFilterDescriptor() override; |
377 | | |
378 | | // from ScFilterDescriptorBase: |
379 | | virtual void GetData( ScQueryParam& rParam ) const override; |
380 | | virtual void PutData( const ScQueryParam& rParam ) override; |
381 | | }; |
382 | | |
383 | | class SAL_DLLPUBLIC_RTTI ScDatabaseRangeObj final : public cppu::WeakImplHelper< |
384 | | css::sheet::XDatabaseRange, |
385 | | css::util::XRefreshable, |
386 | | css::container::XNamed, |
387 | | css::sheet::XCellRangeReferrer, |
388 | | css::beans::XPropertySet, |
389 | | css::lang::XServiceInfo >, |
390 | | public SfxListener |
391 | | { |
392 | | private: |
393 | | ScDocShell* pDocShell; |
394 | | OUString aName; |
395 | | SfxItemPropertySet aPropSet; |
396 | | std::vector< css::uno::Reference< css::util::XRefreshListener > > |
397 | | aRefreshListeners; |
398 | | bool bIsUnnamed; |
399 | | SCTAB aTab; |
400 | | |
401 | | private: |
402 | | ScDBData* GetDBData_Impl() const; |
403 | | void Refreshed_Impl(); |
404 | | |
405 | | public: |
406 | | SC_DLLPUBLIC ScDatabaseRangeObj(ScDocShell* pDocSh, OUString aNm); |
407 | | SC_DLLPUBLIC ScDatabaseRangeObj(ScDocShell* pDocSh, const SCTAB nTab); |
408 | | virtual ~ScDatabaseRangeObj() override; |
409 | | |
410 | | virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; |
411 | | |
412 | | // nField[] here within the area: |
413 | | void GetQueryParam(ScQueryParam& rQueryParam) const; |
414 | | void SetQueryParam(const ScQueryParam& rQueryParam); |
415 | | void GetSubTotalParam(ScSubTotalParam& rSubTotalParam) const; |
416 | | void SetSubTotalParam(const ScSubTotalParam& rSubTotalParam); |
417 | | |
418 | | // XNamed |
419 | | virtual OUString SAL_CALL getName() override; |
420 | | virtual void SAL_CALL setName( const OUString& aName ) override; |
421 | | |
422 | | // XDatabaseRange |
423 | | SC_DLLPUBLIC virtual css::table::CellRangeAddress SAL_CALL getDataArea() override; |
424 | | virtual void SAL_CALL setDataArea( const css::table::CellRangeAddress& aDataArea ) override; |
425 | | virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL |
426 | | getSortDescriptor() override; |
427 | | virtual css::uno::Reference< css::sheet::XSheetFilterDescriptor > SAL_CALL |
428 | | getFilterDescriptor() override; |
429 | | virtual css::uno::Reference< css::sheet::XSubTotalDescriptor > SAL_CALL |
430 | | getSubTotalDescriptor() override; |
431 | | virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL |
432 | | getImportDescriptor() override; |
433 | | |
434 | | // XRefreshable |
435 | | virtual void SAL_CALL refresh() override; |
436 | | virtual void SAL_CALL addRefreshListener( const css::uno::Reference< |
437 | | css::util::XRefreshListener >& l ) override; |
438 | | virtual void SAL_CALL removeRefreshListener( const css::uno::Reference< |
439 | | css::util::XRefreshListener >& l ) override; |
440 | | |
441 | | // XCellRangeReferrer |
442 | | virtual css::uno::Reference< css::table::XCellRange > SAL_CALL |
443 | | getReferredCells() override; |
444 | | |
445 | | // XPropertySet |
446 | | virtual css::uno::Reference< css::beans::XPropertySetInfo > |
447 | | SAL_CALL getPropertySetInfo() override; |
448 | | SC_DLLPUBLIC virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, |
449 | | const css::uno::Any& aValue ) override; |
450 | | SC_DLLPUBLIC virtual css::uno::Any SAL_CALL getPropertyValue( |
451 | | const OUString& PropertyName ) override; |
452 | | virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, |
453 | | const css::uno::Reference< |
454 | | css::beans::XPropertyChangeListener >& xListener ) override; |
455 | | virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, |
456 | | const css::uno::Reference< |
457 | | css::beans::XPropertyChangeListener >& aListener ) override; |
458 | | virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, |
459 | | const css::uno::Reference< |
460 | | css::beans::XVetoableChangeListener >& aListener ) override; |
461 | | virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, |
462 | | const css::uno::Reference< |
463 | | css::beans::XVetoableChangeListener >& aListener ) override; |
464 | | |
465 | | // XServiceInfo |
466 | | virtual OUString SAL_CALL getImplementationName() override; |
467 | | virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; |
468 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
469 | | }; |
470 | | |
471 | | class ScDatabaseRangesObj final : public cppu::WeakImplHelper< |
472 | | css::sheet::XDatabaseRanges, |
473 | | css::container::XEnumerationAccess, |
474 | | css::container::XIndexAccess, |
475 | | css::lang::XServiceInfo >, |
476 | | public SfxListener |
477 | | { |
478 | | private: |
479 | | ScDocShell* pDocShell; |
480 | | |
481 | | rtl::Reference<ScDatabaseRangeObj> GetObjectByIndex_Impl(size_t nIndex); |
482 | | rtl::Reference<ScDatabaseRangeObj> GetObjectByName_Impl(const OUString& aName); |
483 | | |
484 | | public: |
485 | | ScDatabaseRangesObj(ScDocShell* pDocSh); |
486 | | virtual ~ScDatabaseRangesObj() override; |
487 | | |
488 | | virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; |
489 | | |
490 | | // XDatabaseRanges |
491 | | virtual void SAL_CALL addNewByName( const OUString& aName, |
492 | | const css::table::CellRangeAddress& aRange ) override; |
493 | | virtual void SAL_CALL removeByName( const OUString& aName ) override; |
494 | | |
495 | | // XEnumerationAccess |
496 | | virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL |
497 | | createEnumeration() override; |
498 | | |
499 | | // XIndexAccess |
500 | | virtual sal_Int32 SAL_CALL getCount() override; |
501 | | virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override; |
502 | | |
503 | | // XElementAccess |
504 | | virtual css::uno::Type SAL_CALL getElementType() override; |
505 | | virtual sal_Bool SAL_CALL hasElements() override; |
506 | | |
507 | | // XNameAccess |
508 | | virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override; |
509 | | virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override; |
510 | | virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override; |
511 | | |
512 | | // XServiceInfo |
513 | | virtual OUString SAL_CALL getImplementationName() override; |
514 | | virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; |
515 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
516 | | }; |
517 | | |
518 | | class ScUnnamedDatabaseRangesObj final : public cppu::WeakImplHelper< |
519 | | css::sheet::XUnnamedDatabaseRanges>, |
520 | | public SfxListener |
521 | | { |
522 | | private: |
523 | | ScDocShell* pDocShell; |
524 | | |
525 | | public: |
526 | | ScUnnamedDatabaseRangesObj(ScDocShell* pDocSh); |
527 | | virtual ~ScUnnamedDatabaseRangesObj() override; |
528 | | |
529 | | virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; |
530 | | |
531 | | // XUnnamedDatabaseRanges |
532 | | virtual void SAL_CALL setByTable( const css::table::CellRangeAddress& aRange ) override; |
533 | | virtual css::uno::Any SAL_CALL getByTable( sal_Int32 nTab ) override; |
534 | | virtual sal_Bool SAL_CALL hasByTable( sal_Int32 nTab ) override; |
535 | | }; |
536 | | |
537 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |