LibreOffice Module sc (master)  1
dapiuno.hxx
Go to the documentation of this file.
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 "cellsuno.hxx"
23 #include "dpglobal.hxx"
24 
25 #include <svl/lstner.hxx>
26 #include <svl/itemprop.hxx>
27 
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/lang/XUnoTunnel.hpp>
30 #include <com/sun/star/beans/XPropertySet.hpp>
31 #include <com/sun/star/container/XEnumerationAccess.hpp>
32 #include <com/sun/star/container/XNameContainer.hpp>
33 #include <com/sun/star/util/XModifyBroadcaster.hpp>
34 
35 #include <com/sun/star/sheet/DataPilotFieldGroupInfo.hpp>
36 #include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
37 #include <com/sun/star/sheet/XDataPilotDataLayoutFieldSupplier.hpp>
38 #include <com/sun/star/sheet/XDataPilotDescriptor.hpp>
39 #include <com/sun/star/sheet/XDataPilotField.hpp>
40 #include <com/sun/star/sheet/XDataPilotFieldGrouping.hpp>
41 #include <com/sun/star/sheet/XDataPilotTable2.hpp>
42 #include <com/sun/star/sheet/XDataPilotTables.hpp>
43 
44 #include <cppuhelper/implbase.hxx>
45 
46 #include <memory>
47 #include <vector>
48 
49 namespace com::sun::star::sheet { struct DataPilotFieldAutoShowInfo; }
50 namespace com::sun::star::sheet { class XMembersAccess; }
51 namespace com::sun::star::sheet { struct DataPilotFieldLayoutInfo; }
52 namespace com::sun::star::sheet { struct DataPilotFieldReference; }
53 namespace com::sun::star::sheet { struct DataPilotFieldSortInfo; }
54 
55 
56 class ScDocShell;
57 class ScDPSaveDimension;
58 struct ScDPNumGroupInfo;
59 
62 class ScDataPilotItemObj;
63 enum class ScGeneralFunction;
64 class ScDPObject;
65 
67 {
68 public:
69  static ScGeneralFunction FirstFunc( PivotFunc nBits );
70  static PivotFunc FunctionBit( sal_Int16 eFunc );
71 
72  static void FillGroupInfo(
73  css::sheet::DataPilotFieldGroupInfo& rInfo,
74  const ScDPNumGroupInfo& rGroupInfo );
75 };
76 
78 class ScDataPilotTablesObj final : public cppu::WeakImplHelper<
79  css::sheet::XDataPilotTables,
80  css::container::XEnumerationAccess,
81  css::container::XIndexAccess,
82  css::lang::XServiceInfo>,
83  public SfxListener
84 {
85 private:
88 
91 
92 public:
94  virtual ~ScDataPilotTablesObj() override;
95 
96  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
97 
98  // XDataPilotTables
99  virtual css::uno::Reference< css::sheet::XDataPilotDescriptor > SAL_CALL
100  createDataPilotDescriptor() override;
101  virtual void SAL_CALL insertNewByName( const OUString& aName,
102  const css::table::CellAddress& aOutputAddress,
103  const css::uno::Reference< css::sheet::XDataPilotDescriptor >& xDescriptor ) override;
104  virtual void SAL_CALL removeByName( const OUString& aName ) override;
105 
106  // XNameAccess
107  virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
108  virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
109  virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
110 
111  // XIndexAccess
112  virtual sal_Int32 SAL_CALL getCount() override;
113  virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
114 
115  // XEnumerationAccess
116  virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
117  createEnumeration() override;
118 
119  // XElementAccess
120  virtual css::uno::Type SAL_CALL getElementType() override;
121  virtual sal_Bool SAL_CALL hasElements() override;
122 
123  // XServiceInfo
124  virtual OUString SAL_CALL getImplementationName() override;
125  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
126  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
127 };
128 
129 // ScDataPilotDescriptorBase is never instantiated directly
130 class SAL_DLLPUBLIC_RTTI ScDataPilotDescriptorBase :
131  public cppu::WeakImplHelper<
132  css::sheet::XDataPilotDescriptor,
133  css::beans::XPropertySet,
134  css::sheet::XDataPilotDataLayoutFieldSupplier,
135  css::lang::XServiceInfo,
136  css::lang::XUnoTunnel>,
137  public SfxListener
138 {
139 private:
142 
143 public:
145  virtual ~ScDataPilotDescriptorBase() override;
146 
147  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
148 
149  ScDocShell* GetDocShell() const { return pDocShell; }
150 
151  // in the derivatives:
152  virtual ScDPObject* GetDPObject() const = 0;
153  virtual void SetDPObject(ScDPObject* pDPObj) = 0;
154 
155  // XDataPilotDescriptor
156  // getName, setName, getTag, setTag in derived classes
157 
158  virtual css::table::CellRangeAddress SAL_CALL getSourceRange() override;
159  virtual void SAL_CALL setSourceRange( const css::table::CellRangeAddress& aSourceRange ) override;
160  virtual css::uno::Reference< css::sheet::XSheetFilterDescriptor > SAL_CALL
161  getFilterDescriptor() override;
162  virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL
163  getDataPilotFields() override;
164  virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL
165  getColumnFields() override;
166  virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL
167  getRowFields() override;
168  virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL
169  getPageFields() override;
170  virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL
171  getDataFields() override;
172  virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL
173  getHiddenFields() override;
174 
175  // XPropertySet
176  virtual css::uno::Reference< css::beans::XPropertySetInfo >
177  SAL_CALL getPropertySetInfo( ) override;
178  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
179  const css::uno::Any& aValue ) override;
180  virtual css::uno::Any SAL_CALL getPropertyValue(
181  const OUString& PropertyName ) override;
182  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
183  const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
184  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
185  const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
186  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
187  const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
188  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
189  const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
190 
191  // XDataPilotDataLayoutFieldSupplier
192  virtual css::uno::Reference< css::sheet::XDataPilotField >
193  SAL_CALL getDataLayoutField() override;
194 
195  // XUnoTunnel
196  virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence<
197  sal_Int8 >& aIdentifier ) override;
198 
199  SC_DLLPUBLIC static const css::uno::Sequence<sal_Int8>& getUnoTunnelId();
200 
201  // XServiceInfo is in derived classes
202 };
203 
205 {
206 private:
207  std::unique_ptr<ScDPObject> mpDPObject;
208 
209 public:
211  virtual ~ScDataPilotDescriptor() override;
212 
213  virtual ScDPObject* GetDPObject() const override;
214  virtual void SetDPObject(ScDPObject* pDPObj) override;
215 
216  // rest of XDataPilotDescriptor (incl. XNamed)
217  virtual OUString SAL_CALL getName() override;
218  virtual void SAL_CALL setName( const OUString& aName ) override;
219  virtual OUString SAL_CALL getTag() override;
220  virtual void SAL_CALL setTag( const OUString& aTag ) override;
221 
222  // XServiceInfo
223  virtual OUString SAL_CALL getImplementationName() override;
224  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
225  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
226 };
227 
229  public css::sheet::XDataPilotTable2,
230  public css::util::XModifyBroadcaster
231 {
232 private:
234  OUString aName;
236 
237  void Refreshed_Impl();
238 
239 public:
240  ScDataPilotTableObj(ScDocShell* pDocSh, SCTAB nT, const OUString& rN);
241  virtual ~ScDataPilotTableObj() override;
242 
243  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
244  virtual void SAL_CALL acquire() noexcept override;
245  virtual void SAL_CALL release() noexcept override;
246 
247  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
248 
249  virtual ScDPObject* GetDPObject() const override;
250  virtual void SetDPObject(ScDPObject* pDPObj) override;
251 
252  // rest of XDataPilotDescriptor (incl. XNamed)
253  virtual OUString SAL_CALL getName() override;
254  virtual void SAL_CALL setName( const OUString& aName ) override;
255  virtual OUString SAL_CALL getTag() override;
256  virtual void SAL_CALL setTag( const OUString& aTag ) override;
257 
258  // XDataPilotTable
259  virtual css::table::CellRangeAddress SAL_CALL getOutputRange() override;
260  virtual void SAL_CALL refresh() override;
261 
262  // XDataPilotTable2
263  virtual css::uno::Sequence< css::uno::Sequence< css::uno::Any > >
264  SAL_CALL getDrillDownData(const css::table::CellAddress& aAddr) override;
265 
266  virtual css::sheet::DataPilotTablePositionData
267  SAL_CALL getPositionData(const css::table::CellAddress& aAddr) override;
268 
269  virtual void SAL_CALL insertDrillDownSheet(const css::table::CellAddress& aAddr) override;
270 
271  virtual css::table::CellRangeAddress SAL_CALL getOutputRangeByType( sal_Int32 nType ) override;
272 
273  // XModifyBroadcaster
274  virtual void SAL_CALL addModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
275  virtual void SAL_CALL removeModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
276 
277  // XTypeProvider (override)
278  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
279  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
280 
281  // XServiceInfo
282  virtual OUString SAL_CALL getImplementationName() override;
283  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
284  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
285 };
286 
288 {
289  OUString maFieldName;
290  sal_Int32 mnFieldIdx;
292 
293  explicit ScFieldIdentifier() :
294  mnFieldIdx( 0 ), mbDataLayout( false ) {}
295 
296  explicit ScFieldIdentifier( const OUString& rFieldName, bool bDataLayout ) :
297  maFieldName( rFieldName ), mnFieldIdx( 0 ), mbDataLayout( bDataLayout ) {}
298 };
299 
303 {
304 protected:
306  explicit ScDataPilotChildObjBase( ScDataPilotDescriptorBase& rParent, const ScFieldIdentifier& rFieldId );
307  virtual ~ScDataPilotChildObjBase();
308 
310  ScDPObject* GetDPObject() const;
312  void SetDPObject( ScDPObject* pDPObject );
313 
315  ScDPSaveDimension* GetDPDimension( ScDPObject** ppDPObject = nullptr ) const;
316 
318  sal_Int32 GetMemberCount() const;
320  css::uno::Reference< css::sheet::XMembersAccess > GetMembers() const;
321 
322  ScDocShell* GetDocShell() const;
323 protected:
326 
327 private:
329 };
330 
331 typedef ::cppu::WeakImplHelper
332 <
333  css::container::XEnumerationAccess,
334  css::container::XIndexAccess,
335  css::container::XNameAccess,
336  css::lang::XServiceInfo
337 >
339 
342 {
343 public:
344  explicit ScDataPilotFieldsObj(
345  ScDataPilotDescriptorBase& rParent );
346 
347  explicit ScDataPilotFieldsObj(
348  ScDataPilotDescriptorBase& rParent,
349  css::sheet::DataPilotFieldOrientation eOrient );
350 
351  virtual ~ScDataPilotFieldsObj() override;
352 
353  // XNameAccess
354  virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
355  virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
356  virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
357 
358  // XIndexAccess
359  virtual sal_Int32 SAL_CALL getCount() override;
360  virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
361 
362  // XEnumerationAccess
363  virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
364  createEnumeration() override;
365 
366  // XElementAccess
367  virtual css::uno::Type SAL_CALL getElementType() override;
368  virtual sal_Bool SAL_CALL hasElements() override;
369 
370  // XServiceInfo
371  virtual OUString SAL_CALL getImplementationName() override;
372  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
373  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
374 
375 private:
376  rtl::Reference<ScDataPilotFieldObj> GetObjectByIndex_Impl( sal_Int32 nIndex ) const;
377  rtl::Reference<ScDataPilotFieldObj> GetObjectByName_Impl( const OUString& rName ) const;
378 
379 private:
380  css::uno::Any maOrient;
381 };
382 
383 typedef ::cppu::WeakImplHelper
384 <
385  css::container::XNamed,
386  css::beans::XPropertySet,
387  css::sheet::XDataPilotField,
388  css::sheet::XDataPilotFieldGrouping,
389  css::lang::XServiceInfo
390 >
392 
395 {
396 public:
398  ScDataPilotDescriptorBase& rParent,
399  const ScFieldIdentifier& rIdent );
400 
402  ScDataPilotDescriptorBase& rParent,
403  const ScFieldIdentifier& rIdent,
404  const css::uno::Any& rOrient );
405 
406  virtual ~ScDataPilotFieldObj() override;
407 
408  // XNamed
409  virtual OUString SAL_CALL getName() override;
410  virtual void SAL_CALL setName(const OUString& aName) override;
411 
412  // XPropertySet
413  virtual css::uno::Reference< css::beans::XPropertySetInfo >
414  SAL_CALL getPropertySetInfo( ) override;
415  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
416  const css::uno::Any& aValue ) override;
417  virtual css::uno::Any SAL_CALL getPropertyValue(const OUString& PropertyName ) override;
418  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
419  const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
420  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
421  const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
422  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
423  const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
424  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
425  const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
426 
427  // XDatePilotField
428  virtual css::uno::Reference<css::container::XIndexAccess> SAL_CALL
429  getItems() override;
430 
431  // only called from property-functions:
432  css::sheet::DataPilotFieldOrientation getOrientation() const;
433  void setOrientation(css::sheet::DataPilotFieldOrientation Orientation);
434  sal_Int16 getFunction() const;
435  void setFunction(ScGeneralFunction Function);
436  css::uno::Sequence< sal_Int16 > getSubtotals() const;
437  void setSubtotals(const std::vector< ScGeneralFunction >& rFunctions);
438  void setCurrentPage(const OUString& sPage);
439  void setUseCurrentPage(bool bUse);
440  const css::sheet::DataPilotFieldAutoShowInfo* getAutoShowInfo() const;
441  void setAutoShowInfo(const css::sheet::DataPilotFieldAutoShowInfo* pInfo);
442  const css::sheet::DataPilotFieldLayoutInfo* getLayoutInfo() const;
443  void setLayoutInfo(const css::sheet::DataPilotFieldLayoutInfo* pInfo);
444  const css::sheet::DataPilotFieldReference* getReference() const;
445  void setReference(const css::sheet::DataPilotFieldReference* pInfo);
446  const css::sheet::DataPilotFieldSortInfo* getSortInfo() const;
447  void setSortInfo(const css::sheet::DataPilotFieldSortInfo* pInfo);
448  bool getShowEmpty() const;
449  void setShowEmpty(bool bShow);
450  bool getRepeatItemLabels() const;
451  void setRepeatItemLabels(bool bShow);
452 
453  bool hasGroupInfo() const;
454  css::sheet::DataPilotFieldGroupInfo getGroupInfo();
455  void setGroupInfo(const css::sheet::DataPilotFieldGroupInfo* pInfo);
456 
457  // XDataPilotFieldGrouping
458  virtual css::uno::Reference < css::sheet::XDataPilotField > SAL_CALL
459  createNameGroup(const css::uno::Sequence< OUString >& aItems) override;
460  virtual css::uno::Reference < css::sheet::XDataPilotField > SAL_CALL
461  createDateGroup(const css::sheet::DataPilotFieldGroupInfo& rInfo) override;
462 
463  // XServiceInfo
464  virtual OUString SAL_CALL getImplementationName() override;
465  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
466  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
467 
468 private:
469  css::uno::Reference< css::container::XIndexAccess >
472  css::uno::Any maOrient;
473 };
474 
475 typedef ::std::vector< OUString > ScFieldGroupMembers;
476 
478 {
479  OUString maName;
480  ScFieldGroupMembers maMembers;
481 };
482 
483 typedef ::std::vector< ScFieldGroup > ScFieldGroups;
484 
485 typedef ::cppu::WeakImplHelper
486 <
487  css::container::XNameContainer,
488  css::container::XEnumerationAccess,
489  css::container::XIndexAccess,
490  css::lang::XServiceInfo
491 >
493 
501 {
502 public:
503  explicit ScDataPilotFieldGroupsObj( ScFieldGroups&& rGroups );
504  virtual ~ScDataPilotFieldGroupsObj() override;
505 
506  // XNameAccess
507  virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
508  virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
509  virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
510 
511  // XNameReplace
512  virtual void SAL_CALL replaceByName( const OUString& aName,
513  const css::uno::Any& aElement ) override;
514 
515  // XNameContainer
516  virtual void SAL_CALL insertByName( const OUString& aName,
517  const css::uno::Any& aElement ) override;
518  virtual void SAL_CALL removeByName( const OUString& Name ) override;
519 
520  // XIndexAccess
521  virtual sal_Int32 SAL_CALL getCount() override;
522  virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
523 
524  // XEnumerationAccess
525  virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
526  createEnumeration() override;
527 
528  // XElementAccess
529  virtual css::uno::Type SAL_CALL getElementType() override;
530  virtual sal_Bool SAL_CALL hasElements() override;
531 
532  // XServiceInfo
533  virtual OUString SAL_CALL getImplementationName() override;
534  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
535  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
536 
537  // implementation
539  ScFieldGroup& getFieldGroup( const OUString& rName );
541  void renameFieldGroup( const OUString& rOldName, const OUString& rNewName );
542 
543 private:
544  ScFieldGroups::iterator implFindByName( const OUString& rName );
545 
546 private:
547  ScFieldGroups maGroups;
548 };
549 
550 typedef ::cppu::WeakImplHelper
551 <
552  css::container::XNameContainer,
553  css::container::XEnumerationAccess,
554  css::container::XIndexAccess,
555  css::container::XNamed,
556  css::lang::XServiceInfo
557 >
559 
561 {
562 public:
563  explicit ScDataPilotFieldGroupObj( ScDataPilotFieldGroupsObj& rParent, const OUString& rGroupName );
564  virtual ~ScDataPilotFieldGroupObj() override;
565 
566  // XNameAccess
567  virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
568  virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
569  virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
570 
571  // XNameReplace
572  virtual void SAL_CALL replaceByName( const OUString& aName,
573  const css::uno::Any& aElement ) override;
574 
575  // XNameContainer
576  virtual void SAL_CALL insertByName( const OUString& aName,
577  const css::uno::Any& aElement ) override;
578  virtual void SAL_CALL removeByName( const OUString& Name ) override;
579 
580  // XIndexAccess
581  virtual sal_Int32 SAL_CALL getCount() override;
582  virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
583 
584  // XEnumerationAccess
585  virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
586  createEnumeration() override;
587 
588  // XElementAccess
589  virtual css::uno::Type SAL_CALL getElementType() override;
590  virtual sal_Bool SAL_CALL hasElements() override;
591 
592  // XNamed
593  virtual OUString SAL_CALL getName() override;
594  virtual void SAL_CALL setName( const OUString& aName ) override;
595 
596  // XServiceInfo
597  virtual OUString SAL_CALL getImplementationName() override;
598  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
599  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
600 
601 private:
603  OUString maGroupName;
604 };
605 
606 typedef ::cppu::WeakImplHelper
607 <
608  css::container::XNamed,
609  css::lang::XServiceInfo
610 >
612 
614 {
615 public:
616  explicit ScDataPilotFieldGroupItemObj( ScDataPilotFieldGroupObj& rParent, const OUString& rName );
617  virtual ~ScDataPilotFieldGroupItemObj() override;
618 
619  // XNamed
620  virtual OUString SAL_CALL getName() override;
621  virtual void SAL_CALL setName( const OUString& aName ) override;
622 
623  // XServiceInfo
624  virtual OUString SAL_CALL getImplementationName() override;
625  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
626  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
627 
628 private:
630  OUString maName;
631 };
632 
633 typedef ::cppu::WeakImplHelper
634 <
635  css::container::XEnumerationAccess,
636  css::container::XIndexAccess,
637  css::container::XNameAccess,
638  css::lang::XServiceInfo
639 >
641 
643 {
644 public:
645  explicit ScDataPilotItemsObj( ScDataPilotDescriptorBase& rParent, const ScFieldIdentifier& rFieldId );
646  virtual ~ScDataPilotItemsObj() override;
647 
648  // XNameAccess
649  virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
650  virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
651  virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
652 
653  // XIndexAccess
654  virtual sal_Int32 SAL_CALL getCount() override;
655  virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
656 
657  // XEnumerationAccess
658  virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
659  createEnumeration() override;
660 
661  // XElementAccess
662  virtual css::uno::Type SAL_CALL getElementType() override;
663  virtual sal_Bool SAL_CALL hasElements() override;
664 
665  // XServiceInfo
666  virtual OUString SAL_CALL getImplementationName() override;
667  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
668  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
669 
670 private:
671  ScDataPilotItemObj* GetObjectByIndex_Impl( sal_Int32 nIndex ) const;
672 };
673 
674 typedef ::cppu::WeakImplHelper
675 <
676  css::container::XNamed,
677  css::beans::XPropertySet,
678  css::lang::XServiceInfo
679 >
681 
683 {
684 public:
685  explicit ScDataPilotItemObj(
686  ScDataPilotDescriptorBase& rParent,
687  const ScFieldIdentifier& rFieldId,
688  sal_Int32 nIndex );
689 
690  virtual ~ScDataPilotItemObj() override;
691 
692  // XNamed
693  virtual OUString SAL_CALL getName() override;
694  virtual void SAL_CALL setName( const OUString& aName ) override;
695 
696  // XPropertySet
697  virtual css::uno::Reference< css::beans::XPropertySetInfo >
698  SAL_CALL getPropertySetInfo( ) override;
699  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
700  const css::uno::Any& aValue ) override;
701  virtual css::uno::Any SAL_CALL getPropertyValue(
702  const OUString& PropertyName ) override;
703  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
704  const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
705  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
706  const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
707  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
708  const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
709  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
710  const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
711 
712  // XServiceInfo
713  virtual OUString SAL_CALL getImplementationName() override;
714  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
715  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
716 
717 private:
719  sal_Int32 mnIndex;
720 };
721 
722 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
Definition: dapiuno.cxx:514
virtual void SAL_CALL insertDrillDownSheet(const css::table::CellAddress &aAddr) override
Definition: dapiuno.cxx:1162
ScDocShell * pDocShell
Definition: dapiuno.hxx:86
Type
css::uno::Any maOrient
Definition: dapiuno.hxx:472
virtual css::table::CellRangeAddress SAL_CALL getOutputRangeByType(sal_Int32 nType) override
Definition: dapiuno.cxx:1178
sal_Int32 nIndex
static ScGeneralFunction FirstFunc(PivotFunc nBits)
Definition: dapiuno.cxx:194
::cppu::WeakImplHelper< css::container::XNameContainer, css::container::XEnumerationAccess, css::container::XIndexAccess, css::container::XNamed, css::lang::XServiceInfo > ScDataPilotFieldGroupObjImpl
Definition: dapiuno.hxx:558
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: dapiuno.cxx:939
std::unique_ptr< ScDPObject > mpDPObject
Definition: dapiuno.hxx:207
virtual css::uno::Reference< css::sheet::XDataPilotDescriptor > SAL_CALL createDataPilotDescriptor() override
Definition: dapiuno.cxx:360
signed char sal_Int8
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Int32 SAL_CALL getCount() override
Definition: dapiuno.cxx:465
virtual OUString SAL_CALL getName() override
Definition: dapiuno.cxx:1297
virtual ~ScDataPilotDescriptor() override
Definition: dapiuno.cxx:1277
rtl::Reference< ScDataPilotFieldGroupObj > mxParent
Definition: dapiuno.hxx:629
sal_Int32 mnFieldIdx
Source field name.
Definition: dapiuno.hxx:290
::cppu::WeakImplHelper< css::container::XNamed, css::beans::XPropertySet, css::lang::XServiceInfo > ScDataPilotItemObjImpl
Definition: dapiuno.hxx:680
const SfxListener & operator=(const SfxListener &)=delete
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: dapiuno.cxx:693
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
Definition: dapiuno.cxx:523
virtual ScDPObject * GetDPObject() const override
Definition: dapiuno.cxx:1281
ScFieldGroups maGroups
Definition: dapiuno.hxx:547
OUString Name
::cppu::WeakImplHelper< css::container::XEnumerationAccess, css::container::XIndexAccess, css::container::XNameAccess, css::lang::XServiceInfo > ScDataPilotFieldsObjImpl
Definition: dapiuno.hxx:338
DataPilotTables collection per sheet.
Definition: dapiuno.hxx:78
virtual css::sheet::DataPilotTablePositionData SAL_CALL getPositionData(const css::table::CellAddress &aAddr) override
Definition: dapiuno.cxx:1149
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: dapiuno.cxx:834
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: dapiuno.cxx:313
static void FillGroupInfo(css::sheet::DataPilotFieldGroupInfo &rInfo, const ScDPNumGroupInfo &rGroupInfo)
Definition: dapiuno.cxx:238
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
std::vector< css::uno::Reference< css::util::XModifyListener > > XModifyListenerArr_Impl
Definition: cellsuno.hxx:130
virtual OUString SAL_CALL getTag() override
Definition: dapiuno.cxx:1309
OUString maName
Definition: dapiuno.hxx:479
::std::vector< ScFieldGroup > ScFieldGroups
Definition: dapiuno.hxx:483
B2VectorOrientation getOrientation(const B2DPolygon &rCandidate)
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: dapiuno.cxx:944
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
Definition: dapiuno.cxx:1192
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
PivotFunc
Definition: dpglobal.hxx:24
ScDocShell * pDocShell
Definition: dapiuno.hxx:141
ScFieldIdentifier(const OUString &rFieldName, bool bDataLayout)
Definition: dapiuno.hxx:296
virtual void SAL_CALL acquire() noexcept override
Definition: dapiuno.cxx:1015
::cppu::WeakImplHelper< css::container::XNameContainer, css::container::XEnumerationAccess, css::container::XIndexAccess, css::lang::XServiceInfo > ScDataPilotFieldGroupsObjImpl
Definition: dapiuno.hxx:492
bool mbDataLayout
Field index (if several fields with same name exist).
Definition: dapiuno.hxx:291
css::uno::Reference< css::container::XIndexAccess > mxItems
Definition: dapiuno.hxx:470
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: dapiuno.cxx:457
virtual css::uno::Sequence< css::uno::Sequence< css::uno::Any > > SAL_CALL getDrillDownData(const css::table::CellAddress &aAddr) override
Definition: dapiuno.cxx:1136
static PivotFunc FunctionBit(sal_Int16 eFunc)
Definition: dapiuno.cxx:212
ScDataPilotDescriptor(ScDocShell *pDocSh)
Definition: dapiuno.cxx:1262
Collection of all DataPilot fields, or of all fields from a specific dimension.
Definition: dapiuno.hxx:341
rtl::Reference< ScDataPilotDescriptorBase > mxParent
Definition: dapiuno.hxx:324
Orientation
::cppu::WeakImplHelper< css::container::XEnumerationAccess, css::container::XIndexAccess, css::container::XNameAccess, css::lang::XServiceInfo > ScDataPilotItemsObjImpl
Definition: dapiuno.hxx:640
virtual css::uno::Type SAL_CALL getElementType() override
Definition: dapiuno.cxx:500
virtual css::table::CellRangeAddress SAL_CALL getOutputRange() override
Definition: dapiuno.cxx:1108
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: dapiuno.cxx:685
ScFieldIdentifier maFieldId
Definition: dapiuno.hxx:325
virtual OUString SAL_CALL getImplementationName() override
Implementation of a single DataPilot field.
Definition: dapiuno.hxx:394
SfxItemPropertySet maPropSet
Definition: dapiuno.hxx:471
unsigned char sal_Bool
XModifyListenerArr_Impl aModifyListeners
Definition: dapiuno.hxx:235
virtual void SAL_CALL setTag(const OUString &aTag) override
Definition: dapiuno.cxx:1315
ScFieldGroupMembers maMembers
Definition: dapiuno.hxx:480
rtl::Reference< ScDataPilotTableObj > GetObjectByName_Impl(const OUString &aName)
Definition: dapiuno.cxx:353
virtual sal_Bool SAL_CALL hasElements() override
Definition: dapiuno.cxx:506
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
Definition: dapiuno.cxx:560
bool setPropertyValue(uno::Sequence< beans::PropertyValue > &aProp, const OUString &aName, const uno::Any &aValue)
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: dapiuno.cxx:954
rtl::Reference< ScDataPilotFieldGroupsObj > mxParent
Definition: dapiuno.hxx:602
ScDataPilotTableObj(ScDocShell *pDocSh, SCTAB nT, const OUString &rN)
Definition: dapiuno.cxx:992
ScDataPilotTablesObj(ScDocShell *pDocSh, SCTAB nT)
Definition: dapiuno.cxx:298
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: dapiuno.cxx:1036
virtual void SetDPObject(ScDPObject *pDPObj) override
Definition: dapiuno.cxx:1046
rtl::Reference< ScDataPilotTableObj > GetObjectByIndex_Impl(sal_Int32 nIndex)
Definition: dapiuno.cxx:325
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: dapiuno.cxx:1025
ScDocShell * GetDocShell() const
Definition: dapiuno.hxx:149
Implementation of all grouped items in a DataPilot field.
Definition: dapiuno.hxx:500
virtual void SAL_CALL setTag(const OUString &aTag) override
Definition: dapiuno.cxx:1093
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: dapiuno.cxx:1004
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: dapiuno.cxx:491
css::uno::Any maOrient
Definition: dapiuno.hxx:380
virtual void SAL_CALL release() noexcept override
Definition: dapiuno.cxx:1020
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint)
SfxItemPropertySet maPropSet
Definition: dapiuno.hxx:140
::cppu::WeakImplHelper< css::container::XNamed, css::beans::XPropertySet, css::sheet::XDataPilotField, css::sheet::XDataPilotFieldGrouping, css::lang::XServiceInfo > ScDataPilotFieldObjImpl
Definition: dapiuno.hxx:391
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
::std::vector< OUString > ScFieldGroupMembers
Definition: dapiuno.hxx:475
virtual ~ScDataPilotTablesObj() override
Definition: dapiuno.cxx:305
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: dapiuno.cxx:1228
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
Definition: dapiuno.cxx:1204
ScGeneralFunction
the css::sheet::GeneralFunction enum is extended by constants in GeneralFunction2, which causes some type-safety issues.
virtual void SAL_CALL removeByName(const OUString &aName) override
Definition: dapiuno.cxx:443
ScFieldIdentifier()
True = data layout field collecting all data fields as items.
Definition: dapiuno.hxx:293
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:398
virtual OUString SAL_CALL getTag() override
Definition: dapiuno.cxx:1084
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL insertNewByName(const OUString &aName, const css::table::CellAddress &aOutputAddress, const css::uno::Reference< css::sheet::XDataPilotDescriptor > &xDescriptor) override
Definition: dapiuno.cxx:405
virtual void SAL_CALL refresh() override
Definition: dapiuno.cxx:1125
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL setName(const OUString &aName) override
Definition: dapiuno.cxx:1068
SfxItemPropertySet maPropSet
Definition: dapiuno.hxx:718
Base class of all implementation objects based on a DataPilot descriptor or DataPilot table object...
Definition: dapiuno.hxx:302
virtual void SAL_CALL setName(const OUString &aName) override
Definition: dapiuno.cxx:1303
virtual ~ScDataPilotTableObj() override
Definition: dapiuno.cxx:1000
struct _ADOIndex Index
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
virtual OUString SAL_CALL getName() override
Definition: dapiuno.cxx:1059
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: dapiuno.cxx:949
sal_Int16 SCTAB
Definition: types.hxx:22
virtual void SetDPObject(ScDPObject *pDPObj) override
Definition: dapiuno.cxx:1286
virtual ScDPObject * GetDPObject() const override
Definition: dapiuno.cxx:1041
::cppu::WeakImplHelper< css::container::XNamed, css::lang::XServiceInfo > ScDataPilotFieldGroupItemObjImpl
Definition: dapiuno.hxx:611
sal_Int32 mnIndex
Definition: dapiuno.hxx:719
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
OUString maFieldName
Definition: dapiuno.hxx:289