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