WPSTable.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /* libwps
00003  * Version: MPL 2.0 / LGPLv2.1+
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * Major Contributor(s):
00010  * Copyright (C) 2009, 2011 Alonso Laurent (alonso@loria.fr)
00011  * Copyright (C) 2006, 2007 Andrew Ziem
00012  * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
00013  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
00014  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
00015  *
00016  * For minor contributions see the git repository.
00017  *
00018  * Alternatively, the contents of this file may be used under the terms
00019  * of the GNU Lesser General Public License Version 2.1 or later
00020  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
00021  * applicable instead of those above.
00022  *
00023  * For further information visit http://libwps.sourceforge.net
00024  */
00025 
00026 #ifndef WPS_TABLE
00027 #  define WPS_TABLE
00028 
00029 #include <iostream>
00030 #include <vector>
00031 
00032 #include "libwps_internal.h"
00033 
00034 /*
00035  * Structure to store and construct a table from an unstructured list
00036  * of cell
00037  *
00038  */
00039 class WPSTable
00040 {
00041 public:
00043         WPSTable() : m_cellsList(), m_rowsSize(), m_colsSize() {}
00044 
00046         virtual ~WPSTable();
00047 
00049         void add(WPSCellPtr &cell);
00050 
00052         int numCells() const
00053         {
00054                 return int(m_cellsList.size());
00055         }
00057         WPSCellPtr getCell(int id);
00058 
00063         bool sendTable(WPSContentListenerPtr listener);
00064 
00066         bool sendAsText(WPSContentListenerPtr listener);
00067 
00068 protected:
00070         bool buildStructures();
00071 
00073         std::vector<WPSCellPtr> m_cellsList;
00075         std::vector<float> m_rowsSize, m_colsSize;
00076 };
00077 
00078 #endif
00079 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */