/***************************************************************************
                          SIMPLY POWERFUL TOOLKIT (SPTK)
                          CExcelDBCellRecord.h  -  description
                             -------------------
    begin                : Mar 20 2004
    copyright            : (C) 2004 by Alexey Parshin
    email                : alexeyp@gmail.com
 ***************************************************************************/

/***************************************************************************
   This library is free software; you can redistribute it and/or modify it
   under the terms of the GNU Library General Public License as published by
   the Free Software Foundation; either version 2 of the License, or (at
   your option) any later version.

   This library is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
   General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this library; if not, write to the Free Software Foundation,
   Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

   Please report all bugs and problems to "alexeyp@gmail.com"
 ***************************************************************************/

#ifndef __CEXCELDBCELLRECORD_H__
#define __CEXCELDBCELLRECORD_H__

#include <sptk3/excel/CExcelRecordsBuffer.h>
#include <sptk3/excel/CExcelRowRecord.h>
#include <sptk3/excel/CExcelSST.h>

#include <vector>

namespace sptk {

   /// @addtogroup excel Excel Classes
   /// @{

   /// An internal Excel structure - DBCELL record
	class CExcelDBCellRecord : public CExcelRecord {
		typedef std::vector<CExcelRowRecord *> CExcelRowRecordVector;
		unsigned                 m_streamPosition;  ///< Stream position of the DBCELL record
		CExcelRowRecordVector    m_rows;            ///< Excel rows included into this DBCELL record
	public:
      /// Default constructor
		CExcelDBCellRecord(); 

      /// Destructor
		~CExcelDBCellRecord(); 

      /// Registers an Excel row in the DBCELL record for future saving in Excel File
		void addRow(CExcelRowRecord *row);

      /// Saves cell records (for this) into the external Excel format.
      /// @param records CExcelRecordsBuffer&, the output buffer of Excel records
      /// @param sst const CExcelSST&, the workbook's Shared String Table (SST)
		void saveRecords(CExcelRecordsBuffer& records,const CExcelSST& sst);

      /// Returns stream position of the row record
		unsigned streamPosition() const { return m_streamPosition; }    
	};
   /// @}
}
#endif
