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 
35 typedef shared_ptr<WPSContentListener> WPSContentListenerPtr;
36 
37 class WPSCell;
38 typedef shared_ptr<WPSCell> WPSCellPtr;
39 
40 /*
41  * Structure to store and construct a table from an unstructured list
42  * of cell
43  *
44  */
45 class WPSTable
46 {
47 public:
50 
52  virtual ~WPSTable();
53 
55  void add(WPSCellPtr &cell);
56 
58  int numCells() const
59  {
60  return int(m_cellsList.size());
61  }
63  WPSCellPtr getCell(int id);
64 
69  bool sendTable(WPSContentListenerPtr listener);
70 
72  bool sendAsText(WPSContentListenerPtr listener);
73 
74 protected:
76  bool buildStructures();
77 
79  std::vector<WPSCellPtr> m_cellsList;
81  std::vector<float> m_rowsSize, m_colsSize;
82 };
83 
84 #endif
85 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
virtual ~WPSTable()
the destructor
Definition: WPSTable.cpp:42
shared_ptr< WPSContentListener > WPSContentListenerPtr
Definition: WPSCell.h:38
std::vector< WPSCellPtr > m_cellsList
the list of cells
Definition: WPSTable.h:79
bool buildStructures()
create the correspondance list, ...
Definition: WPSTable.cpp:63
Definition: WPSContentListener.h:168
a structure used to defined the cell position, and a format
Definition: WPSCell.h:119
std::vector< float > m_colsSize
Definition: WPSTable.h:81
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:81
int numCells() const
returns the number of cell
Definition: WPSTable.h:58
bool sendAsText(WPSContentListenerPtr listener)
try to send the table as basic text
Definition: WPSTable.cpp:253
WPSTable()
the constructor
Definition: WPSTable.h:49
bool sendTable(WPSContentListenerPtr listener)
try to send the table
Definition: WPSTable.cpp:181
Definition: WPSTable.h:45
void add(WPSCellPtr &cell)
add a new cells
Definition: WPSTable.cpp:46
shared_ptr< WPSCell > WPSCellPtr
Definition: WPSCell.h:235

Generated on Wed Jun 11 2014 02:26:01 for libwps by doxygen 1.8.5