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

           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_DPSHTTAB_HXX
      30                 :            : #define SC_DPSHTTAB_HXX
      31                 :            : 
      32                 :            : #include "dptabdat.hxx"
      33                 :            : #include "global.hxx"
      34                 :            : #include "address.hxx"
      35                 :            : #include "scdllapi.h"
      36                 :            : #include "queryparam.hxx"
      37                 :            : 
      38                 :            : #include <boost/unordered_set.hpp>
      39                 :            : #include <vector>
      40                 :            : 
      41                 :            : namespace com { namespace sun { namespace star { namespace sheet {
      42                 :            :     struct DataPilotFieldFilter;
      43                 :            : }}}}
      44                 :            : 
      45                 :            : class ScDPDimensionSaveData;
      46                 :            : 
      47                 :            : /**
      48                 :            :  * This class contains authoritative information on the internal reference
      49                 :            :  * used as the data source for datapilot table.  <i>The range name takes
      50                 :            :  * precedence over the source range when it's non-empty.</i>  When the range
      51                 :            :  * name is empty, the source range gets used.
      52                 :            :  */
      53   [ +  -  +  - ]:        641 : class ScSheetSourceDesc
                 [ #  # ]
              [ +  +  - ]
      54                 :            : {
      55                 :            :     ScSheetSourceDesc(); // disabled
      56                 :            : 
      57                 :            : public:
      58                 :            :     SC_DLLPUBLIC ScSheetSourceDesc(ScDocument* pDoc);
      59                 :            : 
      60                 :            :     SC_DLLPUBLIC void SetSourceRange(const ScRange& rRange);
      61                 :            : 
      62                 :            :     /**
      63                 :            :      * Get the range that contains the source data.  In case the source data
      64                 :            :      * is referred to via a range name, it returns the range that the range
      65                 :            :      * name points to.
      66                 :            :      *
      67                 :            :      * <i>Note that currently only a single range is supported; if the
      68                 :            :      * range name contains multiple ranges, only the first range is used.</i>
      69                 :            :      *
      70                 :            :      * @return source range.
      71                 :            :      */
      72                 :            :     SC_DLLPUBLIC const ScRange& GetSourceRange() const;
      73                 :            :     SC_DLLPUBLIC void SetRangeName(const ::rtl::OUString& rName);
      74                 :            :     SC_DLLPUBLIC const ::rtl::OUString& GetRangeName() const;
      75                 :            :     bool HasRangeName() const;
      76                 :            :     void SetQueryParam(const ScQueryParam& rParam);
      77                 :            :     const ScQueryParam& GetQueryParam() const;
      78                 :            : 
      79                 :            :     bool operator== ( const ScSheetSourceDesc& rOther ) const;
      80                 :            :     SC_DLLPUBLIC const ScDPCache* CreateCache(const ScDPDimensionSaveData* pDimData) const;
      81                 :            : 
      82                 :            :     /**
      83                 :            :      * Check the sanity of the data source range.
      84                 :            :      *
      85                 :            :      * @return 0 if the source range is sane, otherwise an error message ID is
      86                 :            :      *         returned.
      87                 :            :      */
      88                 :            :     sal_uLong CheckSourceRange() const;
      89                 :            : 
      90                 :            : private:
      91                 :            :     mutable ScRange maSourceRange;
      92                 :            :     ::rtl::OUString maRangeName;
      93                 :            :     ScQueryParam    maQueryParam;
      94                 :            :     ScDocument*     mpDoc;
      95                 :            : };
      96                 :            : 
      97                 :            : /**
      98                 :            :  * Implementation of ScDPTableData with sheet data.
      99                 :            :  */
     100                 :            : class SC_DLLPUBLIC ScSheetDPData : public ScDPTableData
     101                 :            : {
     102                 :            : private:
     103                 :            :     ScQueryParam    aQuery;
     104                 :            :     bool            bIgnoreEmptyRows;
     105                 :            :     bool            bRepeatIfEmpty;
     106                 :            : 
     107                 :            :     const ScSheetSourceDesc& mrDesc;
     108                 :            :     ScDPCacheTable  aCacheTable;
     109                 :            : 
     110                 :            : public:
     111                 :            :     ScSheetDPData(ScDocument* pD, const ScSheetSourceDesc& rDesc, const ScDPCache* pCache);
     112                 :            :     virtual ~ScSheetDPData();
     113                 :            : 
     114                 :            :     virtual long                    GetColumnCount();
     115                 :            :     virtual rtl::OUString           getDimensionName(long nColumn);
     116                 :            :     virtual sal_Bool                    getIsDataLayoutDimension(long nColumn);
     117                 :            :     virtual sal_Bool                    IsDateDimension(long nDim);
     118                 :            :     virtual sal_uLong                   GetNumberFormat(long nDim);
     119                 :            :     virtual void                    DisposeData();
     120                 :            :     virtual void                    SetEmptyFlags( sal_Bool bIgnoreEmptyRows, sal_Bool bRepeatIfEmpty );
     121                 :            : 
     122                 :            :     virtual bool                    IsRepeatIfEmpty();
     123                 :            : 
     124                 :            :     virtual void                    CreateCacheTable();
     125                 :            :     virtual void                    FilterCacheTable(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria, const ::boost::unordered_set<sal_Int32>& rCatDims);
     126                 :            :     virtual void                    GetDrillDownData(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria,
     127                 :            :                                                      const ::boost::unordered_set<sal_Int32>& rCatDims,
     128                 :            :                                                      ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData);
     129                 :            :     virtual void                    CalcResults(CalcInfo& rInfo, bool bAutoShow);
     130                 :            :     virtual const ScDPCacheTable&   GetCacheTable() const;
     131                 :            :     virtual void ReloadCacheTable();
     132                 :            : };
     133                 :            : 
     134                 :            : 
     135                 :            : 
     136                 :            : #endif
     137                 :            : 
     138                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10