WPSTable.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwps
3  * Version: MPL 2.0 / LGPLv2.1+
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  * Major Contributor(s):
10  * Copyright (C) 2009, 2011 Alonso Laurent (alonso@loria.fr)
11  * Copyright (C) 2006, 2007 Andrew Ziem
12  * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
13  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
14  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
15  *
16  * For minor contributions see the git repository.
17  *
18  * Alternatively, the contents of this file may be used under the terms
19  * of the GNU Lesser General Public License Version 2.1 or later
20  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
21  * applicable instead of those above.
22  *
23  * For further information visit http://libwps.sourceforge.net
24  */
25 
26 #ifndef WPS_TABLE
27 # define WPS_TABLE
28 
29 #include <iostream>
30 #include <vector>
31 
32 #include "libwps_internal.h"
33 
34 /*
35  * Structure to store and construct a table from an unstructured list
36  * of cell
37  *
38  */
39 class WPSTable
40 {
41 public:
44 
46  virtual ~WPSTable();
47 
49  void add(WPSCellPtr &cell);
50 
52  int numCells() const
53  {
54  return int(m_cellsList.size());
55  }
57  WPSCellPtr getCell(int id);
58 
63  bool sendTable(WPSContentListenerPtr listener);
64 
66  bool sendAsText(WPSContentListenerPtr listener);
67 
68 protected:
70  bool buildStructures();
71 
73  std::vector<WPSCellPtr> m_cellsList;
75  std::vector<float> m_rowsSize, m_colsSize;
76 };
77 
78 #endif
79 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
shared_ptr< WPSContentListener > WPSContentListenerPtr
shared pointer to WPSContentListener
Definition: libwps_internal.h:100
virtual ~WPSTable()
the destructor
Definition: WPSTable.cpp:42
std::vector< WPSCellPtr > m_cellsList
the list of cells
Definition: WPSTable.h:73
bool buildStructures()
create the correspondance list, ...
Definition: WPSTable.cpp:63
std::vector< float > m_colsSize
Definition: WPSTable.h:75
WPSCellPtr getCell(int id)
returns the i^th cell
Definition: WPSTable.cpp:51
std::vector< float > m_rowsSize
the final row and col size (in point)
Definition: WPSTable.h:75
int numCells() const
returns the number of cell
Definition: WPSTable.h:52
bool sendAsText(WPSContentListenerPtr listener)
try to send the table as basic text
Definition: WPSTable.cpp:254
WPSTable()
the constructor
Definition: WPSTable.h:43
bool sendTable(WPSContentListenerPtr listener)
try to send the table
Definition: WPSTable.cpp:181
Definition: WPSTable.h:39
void add(WPSCellPtr &cell)
add a new cells
Definition: WPSTable.cpp:46
shared_ptr< WPSCell > WPSCellPtr
shared pointer to WPSCell
Definition: libwps_internal.h:93

Generated on Thu Oct 9 2014 14:30:04 for libwps by doxygen 1.8.8