WPS8Table.h Source File documentation

WPS8Table.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 WPS8_TABLE
27# define WPS8_TABLE
28
29#include "libwps_internal.h"
30
31#include "WPSDebug.h"
32
33class WPS8Parser;
34
35namespace WPS8TableInternal
36{
37struct Cell;
38struct State;
39}
40
42//
43// class to parse the object
44//
46
57 class WPS8Table
58{
59 friend struct WPS8TableInternal::Cell;
60 friend class WPS8Parser;
61public:
63 explicit WPS8Table(WPS8Parser &parser);
64
66 ~WPS8Table();
67
69 void setListener(WPSContentListenerPtr &listen)
70 {
71 m_listener = listen;
72 }
73
75 void computePositions() const;
76
78 int numPages() const;
79
81 void flushExtra();
82
83protected:
85 bool readStructures(RVNGInputStreamPtr const &input);
86
95 bool sendTable(Vec2f const &siz, int tableId, int strsid, bool inTextBox=false);
96
97 // interface with main parser
98 void sendTextInCell(int strsId, int cellId);
99
100protected: // low level
101
103 bool readMCLD(RVNGInputStreamPtr input, WPSEntry const &entry);
104
106 int version() const;
107
109 libwps::DebugFile &ascii()
110 {
111 return m_asciiFile;
112 }
113private:
114 WPS8Table(WPS8Table const &orig) = delete;
115 WPS8Table &operator=(WPS8Table const &orig) = delete;
116
117protected:
119 WPSContentListenerPtr m_listener;
120
122 WPS8Parser &m_mainParser;
123
125 mutable std::shared_ptr<WPS8TableInternal::State> m_state;
126
128 libwps::DebugFile &m_asciiFile;
129};
130
131#endif
132// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
WPSDebug.h
WPS8Parser
This class parses Works version 2000 through 8.
Definition WPS8.h:50
WPS8Table::setListener
void setListener(WPSContentListenerPtr &listen)
sets the listener
Definition WPS8Table.h:69
WPS8Table::readMCLD
bool readMCLD(RVNGInputStreamPtr input, WPSEntry const &entry)
reads a MCLD zone: a zone which stores the tables structures
Definition WPS8Table.cpp:338
WPS8Table::sendTextInCell
void sendTextInCell(int strsId, int cellId)
Definition WPS8Table.cpp:237
WPS8Table::m_asciiFile
libwps::DebugFile & m_asciiFile
the ascii file
Definition WPS8Table.h:128
WPS8Table::WPS8Table
WPS8Table(WPS8Table const &orig)=delete
WPS8Table::WPS8Table
WPS8Table(WPS8Parser &parser)
constructor
Definition WPS8Table.cpp:210
WPS8Table::m_state
std::shared_ptr< WPS8TableInternal::State > m_state
the state
Definition WPS8Table.h:125
WPS8Table::version
int version() const
returns the file version
Definition WPS8Table.cpp:225
WPS8Table::flushExtra
void flushExtra()
sends the data which have not been send to the listener.
Definition WPS8Table.cpp:250
WPS8Table::WPS8Parser
friend class WPS8Parser
Definition WPS8Table.h:60
WPS8Table::operator=
WPS8Table & operator=(WPS8Table const &orig)=delete
WPS8Table::sendTable
bool sendTable(Vec2f const &siz, int tableId, int strsid, bool inTextBox=false)
tries to send a table corresponding to strsid with actual size siz
Definition WPS8Table.cpp:266
WPS8Table::computePositions
void computePositions() const
computes the final position of all table: does nothing as table anchors seem always a char
Definition WPS8Table.cpp:245
WPS8Table::ascii
libwps::DebugFile & ascii()
returns the debug file
Definition WPS8Table.h:109
WPS8Table::m_listener
WPSContentListenerPtr m_listener
the listener
Definition WPS8Table.h:119
WPS8Table::~WPS8Table
~WPS8Table()
destructor
Definition WPS8Table.cpp:218
WPS8Table::m_mainParser
WPS8Parser & m_mainParser
the main parser
Definition WPS8Table.h:122
WPS8Table::numPages
int numPages() const
returns the number page where we find a picture. In practice, 0/1
Definition WPS8Table.cpp:232
WPS8Table::readStructures
bool readStructures(RVNGInputStreamPtr const &input)
finds all structures which correspond to a table
Definition WPS8Table.cpp:317
WPSEntry
basic class to store an entry in a file This contained :
Definition WPSEntry.h:39
libwps::DebugFile
Definition WPSDebug.h:208
libwps_internal.h
Vec2f
Vec2< float > Vec2f
Vec2 of float.
Definition libwps_internal.h:704
RVNGInputStreamPtr
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition libwps_internal.h:87
WPSContentListenerPtr
std::shared_ptr< WPSContentListener > WPSContentListenerPtr
shared pointer to WPSContentListener
Definition libwps_internal.h:107
WPS8TableInternal
Internal: the structures of a WPS8Table.
Definition WPS8Table.cpp:45
WPS8TableInternal::Cell
Internal: class to store a basic cell with borders.
Definition WPS8Table.cpp:48
WPS8TableInternal::State
Internal: the state of a WPS8Table.
Definition WPS8Table.cpp:166