MarinerWrtParser.hxx Source File documentation

MarinerWrtParser.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 convert Mariner Write document
36 */
37 #ifndef MARINER_WRT_PARSER
38 # define MARINER_WRT_PARSER
39
40 #include <iostream>
41 #include <string>
42 #include <vector>
43
44 #include <librevenge/librevenge.h>
45
46 #include "MWAWDebug.hxx"
47 #include "MWAWEntry.hxx"
48 #include "MWAWInputStream.hxx"
49
50 #include "MWAWParser.hxx"
51
52 namespace MarinerWrtParserInternal
53 {
54 struct State;
55 class SubDocument;
56 }
57
58 class MarinerWrtGraph;
59 class MarinerWrtText;
60
62 struct MarinerWrtEntry final : public MWAWEntry {
64 MarinerWrtEntry()
65 : MWAWEntry()
66 , m_fileType(0)
67 , m_N(0)
68 , m_value(0)
69 {
70 }
72 ~MarinerWrtEntry() final;
74 std::string name() const;
76 friend std::ostream &operator<< (std::ostream &o, MarinerWrtEntry const &ent)
77 {
78 if (ent.m_N || ent.m_value || ent.m_extra.length()) {
79 o << "[";
80 if (ent.m_N) o << "N=" << ent.m_N << ",";
81 if (ent.m_value) o << "unkn=" << ent.m_value << ",";
82 if (ent.m_extra.length()) o << ent.m_extra;
83 o << "],";
84 }
85 return o;
86 }
88 int m_fileType;
90 int m_N;
92 int m_value;
93 };
94
96 struct MarinerWrtStruct {
98 MarinerWrtStruct()
99 : m_filePos(-1)
100 , m_pos()
101 , m_type(-1)
102 , m_data()
103 {
104 }
106 friend std::ostream &operator<<(std::ostream &o, MarinerWrtStruct const &dt);
108 int numValues() const
109 {
110 return int(m_data.size());
111 }
113 bool isBasic() const
114 {
115 return (m_type==1 || m_type==2) && m_data.size()<=1;
116 }
118 long value(int i) const;
120 long m_filePos;
122 MWAWEntry m_pos;
124 int m_type;
126 std::vector<long> m_data;
127 };
128
134 class MarinerWrtParser final : public MWAWTextParser
135 {
136 friend class MarinerWrtGraph;
137 friend class MarinerWrtText;
138 friend class MarinerWrtParserInternal::SubDocument;
139
140 public:
142 MarinerWrtParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
144 ~MarinerWrtParser() final;
145
147 bool checkHeader(MWAWHeader *header, bool strict=false) final;
148
149 // the main parse function
150 void parse(librevenge::RVNGTextInterface *documentInterface) final;
151
152 protected:
154 void init();
155
157 void createDocument(librevenge::RVNGTextInterface *documentInterface);
158
160 bool createZones();
162 bool readZone(int &actZone, bool onlyTest=false);
163
165 MWAWVec2f getPageLeftTop() const;
167 MWAWSection getSection(int zoneId) const;
168
170 void newPage(int number);
171
172 // interface with the text parser
173
175 int getZoneId(uint32_t fileId, bool &endNote);
177 void sendText(int zoneId);
178
179 // interface with the graph parser
181 float getPatternPercent(int id) const;
183 void sendToken(int zoneId, long tokenId);
184
185 //
186 // low level
187 //
188
190 bool readEntryHeader(MarinerWrtEntry &entry);
192 bool decodeZone(std::vector<MarinerWrtStruct> &dataList, long numData=999999);
193
195 bool readSeparator(MarinerWrtEntry const &entry);
197 bool readZoneDim(MarinerWrtEntry const &entry, int zoneId);
199 bool readZoneHeader(MarinerWrtEntry const &entry, int zoneId, bool onlyTest);
201 bool readZoneb(MarinerWrtEntry const &entry, int zoneId);
203 bool readZonec(MarinerWrtEntry const &entry, int zoneId);
205 bool readZone13(MarinerWrtEntry const &entry, int zoneId);
207 bool readDocInfo(MarinerWrtEntry const &entry, int zoneId);
209 bool readPrintInfo(MarinerWrtEntry const &entry);
211 bool readCPRT(MarinerWrtEntry const &entry);
212
214 bool readNumbersString(int num, std::vector<long> &res);
215
216 protected:
217 //
218 // data
219 //
221 std::shared_ptr<MarinerWrtParserInternal::State> m_state;
222
224 bool m_pageMarginsSpanSet;
225
227 std::shared_ptr<MarinerWrtGraph> m_graphParser;
228
230 std::shared_ptr<MarinerWrtText> m_textParser;
231 };
232 #endif
233 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWTextListenerPtr
std::shared_ptr< MWAWTextListener > MWAWTextListenerPtr
a smart pointer of MWAWTextListener
Definition: libmwaw_internal.hxx:567
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
MarinerWrtParser::readZoneDim
bool readZoneDim(MarinerWrtEntry const &entry, int zoneId)
try to read the zone dimension ( normal and with margin )
Definition: MarinerWrtParser.cxx:852
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
MWAWTextParser
virtual class which defines the ancestor of all text zone parser
Definition: MWAWParser.hxx:298
MarinerWrtParser::readCPRT
bool readCPRT(MarinerWrtEntry const &entry)
try to read a xml printinfo zone
Definition: MarinerWrtParser.cxx:1272
MarinerWrtEntry::m_value
int m_value
a unknown value
Definition: MarinerWrtParser.hxx:92
MarinerWrtParserInternal::State::m_firstPageFooter
bool m_firstPageFooter
a flag to know if we have a first page footer
Definition: MarinerWrtParser.cxx:191
MarinerWrtParser::MarinerWrtGraph
friend class MarinerWrtGraph
Definition: MarinerWrtParser.hxx:136
MarinerWrtParserInternal::Zone
Internal: the struct used to store the zone of a MarinerWrtParser.
Definition: MarinerWrtParser.cxx:69
MWAWPageSpan::setPageSpan
void setPageSpan(const int pageSpan)
set the page span ( default 1)
Definition: MWAWPageSpan.hxx:268
MWAWHeaderFooter::HEADER
@ HEADER
Definition: MWAWPageSpan.hxx:48
MarinerWrtParser::readNumbersString
bool readNumbersString(int num, std::vector< long > &res)
try to read a number or a list of number entries
Definition: MarinerWrtParser.cxx:1382
MWAW_DEBUG_MSG
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
MarinerWrtParserInternal::State::m_numPages
int m_numPages
the number of page of the final document
Definition: MarinerWrtParser.cxx:189
MarinerWrtParserInternal::Zone::Z_Footer
@ Z_Footer
Definition: MarinerWrtParser.cxx:71
MWAWVec2f
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:842
MarinerWrtParserInternal::State::m_zonesList
std::vector< Zone > m_zonesList
the list of zone
Definition: MarinerWrtParser.cxx:186
MarinerWrtParser::parse
void parse(librevenge::RVNGTextInterface *documentInterface) final
virtual function used to parse the input
Definition: MarinerWrtParser.cxx:348
MarinerWrtParser::init
void init()
inits all internal variables
Definition: MarinerWrtParser.cxx:262
MarinerWrtEntry::name
std::string name() const
returns the entry name;
Definition: MarinerWrtParser.cxx:1541
MarinerWrtStruct::value
long value(int i) const
returns the ith value (or 0 if it does not exists )
Definition: MarinerWrtParser.cxx:1594
MarinerWrtParserInternal::Zone::m_section
MWAWSection m_section
the section
Definition: MarinerWrtParser.cxx:109
MarinerWrtParserInternal::SubDocument::SubDocument
SubDocument(MarinerWrtParser &pars, MWAWInputStreamPtr const &input, int zoneId)
Definition: MarinerWrtParser.cxx:201
MarinerWrtParser::sendToken
void sendToken(int zoneId, long tokenId)
ask the graph parser to send a token
Definition: MarinerWrtParser.cxx:337
MarinerWrtParserInternal::Zone::Z_Unknown
@ Z_Unknown
Definition: MarinerWrtParser.cxx:71
MWAWHeaderFooter::EVEN
@ EVEN
Definition: MWAWPageSpan.hxx:50
MWAWTextListener
This class contents the main functions needed to create a Word processing Document.
Definition: MWAWTextListener.hxx:64
MWAWSection::m_columnSeparator
MWAWBorder m_columnSeparator
the vertical separator between columns
Definition: MWAWSection.hxx:112
libmwaw::DebugFile::open
bool open(std::string const &filename)
opens/creates a file to store a result
Definition: MWAWDebug.cxx:46
MWAWEntry.hxx
MWAWPageSpan::setMarginBottom
void setMarginBottom(const double marginBottom)
set the page bottom margin
Definition: MWAWPageSpan.hxx:208
MarinerWrtParser::readSeparator
bool readSeparator(MarinerWrtEntry const &entry)
try to read the separator of differents part
Definition: MarinerWrtParser.cxx:616
MWAWFontConverter.hxx
MarinerWrtEntry::MarinerWrtEntry
MarinerWrtEntry()
constructor
Definition: MarinerWrtParser.hxx:64
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:192
MarinerWrtEntry::m_fileType
int m_fileType
the entry type
Definition: MarinerWrtParser.hxx:88
MWAWDocument::MWAW_T_MARINERWRITE
@ MWAW_T_MARINERWRITE
Mariner Write (only v1.6-v3.5 Mac Classic)
Definition: MWAWDocument.hxx:127
MWAWPrinter.hxx
MWAWBox2l
MWAWBox2< long > MWAWBox2l
MWAWBox2 of long.
Definition: libmwaw_internal.hxx:1195
MWAWPageSpan::setMarginLeft
void setMarginLeft(const double marginLeft)
set the page left margin
Definition: MWAWPageSpan.hxx:193
MWAWHeaderFooter::m_subDocument
MWAWSubDocumentPtr m_subDocument
the document data
Definition: MWAWPageSpan.hxx:92
libmwaw::PrinterInfo
the AppleŠ printer information : TPrint
Definition: MWAWPrinter.hxx:82
MWAWParser::getTextListener
MWAWTextListenerPtr & getTextListener()
returns the text listener
Definition: MWAWParser.hxx:145
MarinerWrtParserInternal::SubDocument::~SubDocument
~SubDocument() final
destructor
Definition: MarinerWrtParser.cxx:208
MarinerWrtParser::getSection
MWAWSection getSection(int zoneId) const
returns the section information corresponding to a zone
Definition: MarinerWrtParser.cxx:285
MarinerWrtParser::readDocInfo
bool readDocInfo(MarinerWrtEntry const &entry, int zoneId)
try to read the doc info zone
Definition: MarinerWrtParser.cxx:936
libmwaw::DebugFile::addNote
void addNote(char const *note)
adds a note in the file, in actual position
Definition: MWAWDebug.cxx:59
MWAWSubDocument
abstract class used to store a subdocument (with a comparison function)
Definition: MWAWSubDocument.hxx:41
MarinerWrtParserInternal
Internal: the structures of a MarinerWrtParser.
Definition: MarinerWrtParser.cxx:65
MarinerWrtParserInternal::State::State
State()
constructor
Definition: MarinerWrtParser.cxx:175
MWAWParser::ascii
libmwaw::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: MWAWParser.hxx:195
MarinerWrtParserInternal::Zone::m_dim
MWAWBox2l m_dim
the zone total position
Definition: MarinerWrtParser.cxx:103
MWAWHeaderFooter
a class which stores the header/footer data
Definition: MWAWPageSpan.hxx:44
MWAWCell.hxx
MarinerWrtParserInternal::Zone::m_type
Type m_type
the zone type
Definition: MarinerWrtParser.cxx:95
MarinerWrtParser::readZonec
bool readZonec(MarinerWrtEntry const &entry, int zoneId)
try to read a unknown zone of 9 int
Definition: MarinerWrtParser.cxx:1127
MarinerWrtParser::getPatternPercent
float getPatternPercent(int id) const
return the pattern percent which corresponds to an id (or -1)
Definition: MarinerWrtParser.cxx:332
MarinerWrtParser::MarinerWrtText
friend class MarinerWrtText
Definition: MarinerWrtParser.hxx:137
MarinerWrtParserInternal::Zone::m_pageDim
MWAWBox2i m_pageDim
the page dimension (?)
Definition: MarinerWrtParser.cxx:105
MWAWSubDocument.hxx
MWAWPageSpan::setFormLength
void setFormLength(const double formLength)
set the total page length
Definition: MWAWPageSpan.hxx:178
MWAWPageSpan::getPageSpan
int getPageSpan() const
Definition: MWAWPageSpan.hxx:170
MarinerWrtParserInternal::Zone::m_endNote
bool m_endNote
a flag to know if this an endnote
Definition: MarinerWrtParser.cxx:97
MarinerWrtParser::createZones
bool createZones()
finds the different objects zones
Definition: MarinerWrtParser.cxx:471
MarinerWrtParserInternal::Zone::m_fileId
uint32_t m_fileId
the file zone id
Definition: MarinerWrtParser.cxx:93
MarinerWrtParserInternal::operator<<
std::ostream & operator<<(std::ostream &o, Zone const &zone)
Definition: MarinerWrtParser.cxx:116
libmwaw::SubDocumentType
SubDocumentType
Definition: libmwaw_internal.hxx:188
MarinerWrtParserInternal::SubDocument::operator!=
bool operator!=(MWAWSubDocument const &doc) const final
operator!=
Definition: MarinerWrtParser.cxx:211
MWAWPageSpan::setBackgroundColor
void setBackgroundColor(MWAWColor color=MWAWColor::white())
set the background color
Definition: MWAWPageSpan.hxx:258
MWAWSubDocument::m_input
std::shared_ptr< MWAWInputStream > m_input
the input
Definition: MWAWSubDocument.hxx:77
libmwaw::DebugFile::reset
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:93
MarinerWrtParser::~MarinerWrtParser
~MarinerWrtParser() final
destructor
Definition: MarinerWrtParser.cxx:258
MarinerWrtParser::decodeZone
bool decodeZone(std::vector< MarinerWrtStruct > &dataList, long numData=999999)
try to decode a zone
Definition: MarinerWrtParser.cxx:1440
MWAWParser::setTextListener
void setTextListener(MWAWTextListenerPtr &listener)
sets the text listener
Definition: MWAWParser.cxx:158
MWAWParser::setAsciiName
void setAsciiName(char const *name)
Debugging: change the default ascii file.
Definition: MWAWParser.hxx:227
MWAWParagraph.hxx
libmwaw::DebugFile::skipZone
void skipZone(long beginPos, long endPos)
skips the file zone defined by beginPos-endPos
Definition: MWAWDebug.hxx:113
MWAWVec2::y
T y() const
second element
Definition: libmwaw_internal.hxx:673
MWAWParser::getPageSpan
const MWAWPageSpan & getPageSpan() const
returns the actual page dimension
Definition: MWAWParser.hxx:160
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
MarinerWrtParserInternal::Zone::Z_Header
@ Z_Header
Definition: MarinerWrtParser.cxx:71
MarinerWrtParserInternal::Zone::m_height
long m_height
height of the zone
Definition: MarinerWrtParser.cxx:99
MWAWPageSpan::setFormWidth
void setFormWidth(const double formWidth)
set the total page width
Definition: MWAWPageSpan.hxx:183
MWAWPosition.hxx
MWAWVec2::x
T x() const
first element
Definition: libmwaw_internal.hxx:668
MarinerWrtParserInternal::Zone::m_backgroundColor
MWAWColor m_backgroundColor
the background color
Definition: MarinerWrtParser.cxx:111
MarinerWrtStruct::operator<<
friend std::ostream & operator<<(std::ostream &o, MarinerWrtStruct const &dt)
operator<<
Definition: MarinerWrtParser.cxx:1604
MarinerWrtParser::MarinerWrtParser
MarinerWrtParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition: MarinerWrtParser.cxx:248
MarinerWrtGraph
the main class to read the graphic part of a Mariner Write file
Definition: MarinerWrtGraph.hxx:68
MarinerWrtParserInternal::State::m_actPage
int m_actPage
the actual page
Definition: MarinerWrtParser.cxx:189
MarinerWrtParserInternal::Zone::Z_Footnote
@ Z_Footnote
Definition: MarinerWrtParser.cxx:71
MWAWBorder
a border
Definition: libmwaw_internal.hxx:333
MWAWEntry::setBegin
void setBegin(long off)
sets the begin offset
Definition: MWAWEntry.hxx:67
MWAWColor::isBlack
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:284
MWAWSection::m_columns
std::vector< Column > m_columns
the different column
Definition: MWAWSection.hxx:108
MarinerWrtParser::newPage
void newPage(int number)
adds a new page
Definition: MarinerWrtParser.cxx:295
MWAWParser::asciiName
const std::string & asciiName() const
return the ascii file name
Definition: MWAWParser.hxx:232
MarinerWrtParserInternal::Zone::m_pageTextDim
MWAWBox2i m_pageTextDim
the zone of text dimension ( ie page less margins)
Definition: MarinerWrtParser.cxx:107
MWAWParser::setVersion
void setVersion(int vers)
sets the document's version
Definition: MWAWParser.hxx:206
MWAWRSRCParserPtr
std::shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:561
MWAWEntry::length
long length() const
returns the length of the zone
Definition: MWAWEntry.hxx:93
MWAWSection::Column::m_width
double m_width
the columns width
Definition: MWAWSection.hxx:150
MWAWSection::Column
struct to store the columns properties
Definition: MWAWSection.hxx:120
MWAWListener::PageBreak
@ PageBreak
Definition: MWAWListener.hxx:58
libmwaw::DebugFile::setStream
void setStream(MWAWInputStreamPtr const &ip)
resets the input
Definition: MWAWDebug.hxx:81
MWAWVec2< long >
MarinerWrtParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition: MarinerWrtParser.cxx:1507
MarinerWrtParser::getPageLeftTop
MWAWVec2f getPageLeftTop() const
returns the page left top point ( in inches)
Definition: MarinerWrtParser.cxx:279
MWAWHeaderFooter::ODD
@ ODD
Definition: MWAWPageSpan.hxx:50
MWAWPictMac.hxx
MarinerWrtParserInternal::Zone::m_RBpos
MWAWVec2l m_RBpos
right/bottom position
Definition: MarinerWrtParser.cxx:101
MarinerWrtEntry::~MarinerWrtEntry
~MarinerWrtEntry() final
destructor
Definition: MarinerWrtParser.cxx:1537
MWAWSection
a class which stores section properties
Definition: MWAWSection.hxx:45
libmwaw::ParseException
Definition: libmwaw_internal.hxx:143
MWAWDebug.hxx
MarinerWrtParser::readZoneb
bool readZoneb(MarinerWrtEntry const &entry, int zoneId)
try to read a unknown zone : one by separator?, borderdim?
Definition: MarinerWrtParser.cxx:1086
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:56
MWAWEntry::begin
long begin() const
returns the begin offset
Definition: MWAWEntry.hxx:83
MarinerWrtParserInternal::Zone::m_id
int m_id
the zone id
Definition: MarinerWrtParser.cxx:91
MWAWEntry::setLength
void setLength(long l)
sets the zone size
Definition: MWAWEntry.hxx:72
MarinerWrtStruct::m_pos
MWAWEntry m_pos
the file data position (for type=0 data )
Definition: MarinerWrtParser.hxx:122
MarinerWrtParser
the main class to read a Mariner Write file
Definition: MarinerWrtParser.hxx:134
MWAWHeaderFooter::Occurrence
Occurrence
the header/footer occurrence in the file
Definition: MWAWPageSpan.hxx:50
MarinerWrtParserInternal::Zone::Type
Type
a enum to define the diffent zone type
Definition: MarinerWrtParser.cxx:71
MarinerWrtParser::getZoneId
int getZoneId(uint32_t fileId, bool &endNote)
return a zoneid corresponding to a fileId (or -1) and set the endnote flag
Definition: MarinerWrtParser.cxx:311
MarinerWrtStruct::m_type
int m_type
the data type
Definition: MarinerWrtParser.hxx:124
MarinerWrtParserInternal::Zone::Zone
Zone()
constructor
Definition: MarinerWrtParser.cxx:73
MWAWPageSpan::setMarginTop
void setMarginTop(const double marginTop)
set the page top margin
Definition: MWAWPageSpan.hxx:203
MarinerWrtStruct::m_filePos
long m_filePos
the file position where the field description begin
Definition: MarinerWrtParser.hxx:120
libmwaw::PrinterInfo::read
bool read(MWAWInputStreamPtr input)
reads the struture in a file
Definition: MWAWPrinter.cxx:235
MWAWHeaderFooter::FOOTER
@ FOOTER
Definition: MWAWPageSpan.hxx:48
MarinerWrtParser::createDocument
void createDocument(librevenge::RVNGTextInterface *documentInterface)
creates the listener which will be associated to the document
Definition: MarinerWrtParser.cxx:383
MarinerWrtParserInternal::State::m_hasOddEvenHeaderFooter
bool m_hasOddEvenHeaderFooter
a flag to know if we have odd/even header footer
Definition: MarinerWrtParser.cxx:193
MWAWParser::getParserState
MWAWParserStatePtr getParserState()
returns the parser state
Definition: MWAWParser.hxx:113
MarinerWrtParser::m_graphParser
std::shared_ptr< MarinerWrtGraph > m_graphParser
the graph parser
Definition: MarinerWrtParser.hxx:227
MarinerWrtParserInternal::Zone::m_extra
std::string m_extra
extra data
Definition: MarinerWrtParser.cxx:113
MWAWHeader.hxx
MarinerWrtParserInternal::SubDocument::parse
void parse(MWAWListenerPtr &listener, libmwaw::SubDocumentType type) final
the parser function
Definition: MarinerWrtParser.cxx:228
MarinerWrtEntry
a entry to store a zone structure
Definition: MarinerWrtParser.hxx:62
MWAWEntry::end
long end() const
returns the end offset
Definition: MWAWEntry.hxx:88
MarinerWrtStruct::numValues
int numValues() const
returns the number of values
Definition: MarinerWrtParser.hxx:108
MWAWHeaderFooter::ALL
@ ALL
Definition: MWAWPageSpan.hxx:50
MarinerWrtParserInternal::Zone::operator<<
friend std::ostream & operator<<(std::ostream &o, Zone const &zone)
operator<<
Definition: MarinerWrtParser.cxx:116
MarinerWrtParser::sendText
void sendText(int zoneId)
ask the text parser to send a zone
Definition: MarinerWrtParser.cxx:324
MarinerWrtStruct::isBasic
bool isBasic() const
returns true if this corresponds to a simple container
Definition: MarinerWrtParser.hxx:113
MWAWList.hxx
MarinerWrtParserInternal::SubDocument
Internal: the subdocument of a MarinerWrtParser.
Definition: MarinerWrtParser.cxx:198
MarinerWrtText
the main class to read the text part of Mariner Write file
Definition: MarinerWrtText.hxx:60
MarinerWrtParserInternal::Zone::Z_Main
@ Z_Main
Definition: MarinerWrtParser.cxx:71
MarinerWrtStruct
Internal: a struct used to read some field.
Definition: MarinerWrtParser.hxx:96
MWAWSection::Column::m_widthUnit
librevenge::RVNGUnit m_widthUnit
the width unit (default inches)
Definition: MWAWSection.hxx:152
MWAWParser::getInput
MWAWInputStreamPtr & getInput()
returns the actual input
Definition: MWAWParser.hxx:123
MWAWPageSpan::checkMargins
void checkMargins()
check if the page margins are consistent with the page dimension, if not update them
Definition: MWAWPageSpan.cxx:271
MarinerWrtParser::readZone
bool readZone(int &actZone, bool onlyTest=false)
try to read a zone
Definition: MarinerWrtParser.cxx:483
MWAWTextListener.hxx
MarinerWrtParser::readPrintInfo
bool readPrintInfo(MarinerWrtEntry const &entry)
try to read a printinfo zone
Definition: MarinerWrtParser.cxx:1298
libmwaw::Right
@ Right
Definition: libmwaw_internal.hxx:176
MWAWVec2l
MWAWVec2< long > MWAWVec2l
MWAWVec2 of long.
Definition: libmwaw_internal.hxx:840
MWAWSubDocument::m_parser
MWAWParser * m_parser
the main zone parser
Definition: MWAWSubDocument.hxx:75
MWAWSection.hxx
MarinerWrtParser::readZone13
bool readZone13(MarinerWrtEntry const &entry, int zoneId)
try to read a unknown zone of 23 int
Definition: MarinerWrtParser.cxx:1177
libmwaw::DebugFile::addPos
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
MWAWPageSpan::setMarginRight
void setMarginRight(const double marginRight)
set the page right margin
Definition: MWAWPageSpan.hxx:198
MWAWEntry::valid
bool valid() const
returns true if the zone length is positive
Definition: MWAWEntry.hxx:99
MWAWPageSpan::setHeaderFooter
void setHeaderFooter(MWAWHeaderFooter const &headerFooter)
add a header/footer on some page
Definition: MWAWPageSpan.cxx:227
libmwaw::Left
@ Left
Definition: libmwaw_internal.hxx:176
MWAWBox2::size
MWAWVec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:1067
MarinerWrtParserInternal::State::m_fileToZoneMap
std::map< uint32_t, int > m_fileToZoneMap
a map fileZoneId -> localZoneId
Definition: MarinerWrtParser.cxx:188
MarinerWrtStruct::MarinerWrtStruct
MarinerWrtStruct()
constructor
Definition: MarinerWrtParser.hxx:98
MarinerWrtStruct::m_data
std::vector< long > m_data
the data block
Definition: MarinerWrtParser.hxx:126
MWAWInputStream.hxx
MarinerWrtParser::readZoneHeader
bool readZoneHeader(MarinerWrtEntry const &entry, int zoneId, bool onlyTest)
try to read the zone header
Definition: MarinerWrtParser.cxx:645
MWAWColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:289
MWAWHeader::reset
void reset(MWAWDocument::Type type, int vers, Kind kind=MWAWDocument::MWAW_K_TEXT)
resets the data
Definition: MWAWHeader.hxx:84
MWAWListenerPtr
std::shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:553
MWAWFont.hxx
MarinerWrtEntry::m_N
int m_N
the number of value
Definition: MarinerWrtParser.hxx:90
librevenge
Definition: MWAWDocument.hxx:56
MWAWPageSpan::setMargins
void setMargins(double margin, int wh=libmwaw::LeftBit|libmwaw::RightBit|libmwaw::TopBit|libmwaw::BottomBit)
set all the margins
Definition: MWAWPageSpan.hxx:213
MWAWBox2< long >
MarinerWrtParser::m_state
std::shared_ptr< MarinerWrtParserInternal::State > m_state
the state
Definition: MarinerWrtParser.hxx:221
MarinerWrtParserInternal::State
Internal: the state of a MarinerWrtParser.
Definition: MarinerWrtParser.cxx:173
operator<<
std::ostream & operator<<(std::ostream &o, MarinerWrtStruct const &dt)
Definition: MarinerWrtParser.cxx:1604
MarinerWrtParser::readEntryHeader
bool readEntryHeader(MarinerWrtEntry &entry)
try to read an entry header
Definition: MarinerWrtParser.cxx:1357
MarinerWrtParser.hxx
MarinerWrtText.hxx
MarinerWrtParser::m_textParser
std::shared_ptr< MarinerWrtText > m_textParser
the text parser
Definition: MarinerWrtParser.hxx:230
MarinerWrtParser::m_pageMarginsSpanSet
bool m_pageMarginsSpanSet
a flag to know if page margins span are set
Definition: MarinerWrtParser.hxx:224
MarinerWrtParserInternal::SubDocument::m_id
int m_id
the subdocument id
Definition: MarinerWrtParser.cxx:225
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
MarinerWrtGraph.hxx
MWAWPageSpan
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:98
MWAWParser::resetTextListener
void resetTextListener()
resets the listener
Definition: MWAWParser.cxx:163
MWAWSection::Column::m_margins
double m_margins[4]
the margins in inches using libmwaw::Position orders
Definition: MWAWSection.hxx:154