LCOV - code coverage report
Current view: top level - libreoffice/sc/inc - chartarr.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 15 6.7 %
Date: 2012-12-27 Functions: 1 15 6.7 %
Legend: Lines: hit not hit

          Line data    Source code
       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 SC_CHARTARR_HXX
      21             : #define SC_CHARTARR_HXX
      22             : 
      23             : // -----------------------------------------------------------------------
      24             : 
      25             : #include "rangelst.hxx"
      26             : #include "chartpos.hxx"
      27             : 
      28             : #include <boost/ptr_container/ptr_vector.hpp>
      29             : 
      30             : class ScDocument;
      31             : 
      32             : // ScMemChart is a stripped-down SchMemChart from old chart,
      33             : // used only to transport a rectangular data array for the UNO API,
      34             : // contains only column/row header text and data values.
      35             : 
      36             : class ScMemChart
      37             : {
      38             :     short           nRowCnt;
      39             :     short           nColCnt;
      40             :     double*         pData;
      41             :     ::rtl::OUString* pColText;
      42             :     ::rtl::OUString* pRowText;
      43             : 
      44             :     ScMemChart(const ScMemChart& rMemChart);      // not implemented
      45             : 
      46             : public:
      47             :     ScMemChart(short nCols, short nRows);
      48             :     ~ScMemChart();
      49             : 
      50           0 :     short GetColCount() const { return nColCnt; }
      51           0 :     short GetRowCount() const { return nRowCnt; }
      52           0 :     const ::rtl::OUString& GetColText(short nCol) const { return pColText[nCol]; }
      53           0 :     const ::rtl::OUString& GetRowText(short nRow) const { return pRowText[nRow]; }
      54           0 :     double GetData(short nCol, short nRow) const { return pData[nCol * nRowCnt + nRow]; }
      55           0 :     void SetData(short nCol, short nRow, const double& rVal) { pData[nCol * nRowCnt + nRow] = rVal; }
      56           0 :     void SetColText(short nCol, const ::rtl::OUString& rText) { pColText[nCol] = rText; }
      57           0 :     void SetRowText(short nRow, const ::rtl::OUString& rText) { pRowText[nRow] = rText; }
      58             : };
      59             : 
      60             : class SC_DLLPUBLIC ScChartArray             // only parameter-struct
      61             : {
      62             :     ::rtl::OUString aName;
      63             :     ScDocument* pDocument;
      64             :     ScChartPositioner aPositioner;
      65             :     bool        bValid;             // for creation out of SchMemChart
      66             : 
      67             : private:
      68             :     ScMemChart* CreateMemChartSingle();
      69             :     ScMemChart* CreateMemChartMulti();
      70             : public:
      71             :     ScChartArray( ScDocument* pDoc, SCTAB nTab,
      72             :                   SCCOL nStartColP, SCROW nStartRowP,
      73             :                   SCCOL nEndColP, SCROW nEndRowP,
      74             :                   const ::rtl::OUString& rChartName );
      75             :     ScChartArray( ScDocument* pDoc, const ScRangeListRef& rRangeList,
      76             :                   const ::rtl::OUString& rChartName );
      77             :     ScChartArray( const ScChartArray& rArr );
      78             :     ~ScChartArray();
      79             : 
      80           0 :     const ScRangeListRef&   GetRangeList() const { return aPositioner.GetRangeList(); }
      81             :     void    SetRangeList( const ScRangeListRef& rNew ) { aPositioner.SetRangeList(rNew); }
      82             :     void    SetRangeList( const ScRange& rNew ) { aPositioner.SetRangeList(rNew); }
      83           0 :     const   ScChartPositionMap* GetPositionMap() { return aPositioner.GetPositionMap(); }
      84             : 
      85           0 :     void    SetHeaders(bool bCol, bool bRow) { aPositioner.SetHeaders(bCol, bRow); }
      86           0 :     bool    HasColHeaders() const { return aPositioner.HasColHeaders(); }
      87           0 :     bool    HasRowHeaders() const { return aPositioner.HasRowHeaders(); }
      88             :     bool IsValid() const { return bValid; }
      89             :     void SetName(const ::rtl::OUString& rNew) { aName = rNew; }
      90           0 :     const ::rtl::OUString& GetName() const { return aName; }
      91             : 
      92             :     bool operator==(const ScChartArray& rCmp) const;
      93             : 
      94             :     ScMemChart* CreateMemChart();
      95             : };
      96             : 
      97         111 : class ScChartCollection
      98             : {
      99             :     typedef ::boost::ptr_vector<ScChartArray> DataType;
     100             :     DataType maData;
     101             : public:
     102             :     ScChartCollection();
     103             :     ScChartCollection(const ScChartCollection& rColl);
     104             : 
     105             :     SC_DLLPUBLIC void push_back(ScChartArray* p);
     106             :     void clear();
     107             :     size_t size() const;
     108             :     bool empty() const;
     109             :     ScChartArray* operator[](size_t nIndex);
     110             :     const ScChartArray* operator[](size_t nIndex) const;
     111             : 
     112             :     bool operator==(const ScChartCollection& rCmp) const;
     113             : };
     114             : 
     115             : #endif
     116             : 
     117             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10