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