LCOV - code coverage report
Current view: top level - sc/inc - chart2uno.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 1 100.0 %
Date: 2012-08-25 Functions: 2 2 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef SC_CHART2UNO_HXX
      30                 :            : #define SC_CHART2UNO_HXX
      31                 :            : 
      32                 :            : #include "cellsuno.hxx"     // for XModifyListenerArr_Impl / ScLinkListener
      33                 :            : #include "rangelst.hxx"
      34                 :            : #include "externalrefmgr.hxx"
      35                 :            : #include "token.hxx"
      36                 :            : #include "chartlis.hxx"
      37                 :            : 
      38                 :            : #include <svl/lstner.hxx>
      39                 :            : #include <com/sun/star/chart/ChartDataRowSource.hpp>
      40                 :            : #include <com/sun/star/chart2/data/XDataProvider.hpp>
      41                 :            : #include <com/sun/star/chart2/data/XSheetDataProvider.hpp>
      42                 :            : #include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
      43                 :            : #include <com/sun/star/chart2/data/XDataSource.hpp>
      44                 :            : #include <com/sun/star/chart2/data/XDataSequence.hpp>
      45                 :            : #include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
      46                 :            : #include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
      47                 :            : #include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
      48                 :            : #include <com/sun/star/chart2/data/DataSequenceRole.hpp>
      49                 :            : #include <com/sun/star/lang/XServiceInfo.hpp>
      50                 :            : #include <com/sun/star/beans/XPropertySet.hpp>
      51                 :            : #include <com/sun/star/util/XCloneable.hpp>
      52                 :            : #include <com/sun/star/util/XModifyBroadcaster.hpp>
      53                 :            : #include <cppuhelper/implbase2.hxx>
      54                 :            : #include <cppuhelper/implbase5.hxx>
      55                 :            : #include <cppuhelper/implbase7.hxx>
      56                 :            : #include <rtl/ustring.hxx>
      57                 :            : #include <svl/itemprop.hxx>
      58                 :            : 
      59                 :            : #include <list>
      60                 :            : #include <vector>
      61                 :            : #include <memory>
      62                 :            : #include <boost/shared_ptr.hpp>
      63                 :            : #include <boost/unordered_set.hpp>
      64                 :            : #include <boost/noncopyable.hpp>
      65                 :            : #include <boost/scoped_ptr.hpp>
      66                 :            : 
      67                 :            : class ScDocument;
      68                 :            : 
      69                 :            : // DataProvider ==============================================================
      70                 :            : 
      71                 :            : class ScChart2DataProvider : public
      72                 :            :                 ::cppu::WeakImplHelper5<
      73                 :            :                     ::com::sun::star::chart2::data::XDataProvider,
      74                 :            :                     ::com::sun::star::chart2::data::XSheetDataProvider,
      75                 :            :                     ::com::sun::star::chart2::data::XRangeXMLConversion,
      76                 :            :                     ::com::sun::star::beans::XPropertySet,
      77                 :            :                     ::com::sun::star::lang::XServiceInfo>,
      78                 :            :                 SfxListener
      79                 :            : {
      80                 :            : public:
      81                 :            : 
      82                 :            :     explicit ScChart2DataProvider( ScDocument* pDoc );
      83                 :            :     virtual ~ScChart2DataProvider();
      84                 :            :     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
      85                 :            : 
      86                 :            :     // XDataProvider ---------------------------------------------------------
      87                 :            : 
      88                 :            :     virtual ::sal_Bool SAL_CALL createDataSourcePossible(
      89                 :            :         const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArguments )
      90                 :            :         throw (::com::sun::star::uno::RuntimeException);
      91                 :            : 
      92                 :            :     virtual ::com::sun::star::uno::Reference<
      93                 :            :         ::com::sun::star::chart2::data::XDataSource > SAL_CALL createDataSource(
      94                 :            :             const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArguments )
      95                 :            :             throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
      96                 :            : 
      97                 :            :     virtual ::com::sun::star::uno::Sequence<
      98                 :            :         ::com::sun::star::beans::PropertyValue > SAL_CALL detectArguments(
      99                 :            :             const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSource >& xDataSource )
     100                 :            :             throw (::com::sun::star::uno::RuntimeException);
     101                 :            : 
     102                 :            :     virtual ::sal_Bool SAL_CALL createDataSequenceByRangeRepresentationPossible(
     103                 :            :         const ::rtl::OUString& aRangeRepresentation )
     104                 :            :         throw (::com::sun::star::uno::RuntimeException);
     105                 :            : 
     106                 :            :     virtual ::com::sun::star::uno::Reference<
     107                 :            :         ::com::sun::star::chart2::data::XDataSequence > SAL_CALL createDataSequenceByRangeRepresentation(
     108                 :            :             const ::rtl::OUString& aRangeRepresentation )
     109                 :            :             throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
     110                 :            : 
     111                 :            :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XRangeSelection > SAL_CALL getRangeSelection()
     112                 :            :         throw (::com::sun::star::uno::RuntimeException);
     113                 :            : 
     114                 :            :     // XSheetDataProvider ----------------------------------------------------
     115                 :            : 
     116                 :            :     virtual sal_Bool SAL_CALL createDataSequenceByFormulaTokensPossible(
     117                 :            :         const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >& aTokens )
     118                 :            :             throw (::com::sun::star::uno::RuntimeException);
     119                 :            : 
     120                 :            :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >
     121                 :            :         SAL_CALL createDataSequenceByFormulaTokens(
     122                 :            :             const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >& aTokens )
     123                 :            :                 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
     124                 :            : 
     125                 :            :     // XRangeXMLConversion ---------------------------------------------------
     126                 :            : 
     127                 :            :     virtual ::rtl::OUString SAL_CALL convertRangeToXML( const ::rtl::OUString& sRangeRepresentation )
     128                 :            :         throw ( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException );
     129                 :            : 
     130                 :            :     virtual ::rtl::OUString SAL_CALL convertRangeFromXML( const ::rtl::OUString& sXMLRange )
     131                 :            :         throw ( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException );
     132                 :            : 
     133                 :            :     // XPropertySet ----------------------------------------------------------
     134                 :            : 
     135                 :            :     virtual ::com::sun::star::uno::Reference<
     136                 :            :         ::com::sun::star::beans::XPropertySetInfo> SAL_CALL
     137                 :            :         getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException);
     138                 :            : 
     139                 :            :     virtual void SAL_CALL setPropertyValue(
     140                 :            :             const ::rtl::OUString& rPropertyName,
     141                 :            :             const ::com::sun::star::uno::Any& rValue)
     142                 :            :         throw( ::com::sun::star::beans::UnknownPropertyException,
     143                 :            :                 ::com::sun::star::beans::PropertyVetoException,
     144                 :            :                 ::com::sun::star::lang::IllegalArgumentException,
     145                 :            :                 ::com::sun::star::lang::WrappedTargetException,
     146                 :            :                 ::com::sun::star::uno::RuntimeException);
     147                 :            : 
     148                 :            :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
     149                 :            :             const ::rtl::OUString& rPropertyName)
     150                 :            :         throw( ::com::sun::star::beans::UnknownPropertyException,
     151                 :            :                 ::com::sun::star::lang::WrappedTargetException,
     152                 :            :                 ::com::sun::star::uno::RuntimeException);
     153                 :            : 
     154                 :            :     virtual void SAL_CALL addPropertyChangeListener(
     155                 :            :             const ::rtl::OUString& rPropertyName,
     156                 :            :             const ::com::sun::star::uno::Reference<
     157                 :            :             ::com::sun::star::beans::XPropertyChangeListener>& xListener)
     158                 :            :         throw( ::com::sun::star::beans::UnknownPropertyException,
     159                 :            :                 ::com::sun::star::lang::WrappedTargetException,
     160                 :            :                 ::com::sun::star::uno::RuntimeException);
     161                 :            : 
     162                 :            :     virtual void SAL_CALL removePropertyChangeListener(
     163                 :            :             const ::rtl::OUString& rPropertyName,
     164                 :            :             const ::com::sun::star::uno::Reference<
     165                 :            :             ::com::sun::star::beans::XPropertyChangeListener>& rListener)
     166                 :            :         throw( ::com::sun::star::beans::UnknownPropertyException,
     167                 :            :                 ::com::sun::star::lang::WrappedTargetException,
     168                 :            :                 ::com::sun::star::uno::RuntimeException);
     169                 :            : 
     170                 :            :     virtual void SAL_CALL addVetoableChangeListener(
     171                 :            :             const ::rtl::OUString& rPropertyName,
     172                 :            :             const ::com::sun::star::uno::Reference<
     173                 :            :             ::com::sun::star::beans::XVetoableChangeListener>& rListener)
     174                 :            :         throw( ::com::sun::star::beans::UnknownPropertyException,
     175                 :            :                 ::com::sun::star::lang::WrappedTargetException,
     176                 :            :                 ::com::sun::star::uno::RuntimeException);
     177                 :            : 
     178                 :            :     virtual void SAL_CALL removeVetoableChangeListener(
     179                 :            :             const ::rtl::OUString& rPropertyName,
     180                 :            :             const ::com::sun::star::uno::Reference<
     181                 :            :             ::com::sun::star::beans::XVetoableChangeListener>& rListener)
     182                 :            :         throw( ::com::sun::star::beans::UnknownPropertyException,
     183                 :            :                 ::com::sun::star::lang::WrappedTargetException,
     184                 :            :                 ::com::sun::star::uno::RuntimeException);
     185                 :            : 
     186                 :            :     // XServiceInfo ----------------------------------------------------------
     187                 :            : 
     188                 :            :     virtual ::rtl::OUString SAL_CALL getImplementationName() throw(
     189                 :            :             ::com::sun::star::uno::RuntimeException);
     190                 :            : 
     191                 :            :     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString&
     192                 :            :             rServiceName) throw( ::com::sun::star::uno::RuntimeException);
     193                 :            : 
     194                 :            :     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
     195                 :            :         getSupportedServiceNames() throw(
     196                 :            :                 ::com::sun::star::uno::RuntimeException);
     197                 :            : 
     198                 :            : private:
     199                 :            : 
     200                 :            :     ScDocument*                 m_pDocument;
     201                 :            :     SfxItemPropertySet          m_aPropSet;
     202                 :            :     sal_Bool                    m_bIncludeHiddenCells;
     203                 :            : };
     204                 :            : 
     205                 :            : 
     206                 :            : // DataSource ================================================================
     207                 :            : 
     208                 :            : class ScChart2DataSource : public
     209                 :            :                 ::cppu::WeakImplHelper2<
     210                 :            :                     ::com::sun::star::chart2::data::XDataSource,
     211                 :            :                     ::com::sun::star::lang::XServiceInfo>,
     212                 :            :                 SfxListener
     213                 :            : {
     214                 :            : public:
     215                 :            : 
     216                 :            :     explicit ScChart2DataSource( ScDocument* pDoc);
     217                 :            :     virtual ~ScChart2DataSource();
     218                 :            :     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
     219                 :            : 
     220                 :            :     // XDataSource -----------------------------------------------------------
     221                 :            : 
     222                 :            :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
     223                 :            :             ::com::sun::star::chart2::data::XLabeledDataSequence > > SAL_CALL
     224                 :            :         getDataSequences() throw (::com::sun::star::uno::RuntimeException);
     225                 :            : 
     226                 :            :     // XServiceInfo ----------------------------------------------------------
     227                 :            : 
     228                 :            :     virtual ::rtl::OUString SAL_CALL getImplementationName() throw(
     229                 :            :             ::com::sun::star::uno::RuntimeException);
     230                 :            : 
     231                 :            :     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString&
     232                 :            :             rServiceName) throw( ::com::sun::star::uno::RuntimeException);
     233                 :            : 
     234                 :            :     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
     235                 :            :         getSupportedServiceNames() throw(
     236                 :            :                 ::com::sun::star::uno::RuntimeException);
     237                 :            : 
     238                 :            :     // implementation
     239                 :            : 
     240                 :            :     void AddLabeledSequence(const com::sun::star::uno::Reference < com::sun::star::chart2::data::XLabeledDataSequence >& xNew);
     241                 :            : 
     242                 :            : private:
     243                 :            : 
     244                 :            :     ScDocument*                 m_pDocument;
     245                 :            :     typedef std::list < com::sun::star::uno::Reference< com::sun::star::chart2::data::XLabeledDataSequence > >  LabeledList;
     246                 :            :     LabeledList                 m_aLabeledSequences;
     247                 :            : 
     248                 :            : };
     249                 :            : 
     250                 :            : 
     251                 :            : // DataSequence ==============================================================
     252                 :            : 
     253                 :            : class ScChart2DataSequence : public
     254                 :            :                 ::cppu::WeakImplHelper7<
     255                 :            :                     ::com::sun::star::chart2::data::XDataSequence,
     256                 :            :                     ::com::sun::star::chart2::data::XTextualDataSequence,
     257                 :            :                     ::com::sun::star::chart2::data::XNumericalDataSequence,
     258                 :            :                     ::com::sun::star::util::XCloneable,
     259                 :            :                     ::com::sun::star::util::XModifyBroadcaster,
     260                 :            :                     ::com::sun::star::beans::XPropertySet,
     261                 :            :                     ::com::sun::star::lang::XServiceInfo>,
     262                 :            :                 SfxListener,
     263                 :            :                 boost::noncopyable
     264                 :            : {
     265                 :            : public:
     266                 :            :     explicit ScChart2DataSequence( ScDocument* pDoc,
     267                 :            :             const com::sun::star::uno::Reference< com::sun::star::chart2::data::XDataProvider >& xDP,
     268                 :            :             ::std::vector<ScTokenRef>* pTokens, bool bIncludeHiddenCells );
     269                 :            : 
     270                 :            :     virtual ~ScChart2DataSequence();
     271                 :            :     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
     272                 :            : 
     273                 :            :     // XDataSequence ---------------------------------------------------------
     274                 :            : 
     275                 :            :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
     276                 :            :         SAL_CALL getData() throw (::com::sun::star::uno::RuntimeException);
     277                 :            :     virtual ::rtl::OUString SAL_CALL getSourceRangeRepresentation()
     278                 :            :         throw (::com::sun::star::uno::RuntimeException);
     279                 :            :     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
     280                 :            :         SAL_CALL generateLabel(::com::sun::star::chart2::data::LabelOrigin nOrigin)
     281                 :            :         throw (::com::sun::star::uno::RuntimeException);
     282                 :            :     virtual ::sal_Int32 SAL_CALL getNumberFormatKeyByIndex( ::sal_Int32 nIndex )
     283                 :            :         throw (::com::sun::star::lang::IndexOutOfBoundsException,
     284                 :            :                ::com::sun::star::uno::RuntimeException);
     285                 :            : 
     286                 :            :     // XNumericalDataSequence --------------------------------------------------
     287                 :            : 
     288                 :            :     virtual ::com::sun::star::uno::Sequence< double >
     289                 :            :         SAL_CALL getNumericalData(  ) throw (::com::sun::star::uno::RuntimeException);
     290                 :            : 
     291                 :            :     // XTextualDataSequence --------------------------------------------------
     292                 :            : 
     293                 :            :     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
     294                 :            :         SAL_CALL getTextualData(  ) throw (::com::sun::star::uno::RuntimeException);
     295                 :            : 
     296                 :            :     // XPropertySet ----------------------------------------------------------
     297                 :            : 
     298                 :            :     virtual ::com::sun::star::uno::Reference<
     299                 :            :         ::com::sun::star::beans::XPropertySetInfo> SAL_CALL
     300                 :            :         getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException);
     301                 :            : 
     302                 :            :     virtual void SAL_CALL setPropertyValue(
     303                 :            :             const ::rtl::OUString& rPropertyName,
     304                 :            :             const ::com::sun::star::uno::Any& rValue)
     305                 :            :         throw( ::com::sun::star::beans::UnknownPropertyException,
     306                 :            :                 ::com::sun::star::beans::PropertyVetoException,
     307                 :            :                 ::com::sun::star::lang::IllegalArgumentException,
     308                 :            :                 ::com::sun::star::lang::WrappedTargetException,
     309                 :            :                 ::com::sun::star::uno::RuntimeException);
     310                 :            : 
     311                 :            :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
     312                 :            :             const ::rtl::OUString& rPropertyName)
     313                 :            :         throw( ::com::sun::star::beans::UnknownPropertyException,
     314                 :            :                 ::com::sun::star::lang::WrappedTargetException,
     315                 :            :                 ::com::sun::star::uno::RuntimeException);
     316                 :            : 
     317                 :            :     virtual void SAL_CALL addPropertyChangeListener(
     318                 :            :             const ::rtl::OUString& rPropertyName,
     319                 :            :             const ::com::sun::star::uno::Reference<
     320                 :            :             ::com::sun::star::beans::XPropertyChangeListener>& xListener)
     321                 :            :         throw( ::com::sun::star::beans::UnknownPropertyException,
     322                 :            :                 ::com::sun::star::lang::WrappedTargetException,
     323                 :            :                 ::com::sun::star::uno::RuntimeException);
     324                 :            : 
     325                 :            :     virtual void SAL_CALL removePropertyChangeListener(
     326                 :            :             const ::rtl::OUString& rPropertyName,
     327                 :            :             const ::com::sun::star::uno::Reference<
     328                 :            :             ::com::sun::star::beans::XPropertyChangeListener>& rListener)
     329                 :            :         throw( ::com::sun::star::beans::UnknownPropertyException,
     330                 :            :                 ::com::sun::star::lang::WrappedTargetException,
     331                 :            :                 ::com::sun::star::uno::RuntimeException);
     332                 :            : 
     333                 :            :     virtual void SAL_CALL addVetoableChangeListener(
     334                 :            :             const ::rtl::OUString& rPropertyName,
     335                 :            :             const ::com::sun::star::uno::Reference<
     336                 :            :             ::com::sun::star::beans::XVetoableChangeListener>& rListener)
     337                 :            :         throw( ::com::sun::star::beans::UnknownPropertyException,
     338                 :            :                 ::com::sun::star::lang::WrappedTargetException,
     339                 :            :                 ::com::sun::star::uno::RuntimeException);
     340                 :            : 
     341                 :            :     virtual void SAL_CALL removeVetoableChangeListener(
     342                 :            :             const ::rtl::OUString& rPropertyName,
     343                 :            :             const ::com::sun::star::uno::Reference<
     344                 :            :             ::com::sun::star::beans::XVetoableChangeListener>& rListener)
     345                 :            :         throw( ::com::sun::star::beans::UnknownPropertyException,
     346                 :            :                 ::com::sun::star::lang::WrappedTargetException,
     347                 :            :                 ::com::sun::star::uno::RuntimeException);
     348                 :            : 
     349                 :            :     // XCloneable ------------------------------------------------------------
     350                 :            : 
     351                 :            :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
     352                 :            :         throw (::com::sun::star::uno::RuntimeException);
     353                 :            : 
     354                 :            :     // XModifyBroadcaster ----------------------------------------------------
     355                 :            : 
     356                 :            :     virtual void SAL_CALL addModifyListener(
     357                 :            :         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
     358                 :            :         throw (::com::sun::star::uno::RuntimeException);
     359                 :            :     virtual void SAL_CALL removeModifyListener(
     360                 :            :         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
     361                 :            :         throw (::com::sun::star::uno::RuntimeException);
     362                 :            : 
     363                 :            :     // XServiceInfo ----------------------------------------------------------
     364                 :            : 
     365                 :            :     virtual ::rtl::OUString SAL_CALL getImplementationName() throw(
     366                 :            :             ::com::sun::star::uno::RuntimeException);
     367                 :            : 
     368                 :            :     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString&
     369                 :            :             rServiceName) throw( ::com::sun::star::uno::RuntimeException);
     370                 :            : 
     371                 :            :     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
     372                 :            :         getSupportedServiceNames() throw(
     373                 :            :                 ::com::sun::star::uno::RuntimeException);
     374                 :            : 
     375                 :            : private:
     376                 :            :     void setDataChangedHint(bool b);
     377                 :            : 
     378                 :            :     // Implementation --------------------------------------------------------
     379                 :            : 
     380                 :            :     void    RefChanged();
     381                 :            :     DECL_LINK( ValueListenerHdl, SfxHint* );
     382                 :            : 
     383                 :            : private:
     384                 :            :     ScChart2DataSequence(); // disabled
     385                 :            :     ScChart2DataSequence(const ScChart2DataSequence& r); // disabled
     386                 :            : 
     387                 :            :     class ExternalRefListener : public ScExternalRefManager::LinkListener
     388                 :            :     {
     389                 :            :     public:
     390                 :            :         ExternalRefListener(ScChart2DataSequence& rParent, ScDocument* pDoc);
     391                 :            :         virtual ~ExternalRefListener();
     392                 :            :         virtual void notify(sal_uInt16 nFileId, ScExternalRefManager::LinkUpdateType eType);
     393                 :            :         void addFileId(sal_uInt16 nFileId);
     394                 :            :         void removeFileId(sal_uInt16 nFileId);
     395                 :            :         const ::boost::unordered_set<sal_uInt16>& getAllFileIds();
     396                 :            : 
     397                 :            :     private:
     398                 :            :         ExternalRefListener();
     399                 :            :         ExternalRefListener(const ExternalRefListener& r);
     400                 :            : 
     401                 :            :         ScChart2DataSequence&       mrParent;
     402                 :            :         ::boost::unordered_set<sal_uInt16> maFileIds;
     403                 :            :         ScDocument*                 mpDoc;
     404                 :            :     };
     405                 :            : 
     406                 :            :     /**
     407                 :            :      * Build an internal data array to cache the data ranges, and other
     408                 :            :      * information such as hidden values.
     409                 :            :      */
     410                 :            :     void BuildDataCache();
     411                 :            : 
     412                 :            :     void RebuildDataCache();
     413                 :            : 
     414                 :            :     sal_Int32 FillCacheFromExternalRef(const ScTokenRef& pToken);
     415                 :            : 
     416                 :            :     void UpdateTokensFromRanges(const ScRangeList& rRanges);
     417                 :            : 
     418                 :            :     ExternalRefListener* GetExtRefListener();
     419                 :            : 
     420                 :            :     void StopListeningToAllExternalRefs();
     421                 :            : 
     422                 :            :     void CopyData(const ScChart2DataSequence& r);
     423                 :            : 
     424                 :            : private:
     425                 :            : 
     426                 :            :     // data array
     427                 :      23892 :     struct Item
     428                 :            :     {
     429                 :            :         double              mfValue;
     430                 :            :         ::rtl::OUString     maString;
     431                 :            :         bool                mbIsValue;
     432                 :            :         Item();
     433                 :            :     };
     434                 :            : 
     435                 :            :     class HiddenRangeListener : public ScChartHiddenRangeListener
     436                 :            :     {
     437                 :            :     public:
     438                 :            :         HiddenRangeListener(ScChart2DataSequence& rParent);
     439                 :            :         virtual ~HiddenRangeListener();
     440                 :            : 
     441                 :            :         virtual void notify();
     442                 :            : 
     443                 :            :     private:
     444                 :            :         ScChart2DataSequence& mrParent;
     445                 :            :     };
     446                 :            : 
     447                 :            :     ::std::list<Item>           m_aDataArray;
     448                 :            : 
     449                 :            :     /**
     450                 :            :      * Cached data for getData.  We may also need to cache data for the
     451                 :            :      * numerical and textural data series if they turn out to be bottlenecks
     452                 :            :      * under certain scenarios.
     453                 :            :      */
     454                 :            :     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > m_aMixedDataCache;
     455                 :            : 
     456                 :            :     ::com::sun::star::uno::Sequence<sal_Int32>  m_aHiddenValues;
     457                 :            : 
     458                 :            :     // properties
     459                 :            :     ::com::sun::star::chart2::data::DataSequenceRole  m_aRole;
     460                 :            :     sal_Bool                    m_bIncludeHiddenCells;
     461                 :            : 
     462                 :            :     // internals
     463                 :            :     typedef boost::scoped_ptr<std::vector<ScTokenRef> >  TokenListPtr;
     464                 :            :     typedef boost::scoped_ptr<std::vector<sal_uInt32> >  RangeIndexMapPtr;
     465                 :            :     typedef boost::scoped_ptr<ExternalRefListener>       ExtRefListenerPtr;
     466                 :            : 
     467                 :            :     sal_Int64                   m_nObjectId;
     468                 :            :     ScDocument*                 m_pDocument;
     469                 :            :     TokenListPtr                m_pTokens;
     470                 :            :     RangeIndexMapPtr            m_pRangeIndices;
     471                 :            :     ExtRefListenerPtr           m_pExtRefListener;
     472                 :            :     com::sun::star::uno::Reference < com::sun::star::chart2::data::XDataProvider > m_xDataProvider;
     473                 :            :     SfxItemPropertySet          m_aPropSet;
     474                 :            : 
     475                 :            :     boost::scoped_ptr<HiddenRangeListener> m_pHiddenListener;
     476                 :            : 
     477                 :            :     ScLinkListener*             m_pValueListener;
     478                 :            :     XModifyListenerArr_Impl     m_aValueListeners;
     479                 :            : 
     480                 :            :     bool                        m_bGotDataChangedHint;
     481                 :            :     bool                        m_bExtDataRebuildQueued;
     482                 :            : };
     483                 :            : 
     484                 :            : #endif // SC_CHART2UNO_HXX
     485                 :            : 
     486                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10