/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #ifndef INCLUDED_SC_INC_DPTABSRC_HXX #define INCLUDED_SC_INC_DPTABSRC_HXX #include "global.hxx" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dptabdat.hxx" #include "dpglobal.hxx" #include "dpresfilter.hxx" #include #include #include #include #include namespace com { namespace sun { namespace star { namespace sheet { struct DataPilotFieldFilter; } namespace table { struct CellAddress; } }}} class ScDPResultMember; class ScDPResultData; class ScDPItemData; class ScDPTableData; // implementation of DataPilotSource using ScDPTableData class ScDPDimensions; class ScDPDimension; class ScDPHierarchies; class ScDPHierarchy; class ScDPLevels; class ScDPLevel; class ScDPMembers; class ScDPMember; class ScDPSource : public cppu::WeakImplHelper< css::sheet::XDimensionsSupplier, css::sheet::XDataPilotResults, css::util::XRefreshable, css::sheet::XDrillDownDataSupplier, css::beans::XPropertySet, css::lang::XServiceInfo > { private: ScDPTableData* pData; // data source (ScDPObject manages its life time) rtl::Reference pDimensions; // api objects // settings: std::vector maColDims; std::vector maRowDims; std::vector maDataDims; std::vector maPageDims; ScDPResultTree maResFilterSet; bool bColumnGrand; bool bRowGrand; bool bIgnoreEmptyRows; bool bRepeatIfEmpty; long nDupCount; // results: ScDPResultData* pResData; // keep the rest in this! ScDPResultMember* pColResRoot; ScDPResultMember* pRowResRoot; css::uno::Sequence* pColResults; css::uno::Sequence* pRowResults; std::vector aColLevelList; std::vector aRowLevelList; bool bResultOverflow; bool bPageFiltered; // set if page field filters have been applied to cache table ::std::unique_ptr mpGrandTotalName; void CreateRes_Impl(); void FillMemberResults(); void FillLevelList( sal_uInt16 nOrientation, std::vector &rList ); void FillCalcInfo(bool bIsRow, ScDPTableData::CalcInfo& rInfo, bool &bHasAutoShow); /** * Compile a list of dimension indices that are either, column, row or * page dimensions (i.e. all but data dimensions). */ void GetCategoryDimensionIndices(std::unordered_set& rCatDims); /** * Set visibilities of individual rows in the cache table based on the * page field data. */ void FilterCacheByPageDimensions(); void SetDupCount( long nNew ); OUString getDataDescription(); //! ??? void setIgnoreEmptyRows(bool bSet); void setRepeatIfEmpty(bool bSet); void disposeData(); public: ScDPSource( ScDPTableData* pD ); virtual ~ScDPSource() override; ScDPTableData* GetData() { return pData; } const ScDPTableData* GetData() const { return pData; } const OUString* GetGrandTotalName() const; sal_uInt16 GetOrientation(long nColumn); void SetOrientation(long nColumn, sal_uInt16 nNew); long GetPosition(long nColumn); long GetDataDimensionCount(); ScDPDimension* GetDataDimension(long nIndex); OUString GetDataDimName(long nIndex); const ScDPCache* GetCache(); const ScDPItemData* GetItemDataById( long nDim, long nId ); SCROW GetMemberId( long nDim, const ScDPItemData& rData ); bool IsDataLayoutDimension(long nDim); sal_uInt16 GetDataLayoutOrientation(); bool IsDateDimension(long nDim); bool SubTotalAllowed(long nColumn); //! move to ScDPResultData ScDPDimension* AddDuplicated(long nSource, const OUString& rNewName); long GetDupCount() const { return nDupCount; } long GetSourceDim(long nDim); const css::uno::Sequence* GetMemberResults( ScDPLevel* pLevel ); ScDPDimensions* GetDimensionsObject(); // XDimensionsSupplier virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getDimensions( ) throw(css::uno::RuntimeException, std::exception) override; // XDataPilotResults virtual css::uno::Sequence< css::uno::Sequence< css::sheet::DataResult > > SAL_CALL getResults( ) throw(css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence SAL_CALL getFilteredResults( const css::uno::Sequence& aFilters ) throw (css::uno::RuntimeException, std::exception) override; // XRefreshable virtual void SAL_CALL refresh() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addRefreshListener( const css::uno::Reference< css::util::XRefreshListener >& l ) throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removeRefreshListener( const css::uno::Reference< css::util::XRefreshListener >& l ) throw(css::uno::RuntimeException, std::exception) override; // XDrillDownDataSupplier virtual css::uno::Sequence< css::uno::Sequence< css::uno::Any > > SAL_CALL getDrillDownData(const css::uno::Sequence< css::sheet::DataPilotFieldFilter >& aFilters ) throw(css::uno::RuntimeException, std::exception) override; // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; // XServiceInfo virtual OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; #if DEBUG_PIVOT_TABLE void DumpResults() const; #endif }; class ScDPDimensions : public cppu::WeakImplHelper< css::container::XNameAccess, css::lang::XServiceInfo > { private: ScDPSource* pSource; long nDimCount; ScDPDimension** ppDims; public: ScDPDimensions( ScDPSource* pSrc ); virtual ~ScDPDimensions() override; void CountChanged(); // XNameAccess virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) throw(css::uno::RuntimeException, std::exception) override; // XElementAccess virtual css::uno::Type SAL_CALL getElementType() throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL hasElements() throw(css::uno::RuntimeException, std::exception) override; // XServiceInfo virtual OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; long getCount() const; ScDPDimension* getByIndex(long nIndex) const; }; class ScDPDimension : public cppu::WeakImplHelper< css::sheet::XHierarchiesSupplier, css::container::XNamed, css::util::XCloneable, css::beans::XPropertySet, css::lang::XServiceInfo > { ScDPSource* pSource; long nDim; // dimension index (== column ID) rtl::Reference mxHierarchies; sal_uInt16 nFunction; // enum GeneralFunction OUString aName; // if empty, take from source std::unique_ptr mpLayoutName; std::unique_ptr mpSubtotalName; long nSourceDim; // >=0 if dup'ed css::sheet::DataPilotFieldReference aReferenceValue; // settings for "show data as" / "displayed value" bool bHasSelectedPage; OUString aSelectedPage; ScDPItemData* pSelectedData; // internal, temporary, created from aSelectedPage bool mbHasHiddenMember; public: ScDPDimension( ScDPSource* pSrc, long nD ); virtual ~ScDPDimension() override; ScDPDimension(const ScDPDimension&) = delete; ScDPDimension& operator=(const ScDPDimension&) = delete; long GetDimension() const { return nDim; } // dimension index in source long GetSourceDim() const { return nSourceDim; } // >=0 if dup'ed ScDPDimension* CreateCloneObject(); ScDPHierarchies* GetHierarchiesObject(); SC_DLLPUBLIC const OUString* GetLayoutName() const; const OUString* GetSubtotalName() const; // XNamed virtual OUString SAL_CALL getName() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setName( const OUString& aName ) throw(css::uno::RuntimeException, std::exception) override; // XHierarchiesSupplier virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getHierarchies() throw(css::uno::RuntimeException, std::exception) override; // XCloneable virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() throw(css::uno::RuntimeException, std::exception) override; // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; // XServiceInfo virtual OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; sal_uInt16 getOrientation() const; void setOrientation(sal_uInt16 nNew); long getPosition() const; bool getIsDataLayoutDimension() const; sal_uInt16 getFunction() const { return nFunction;} void setFunction(sal_uInt16 nNew); // for data dimension static long getUsedHierarchy() { return 0;} bool HasSelectedPage() const { return bHasSelectedPage; } const ScDPItemData& GetSelectedData(); const css::sheet::DataPilotFieldReference& GetReferenceValue() const { return aReferenceValue;} }; class ScDPHierarchies : public cppu::WeakImplHelper< css::container::XNameAccess, css::lang::XServiceInfo > { private: ScDPSource* pSource; long nDim; // date columns have 3 hierarchies (flat/quarter/week), other columns only one // #i52547# don't offer the incomplete date hierarchy implementation static const long nHierCount = 1; ScDPHierarchy** ppHiers; public: ScDPHierarchies( ScDPSource* pSrc, long nD ); virtual ~ScDPHierarchies() override; // XNameAccess virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) throw(css::uno::RuntimeException, std::exception) override; // XElementAccess virtual css::uno::Type SAL_CALL getElementType() throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL hasElements() throw(css::uno::RuntimeException, std::exception) override; // XServiceInfo virtual OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; static long getCount(); ScDPHierarchy* getByIndex(long nIndex) const; }; class ScDPHierarchy : public cppu::WeakImplHelper< css::sheet::XLevelsSupplier, css::container::XNamed, css::lang::XServiceInfo > { private: ScDPSource* pSource; long nDim; long nHier; rtl::Reference mxLevels; public: ScDPHierarchy( ScDPSource* pSrc, long nD, long nH ); virtual ~ScDPHierarchy() override; ScDPLevels* GetLevelsObject(); // XNamed virtual OUString SAL_CALL getName() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setName( const OUString& aName ) throw(css::uno::RuntimeException, std::exception) override; // XLevelsSupplier virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getLevels() throw(css::uno::RuntimeException, std::exception) override; // XServiceInfo virtual OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; }; class ScDPLevels : public cppu::WeakImplHelper< css::container::XNameAccess, css::lang::XServiceInfo > { private: ScDPSource* pSource; long nDim; long nHier; long nLevCount; ScDPLevel** ppLevs; public: ScDPLevels( ScDPSource* pSrc, long nD, long nH ); virtual ~ScDPLevels() override; // XNameAccess virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) throw(css::uno::RuntimeException, std::exception) override; // XElementAccess virtual css::uno::Type SAL_CALL getElementType() throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL hasElements() throw(css::uno::RuntimeException, std::exception) override; // XServiceInfo virtual OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; long getCount() const; ScDPLevel* getByIndex(long nIndex) const; }; class ScDPLevel : public cppu::WeakImplHelper< css::sheet::XMembersSupplier, css::container::XNamed, css::sheet::XDataPilotMemberResults, css::beans::XPropertySet, css::lang::XServiceInfo > { private: ScDPSource* pSource; long nDim; long nHier; long nLev; rtl::Reference mxMembers; css::uno::Sequence aSubTotals; css::sheet::DataPilotFieldSortInfo aSortInfo; // stored user settings css::sheet::DataPilotFieldAutoShowInfo aAutoShowInfo; // stored user settings css::sheet::DataPilotFieldLayoutInfo aLayoutInfo; // stored user settings // valid only from result calculation: ::std::vector aGlobalOrder; // result of sorting by name or position long nSortMeasure; // measure (index of data dimension) to sort by long nAutoMeasure; // measure (index of data dimension) for AutoShow bool bShowEmpty:1; bool bEnableLayout:1; // enabled only for row fields, not for the innermost one bool bRepeatItemLabels:1; public: ScDPLevel( ScDPSource* pSrc, long nD, long nH, long nL ); virtual ~ScDPLevel() override; ScDPMembers* GetMembersObject(); // XNamed virtual OUString SAL_CALL getName() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setName( const OUString& aName ) throw(css::uno::RuntimeException, std::exception) override; // XMembersSupplier virtual css::uno::Reference< css::sheet::XMembersAccess > SAL_CALL getMembers() throw(css::uno::RuntimeException, std::exception) override; // XDataPilotMemberResults virtual css::uno::Sequence< css::sheet::MemberResult > SAL_CALL getResults() throw(css::uno::RuntimeException, std::exception) override; // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; // XServiceInfo virtual OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; css::uno::Sequence getSubTotals() const; bool getShowEmpty() const { return bShowEmpty;} bool getRepeatItemLabels() const { return bRepeatItemLabels; } const css::sheet::DataPilotFieldSortInfo& GetSortInfo() const { return aSortInfo; } const css::sheet::DataPilotFieldAutoShowInfo& GetAutoShow() const { return aAutoShowInfo; } void EvaluateSortOrder(); void SetEnableLayout(bool bSet); const ::std::vector& GetGlobalOrder() const { return aGlobalOrder; } ::std::vector& GetGlobalOrder() { return aGlobalOrder; } long GetSortMeasure() const { return nSortMeasure; } long GetAutoMeasure() const { return nAutoMeasure; } bool IsOutlineLayout() const { return bEnableLayout && aLayoutInfo.LayoutMode != css::sheet::DataPilotFieldLayoutMode::TABULAR_LAYOUT; } bool IsSubtotalsAtTop() const { return bEnableLayout && aLayoutInfo.LayoutMode == css::sheet::DataPilotFieldLayoutMode::OUTLINE_SUBTOTALS_TOP; } bool IsAddEmpty() const { return bEnableLayout && aLayoutInfo.AddEmptyLines; } //! number format (for data fields and date fields) }; // hash map from name to index in the member array, for fast name access typedef std::unordered_map< OUString, sal_Int32, OUStringHash > ScDPMembersHashMap; class ScDPMembers : public cppu::WeakImplHelper< css::sheet::XMembersAccess, css::lang::XServiceInfo > { private: typedef std::vector > MembersType; ScDPSource* pSource; long nDim; long nHier; long nLev; long nMbrCount; mutable MembersType maMembers; mutable ScDPMembersHashMap aHashMap; public: ScDPMembers( ScDPSource* pSrc, long nD, long nH, long nL ); virtual ~ScDPMembers() override; // XMembersAccess virtual css::uno::Sequence< OUString > SAL_CALL getLocaleIndependentElementNames() throw(css::uno::RuntimeException, std::exception) override; // XNameAccess virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) throw(css::uno::RuntimeException, std::exception) override; // XElementAccess virtual css::uno::Type SAL_CALL getElementType() throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL hasElements() throw(css::uno::RuntimeException, std::exception) override; // XServiceInfo virtual OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; long getCount() const { return nMbrCount;} ScDPMember* getByIndex(long nIndex) const; long getMinMembers() const; sal_Int32 GetIndexFromName( const OUString& rName ) const; // <0 if not found const ScDPItemData* GetSrcItemDataByIndex( SCROW nIndex); SCROW GetSrcItemsCount(); private: css::uno::Sequence< OUString > getElementNames( bool bLocaleIndependent ) const throw(css::uno::RuntimeException, std::exception); }; class ScDPMember : public cppu::WeakImplHelper< css::container::XNamed, css::beans::XPropertySet, css::lang::XServiceInfo > { private: ScDPSource* pSource; long nDim; long nHier; long nLev; SCROW mnDataId; std::unique_ptr mpLayoutName; sal_Int32 nPosition; // manual sorting bool bVisible; bool bShowDet; public: ScDPMember(ScDPSource* pSrc, long nD, long nH, long nL, SCROW nIndex); virtual ~ScDPMember() override; ScDPMember(const ScDPMember&) = delete; ScDPMember& operator=(const ScDPMember&) = delete; OUString GetNameStr( bool bLocaleIndependent ) const; void FillItemData( ScDPItemData& rData ) const; const ScDPItemData* GetItemData() const; SCROW GetItemDataId() const { return mnDataId; } bool IsNamedItem(SCROW nIndex) const; SC_DLLPUBLIC const OUString* GetLayoutName() const; long GetDim() const { return nDim;} sal_Int32 Compare( const ScDPMember& rOther ) const; // visible order // XNamed virtual OUString SAL_CALL getName() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setName( const OUString& aName ) throw(css::uno::RuntimeException, std::exception) override; // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; // XServiceInfo virtual OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; bool isVisible() const { return bVisible;} bool getShowDetails() const { return bShowDet;} }; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */