WPSTable.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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:
43 WPSTable() : m_cellsList(), m_rowsSize(), m_colsSize() {}
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: */
WPSContentListenerPtr
shared_ptr< WPSContentListener > WPSContentListenerPtr
shared pointer to WPSContentListener
Definition: libwps_internal.h:106
WPSTable::~WPSTable
virtual ~WPSTable()
the destructor
Definition: WPSTable.cpp:42
WPSTable::m_cellsList
std::vector< WPSCellPtr > m_cellsList
the list of cells
Definition: WPSTable.h:73
WPSTable::buildStructures
bool buildStructures()
create the correspondance list, ...
Definition: WPSTable.cpp:63
WPSTable::m_colsSize
std::vector< float > m_colsSize
Definition: WPSTable.h:75
WPSTable::getCell
WPSCellPtr getCell(int id)
returns the i^th cell
Definition: WPSTable.cpp:51
WPSTable::m_rowsSize
std::vector< float > m_rowsSize
the final row and col size (in point)
Definition: WPSTable.h:75
libwps_internal.h
WPSTable::numCells
int numCells() const
returns the number of cell
Definition: WPSTable.h:52
WPSTable::sendAsText
bool sendAsText(WPSContentListenerPtr listener)
try to send the table as basic text
Definition: WPSTable.cpp:257
WPSTable::WPSTable
WPSTable()
the constructor
Definition: WPSTable.h:43
WPSTable::sendTable
bool sendTable(WPSContentListenerPtr listener)
try to send the table
Definition: WPSTable.cpp:184
WPSTable
Definition: WPSTable.h:39
WPSTable::add
void add(WPSCellPtr &cell)
add a new cells
Definition: WPSTable.cpp:46
WPSCellPtr
shared_ptr< WPSCell > WPSCellPtr
shared pointer to WPSCell
Definition: libwps_internal.h:99