MsWksTable.hxx Source File documentation

MsWksTable.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33
34 /*
35 * Parser to Microsoft Works text document ( table and chart )
36 */
37 #ifndef MS_WKS_MWAW_TABLE
38 # define MS_WKS_MWAW_TABLE
39
40 #include <list>
41 #include <string>
42 #include <vector>
43
44 #include "MWAWEntry.hxx"
45 #include "MWAWParser.hxx"
46
47 #include "MsWksGraph.hxx"
48
49 namespace MsWksTableInternal
50 {
51 struct Table;
52 struct State;
53 }
54
55 class MsWksDocument;
56
58 class MsWksTable
59 {
60 friend class MsWksGraph;
61 public:
63 MsWksTable(MWAWParser &parser, MsWksDocument &zone, MsWksGraph &graph);
65 virtual ~MsWksTable();
66
68 int version() const;
69
71 bool readTable(int numCol, int numRow, int zoneId, MsWksGraph::Style const &style);
73 bool sendTable(int zoneId);
74
76 bool readChart(int chartId, MsWksGraph::Style const &style);
78 void setChartZoneId(int chartId, int zoneId);
80 bool sendChart(int chartId);
81
82 private:
83 MsWksTable(MsWksTable const &orig) = delete;
84 MsWksTable &operator=(MsWksTable const &orig) = delete;
85
86 protected:
87 //
88 // data
89 //
91 MWAWParserStatePtr m_parserState;
92
94 std::shared_ptr<MsWksTableInternal::State> m_state;
95
97 MWAWParser *m_mainParser;
99 MsWksGraph *m_graphParser;
101 MsWksDocument &m_zone;
102 };
103
104 #endif
105 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
106
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
MWAWParagraph::m_justify
MWAWVariable< Justification > m_justify
the justification
Definition: MWAWParagraph.hxx:167
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
MsWksTableInternal::Table
Internal: the table of a MsWksTable.
Definition: MsWksTable.cxx:92
MsWksDocument::getInput
MWAWInputStreamPtr & getInput()
returns the actual input
Definition: MsWksDocument.hxx:113
MWAWFont::set
void set(Script const &newscript)
sets the script position
Definition: MWAWFont.hxx:314
MsWksTableInternal::Table::Cell
the cell content
Definition: MsWksTable.cxx:94
MsWksDocument
the main class to read/store generic data of a MsWorks document v1-v3
Definition: MsWksDocument.hxx:68
MsWksTableInternal::Table::Table
Table()
empty constructor
Definition: MsWksTable.cxx:121
MWAW_DEBUG_MSG
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
MsWksTableInternal::Chart::Chart
Chart()
empty constructor
Definition: MsWksTable.cxx:71
MWAWVec2f
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:842
MsWksTableInternal::Table::m_numRows
int m_numRows
the number of rows
Definition: MsWksTable.cxx:144
MsWksTable::sendTable
bool sendTable(int zoneId)
try to a table zone
Definition: MsWksTable.cxx:199
MsWksGraph::Style::m_baseSurfaceColor
MWAWColor m_baseSurfaceColor
the 2D surface color
Definition: MsWksGraph.hxx:237
MWAWPosition::setRelativePosition
void setRelativePosition(AnchorTo anchor, XPos X=XLeft, YPos Y=YTop)
sets the relative position
Definition: MWAWPosition.hxx:237
MWAWCell::setPosition
void setPosition(MWAWVec2i posi)
set the cell positions : 0,0 -> A1, 0,1 -> A2
Definition: MWAWCell.hxx:189
MsWksTableInternal::Table::m_colsDim
std::vector< int > m_colsDim
Definition: MsWksTable.cxx:145
MsWksGraph::Style
Internal: the graphic style of MsWksGraph.
Definition: MsWksGraph.hxx:208
MsWksGraph.hxx
MsWksTableInternal::Chart::m_backgroundEntry
MWAWEntry m_backgroundEntry
the background entry
Definition: MsWksTable.cxx:84
MWAWFont::Script::sub100
static Script sub100()
return a yposition which correspond to a basic subscript100
Definition: MWAWFont.hxx:125
MWAWFont::boldBit
@ boldBit
Definition: MWAWFont.hxx:190
MsWksTableInternal
Internal: the structures of a MsWksTable.
Definition: MsWksTable.cxx:57
MWAWTable.hxx
MWAWFont::setColor
void setColor(MWAWColor color)
sets the font color
Definition: MWAWFont.hxx:341
MsWksTable::readTable
bool readTable(int numCol, int numRow, int zoneId, MsWksGraph::Style const &style)
try to read a table zone
Definition: MsWksTable.cxx:287
libmwaw::BottomBit
@ BottomBit
Definition: libmwaw_internal.hxx:178
MsWksTableInternal::Table::Cell::Cell
Cell()
Definition: MsWksTable.cxx:95
MWAWEntry.hxx
MWAWFontConverter.hxx
MsWksTableInternal::Table::Cell::m_pos
MWAWVec2i m_pos
the cell position
Definition: MsWksTable.cxx:102
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:192
MWAWEmbeddedObject
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467
MsWksTableInternal::State::State
State()
constructor
Definition: MsWksTable.cxx:156
MsWksDocument::getColor
bool getColor(int id, MWAWColor &col, int vers)
returns the color which correspond to an index
Definition: MsWksDocument.cxx:583
MWAWParagraph
class to store the paragraph properties
Definition: MWAWParagraph.hxx:84
MsWksGraph
the main class to read the graphic of a Microsoft Works file
Definition: MsWksGraph.hxx:73
MsWksTable::m_state
std::shared_ptr< MsWksTableInternal::State > m_state
the state
Definition: MsWksTable.hxx:94
MWAWFont::Line::Simple
@ Simple
Definition: MWAWFont.hxx:49
MWAWPictData::get
static MWAWPictData * get(MWAWInputStreamPtr const &input, int size)
checks if the data pointed by input is known
Definition: MWAWPictData.hxx:108
MWAWBorder::m_width
double m_width
the border total width in point
Definition: libmwaw_internal.hxx:387
MsWksTableInternal::Table::m_style
MWAWGraphicStyle m_style
the graphic style
Definition: MsWksTable.cxx:143
MWAWCell::setBackgroundColor
void setBackgroundColor(MWAWColor color)
sets the background color
Definition: MWAWCell.hxx:332
MsWksTableInternal::Table::Table
Table(MsWksGraph::Style const &style)
constructor
Definition: MsWksTable.cxx:109
MsWksTable::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: MsWksTable.hxx:91
MsWksTableInternal::State::m_idChartMap
std::map< int, Chart > m_idChartMap
the map id->chart
Definition: MsWksTable.cxx:167
libmwaw::DebugFile::addNote
void addNote(char const *note)
adds a note in the file, in actual position
Definition: MWAWDebug.cxx:59
MWAWGraphicStyle
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:47
MWAWPosition::size
const MWAWVec2f & size() const
returns the frame size
Definition: MWAWPosition.hxx:135
MsWksTable.hxx
MsWksTableInternal::State
Internal: the state of a MsWksTable.
Definition: MsWksTable.cxx:154
MsWksTable::readChart
bool readChart(int chartId, MsWksGraph::Style const &style)
try to read a chart zone
Definition: MsWksTable.cxx:496
MsWksTableInternal::Table::Cell::m_text
std::string m_text
the text
Definition: MsWksTable.cxx:106
MWAWFont::Script::super100
static Script super100()
return a yposition which correspond to a basic superscript100
Definition: MWAWFont.hxx:135
MWAWFont::embossBit
@ embossBit
Definition: MWAWFont.hxx:190
MsWksGraph::send
void send(int id, MWAWPosition const &pos)
send a zone (textbox, ...).
Definition: MsWksGraph.cxx:2828
MWAWCell.hxx
MWAWTable::TableDimBit
@ TableDimBit
Definition: MWAWTable.hxx:56
MsWksTable::m_graphParser
MsWksGraph * m_graphParser
the graph parser;
Definition: MsWksTable.hxx:99
MsWksTable::sendChart
bool sendChart(int chartId)
try to a chart zone
Definition: MsWksTable.cxx:429
MWAWSubDocument.hxx
MsWksTableInternal::Chart::m_textZonesId
int m_textZonesId[3]
the three text pictures
Definition: MsWksTable.cxx:82
MsWksTable::operator=
MsWksTable & operator=(MsWksTable const &orig)=delete
MWAWParagraph::JustificationCenter
@ JustificationCenter
Definition: MWAWParagraph.hxx:90
MWAWGraphicStyle::m_surfaceColor
MWAWColor m_surfaceColor
the surface color
Definition: MWAWGraphicStyle.hxx:428
MWAWFont::shadowBit
@ shadowBit
Definition: MWAWFont.hxx:191
MWAWParagraph.hxx
libmwaw::DebugFile::skipZone
void skipZone(long beginPos, long endPos)
skips the file zone defined by beginPos-endPos
Definition: MWAWDebug.hxx:113
libmwaw::Debug::dumpFile
bool dumpFile(librevenge::RVNGBinaryData &data, char const *fileName)
a debug function to store in a datafile in the current directory WARNING: this function erase the fil...
Definition: MWAWDebug.cxx:193
libmwaw_internal.hxx
MWAWPosition::setSize
void setSize(MWAWVec2f const &sz)
sets the frame size
Definition: MWAWPosition.hxx:215
MsWksDocument::ascii
libmwaw::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: MsWksDocument.hxx:132
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:47
MWAWBorder
a border
Definition: libmwaw_internal.hxx:333
MWAWEntry::setBegin
void setBegin(long off)
sets the begin offset
Definition: MWAWEntry.hxx:67
MsWksGraph::getZonePosition
bool getZonePosition(int zoneId, MWAWPosition::AnchorTo anchor, MWAWPosition &pos) const
returns the position of the zone defined by zoneId
Definition: MsWksGraph.cxx:1140
MsWksTable::setChartZoneId
void setChartZoneId(int chartId, int zoneId)
fix the correspondance between a chart and the zone id
Definition: MsWksTable.cxx:419
MWAWPictData.hxx
MWAWTable
a class used to recreate the table structure using cell informations, ....
Definition: MWAWTable.hxx:51
libmwaw::RightBit
@ RightBit
Definition: libmwaw_internal.hxx:178
MWAWPict::MWAW_R_BAD
@ MWAW_R_BAD
Definition: MWAWPict.hxx:73
MWAWVec2< int >
MWAWFont::getDebugString
std::string getDebugString(std::shared_ptr< MWAWFontConverter > &converter) const
returns a string which can be used for debugging
Definition: MWAWFont.cxx:181
MWAWPosition::setOrigin
void setOrigin(MWAWVec2f const &orig)
sets the frame origin
Definition: MWAWPosition.hxx:210
MWAWEntry::begin
long begin() const
returns the begin offset
Definition: MWAWEntry.hxx:83
MWAWEntry::setLength
void setLength(long l)
sets the zone size
Definition: MWAWEntry.hxx:72
MWAWTable::setColsSize
void setColsSize(std::vector< float > const &cSize)
define the columns size (in point)
Definition: MWAWTable.hxx:133
MsWksTableInternal::Table::m_cellsList
std::vector< Cell > m_cellsList
the list of cell
Definition: MsWksTable.cxx:149
MsWksTable::version
int version() const
returns the file version
Definition: MsWksTable.cxx:189
MsWksTable::~MsWksTable
virtual ~MsWksTable()
destructor
Definition: MsWksTable.cxx:186
MsWksTable::MsWksTable
MsWksTable(MWAWParser &parser, MsWksDocument &zone, MsWksGraph &graph)
constructor
Definition: MsWksTable.cxx:177
MsWksTableInternal::State::m_version
int m_version
the version
Definition: MsWksTable.cxx:164
MsWksTableInternal::Chart::m_style
MWAWGraphicStyle m_style
the graphic style
Definition: MsWksTable.cxx:80
MWAWPictData::check
static ReadResult check(MWAWInputStreamPtr const &input, int size, MWAWBox2f &box)
checks if the data pointed by input is known
Definition: MWAWPictData.hxx:100
MWAWEntry::end
long end() const
returns the end offset
Definition: MWAWEntry.hxx:88
MsWksTableInternal::Chart::Chart
Chart(MsWksGraph::Style const &style)
constructor
Definition: MsWksTable.cxx:63
libmwaw::LeftBit
@ LeftBit
Definition: libmwaw_internal.hxx:178
MWAWParser
virtual class which defines the ancestor of all main zone parser
Definition: MWAWParser.hxx:99
MsWksTableInternal::Table::getCell
const Cell * getCell(MWAWVec2i const &pos) const
try to find a cell
Definition: MsWksTable.cxx:133
MWAWGraphicStyle.hxx
MWAWFont::italicBit
@ italicBit
Definition: MWAWFont.hxx:190
MsWksTableInternal::Chart::m_zoneId
int m_zoneId
the chart zone id (in the graph parser )
Definition: MsWksTable.cxx:86
MsWksTableInternal::Table::m_numCols
int m_numCols
the number of columns
Definition: MsWksTable.cxx:144
MsWksDocument.hxx
MsWksTable::m_mainParser
MWAWParser * m_mainParser
the main parser;
Definition: MsWksTable.hxx:97
MWAWPosition::origin
const MWAWVec2f & origin() const
return the frame origin
Definition: MWAWPosition.hxx:130
MWAWParserStatePtr
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:557
libmwaw::TopBit
@ TopBit
Definition: libmwaw_internal.hxx:178
libmwaw::DebugFile::addPos
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
MWAWCell::setBorders
void setBorders(int wh, MWAWBorder const &border)
sets the cell border: wh=libmwaw::LeftBit|...
Definition: MWAWCell.cxx:382
MWAWPosition::YTop
@ YTop
Definition: MWAWPosition.hxx:57
MsWksTableInternal::Chart
Internal: the chart of a MsWksTable.
Definition: MsWksTable.cxx:61
MWAWListener.hxx
MsWksTableInternal::Table::m_rowsDim
std::vector< int > m_rowsDim
the rows dimensions
Definition: MsWksTable.cxx:145
MWAWPosition::Frame
@ Frame
Definition: MWAWPosition.hxx:51
libmwaw::DebugFile
an interface used to insert comment in a binary file, written in ascii form (if debug_with_files is n...
Definition: MWAWDebug.hxx:65
MWAWParserState::Spreadsheet
@ Spreadsheet
Definition: MWAWParser.hxx:53
MWAWFont::Script
a small struct to define the script position in MWAWFont
Definition: MWAWFont.hxx:106
MWAWPosition::XLeft
@ XLeft
Definition: MWAWPosition.hxx:55
MWAWListenerPtr
std::shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:553
MWAWFont.hxx
MsWksGraph::getEntryPicture
int getEntryPicture(int zoneId, MWAWEntry &zone, bool autoSend=true, int order=-1000)
checks if the next zone is a v2 picture and returns a zone id ( or -1)
Definition: MsWksGraph.cxx:1456
MsWksTable::m_zone
MsWksDocument & m_zone
the input zone
Definition: MsWksTable.hxx:101
MWAWBox2< float >
MWAWFont
Class to store font.
Definition: MWAWFont.hxx:43
MsWksTableInternal::Table::m_font
MWAWFont m_font
the default font
Definition: MsWksTable.cxx:147
MWAWCell
a structure used to define a cell and its format
Definition: MWAWCell.hxx:52
MsWksTableInternal::State::m_idTableMap
std::map< int, Table > m_idTableMap
the map id->table
Definition: MsWksTable.cxx:169
MWAWBorder::m_color
MWAWColor m_color
the border color
Definition: libmwaw_internal.hxx:393
MsWksTableInternal::Table::Cell::m_font
MWAWFont m_font
the font
Definition: MsWksTable.cxx:104
MWAWVec2i
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:838
libmwaw::DebugStream
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
MWAWParser.hxx
MWAWFont::setUnderlineStyle
void setUnderlineStyle(Line::Style style=Line::None, bool doReset=true)
sets the underline style ( by default, we also reset the style)
Definition: MWAWFont.hxx:466
MWAWFont::setFlags
void setFlags(uint32_t fl)
sets the font attributes bold, ...
Definition: MWAWFont.hxx:325
MsWksTable
the main class to read the table ( or a chart ) of a Microsoft Works file
Definition: MsWksTable.hxx:58