/***************************************************************************
                          SIMPLY POWERFUL TOOLKIT (SPTK)
                          CExcelIndex.h  -  description
                             -------------------
    begin                : Mon Jan 19 2004
    copyright            : (C) 2004 by Alexey S.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 __CEXCELINDEX_H__
#define __CEXCELINDEX_H__

#include <sptk3/excel/CExcelRows.h>
#include <sptk3/excel/CExcelDBCellRecord.h>
#include <sptk3/excel/CExcelRecordsBuffer.h>
#include <sptk3/excel/CExcelSST.h>

#include <vector>

namespace sptk {

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

   /// Represents Excel INDEX record
	class CExcelIndex : public CExcelRecord {
		CExcelRows                        *m_rows;          ///< Rows in the index
		std::vector<CExcelDBCellRecord *>  m_dbcellRecords; ///< DBCELL records in the index
	public:
      /// Constructor
      /// @param rows std::vector<CExcelRow *> *, the list of CExcelRow - memory presentation of Excel rows
		CExcelIndex(CExcelRows *rows);

      /// Destructor
		~CExcelIndex();

      /// Saves INDEX, DBCELL, and cell records into records' buffer
      /// @param records CExcelRecordsBuffer&, the output records buffer
      /// @param sst const CExcelSST&, the existing Shared String Table (SST)
      /// @param sheetStreamPosition unsigned, the current sheet's beginning position in the Excel stream
      /// @param defColWidthPosition unsigned, the current sheet's DEFCOLWIDTH record position in the Excel stream
		void saveRecords(CExcelRecordsBuffer& records,const CExcelSST& sst,unsigned sheetStreamPosition,unsigned defColWidthPosition);
	};
   /// @}
}
#endif
