Go to the documentation of this file.
34 #ifndef MAC_WRT_PARSER
35 # define MAC_WRT_PARSER
70 void parse(librevenge::RVNGTextInterface *documentInterface);
77 void createDocument(librevenge::RVNGTextInterface *documentInterface);
96 std::vector<int> &linesHeight);
100 std::vector<MacWrtParserInternal::Information> &informations);
104 std::vector<MacWrtParserInternal::Information> &informations);
113 static bool isMagicPic(librevenge::RVNGBinaryData
const &dt);
132 shared_ptr<MacWrtParserInternal::State>
m_state;
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:47
@ Time
Definition: libmwaw_internal.hxx:371
MWAWVec2i m_startSel
Definition: MacWrtParser.cxx:247
MWAWVariable< Justification > m_justify
the justification
Definition: MWAWParagraph.hxx:161
virtual class which defines the ancestor of all text zone parser
Definition: MWAWParser.hxx:296
ReadResult
an enum to defined the result of a parsing use by some picture's classes which can read their data
Definition: MWAWPict.hxx:73
MWAWVec2i m_pageNumber
Definition: MacWrtParser.cxx:251
MWAWVec2i m_time
Definition: MacWrtParser.cxx:251
@ LEFT
Definition: MWAWParagraph.hxx:48
MWAWFontConverterPtr & getFontConverter()
returns the font converter
Definition: MWAWParser.hxx:150
void set(Script const &newscript)
sets the script position
Definition: MWAWFont.hxx:293
shared_ptr< MWAWTextListener > MWAWTextListenerPtr
a smart pointer of MWAWTextListener
Definition: libmwaw_internal.hxx:519
void setPageSpan(const int pageSpan)
set the page span ( default 1)
Definition: MWAWPageSpan.hxx:262
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:127
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:785
State()
constructor
Definition: MacWrtParser.cxx:268
void addDelimiter(long pos, char c)
adds a not breaking delimiter in position pos
Definition: MWAWDebug.cxx:73
bool checkHeader(MWAWHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: MacWrtParser.cxx:698
bool readText(MacWrtParserInternal::Information const &info, std::vector< int > const &lineHeight)
read a text zone
Definition: MacWrtParser.cxx:1213
Alignment
the tab alignment
Definition: MWAWParagraph.hxx:48
void setRelativePosition(AnchorTo anchor, XPos X=XLeft, YPos Y=YTop)
sets the relative position
Definition: MWAWPosition.hxx:221
MWAWVariable< std::vector< MWAWTabStop > > m_tabs
the tabulations
Definition: MWAWParagraph.hxx:156
bool readWindowsInfo(int wh)
read the windows zone
Definition: MacWrtParser.cxx:854
Internal: the subdocument of a MacWrtParser.
Definition: MacWrtParser.cxx:291
void setPage(int pg) const
sets the page
Definition: MWAWPosition.hxx:189
MWAWVec2i m_endSel
Definition: MacWrtParser.cxx:247
MWAWVec2i m_date
Definition: MacWrtParser.cxx:251
int m_footerHeight
the footer height if known
Definition: MacWrtParser.cxx:285
static Script sub100()
return a yposition which correspond to a basic subscript100
Definition: MWAWFont.hxx:117
@ boldBit
Definition: MWAWFont.hxx:182
This class contents the main functions needed to create a Word processing Document.
Definition: MWAWTextListener.hxx:65
std::vector< librevenge::RVNGBinaryData > m_dataList
the picture content: one data by representation
Definition: libmwaw_internal.hxx:465
bool open(std::string const &filename)
opens/creates a file to store a result
Definition: MWAWDebug.cxx:46
WindowsInfo m_windows[3]
the information of main document, header, footer
Definition: MacWrtParser.cxx:282
bool readLinesHeight(MWAWEntry const &entry, std::vector< int > &firstParagLine, std::vector< int > &linesHeight)
read the line height
Definition: MacWrtParser.cxx:964
void setInterline(double value, librevenge::RVNGUnit unit, LineSpacingType type=Fixed)
set the interline
Definition: MWAWParagraph.hxx:123
int id() const
returns the id
Definition: MWAWEntry.hxx:153
void setMarginBottom(const double marginBottom)
set the page bottom margin
Definition: MWAWPageSpan.hxx:202
small class use to define a embedded object
Definition: libmwaw_internal.hxx:425
int version() const
returns the works version
Definition: MWAWParser.hxx:108
@ JustificationFullAllLines
Definition: MWAWParagraph.hxx:88
class to store the paragraph properties
Definition: MWAWParagraph.hxx:82
void setMarginLeft(const double marginLeft)
set the page left margin
Definition: MWAWPageSpan.hxx:187
@ Simple
Definition: MWAWFont.hxx:49
the AppleŠ printer information : TPrint
Definition: MWAWPrinter.hxx:82
void init()
inits all internal variables
Definition: MacWrtParser.cxx:359
MWAWTextListenerPtr & getTextListener()
returns the text listener
Definition: MWAWParser.hxx:145
bool readPageBreak(MacWrtParserInternal::Information const &info)
read a page break zone ( version <= 3)
Definition: MacWrtParser.cxx:1478
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
MWAWVariable< double > m_margins[3]
the margins
Definition: MWAWParagraph.hxx:142
bool readPrintInfo()
read the print info zone
Definition: MacWrtParser.cxx:801
@ DECIMAL
Definition: MWAWParagraph.hxx:48
void setNaturalSize(MWAWVec2f const &naturalSz)
sets the natural size (if known)
Definition: MWAWPosition.hxx:204
libmwaw::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: MWAWParser.hxx:195
static Script super100()
return a yposition which correspond to a basic superscript100
Definition: MWAWFont.hxx:127
@ embossBit
Definition: MWAWFont.hxx:182
shared_ptr< MacWrtParserInternal::State > m_state
the state
Definition: MacWrtParser.hxx:132
@ Date
Definition: libmwaw_internal.hxx:371
std::string const & asciiName() const
return the ascii file name
Definition: MWAWParser.hxx:232
std::vector< int > m_firstParagLine
Definition: MacWrtParser.cxx:250
void setFormLength(const double formLength)
set the total page length
Definition: MWAWPageSpan.hxx:172
int getPageSpan() const
Definition: MWAWPageSpan.hxx:164
bool readInformations(MWAWEntry const &entry, std::vector< MacWrtParserInternal::Information > &informations)
read the information
Definition: MacWrtParser.cxx:1081
double getPageWidth() const
returns the page width (form width without margin )
Definition: MWAWParser.hxx:185
int m_posTopY
Definition: MacWrtParser.cxx:248
static ReadResult check(MWAWInputStreamPtr input, int size, MWAWBox2f &box)
checks if the data pointed by input is known
Definition: MWAWPictData.hxx:100
SubDocumentType
Definition: libmwaw_internal.hxx:178
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:85
@ JustificationCenter
Definition: MWAWParagraph.hxx:87
bool createZonesV3()
finds the different objects zones (version <= 3)
Definition: MacWrtParser.cxx:527
Justification
an enum used to defined the paragraph justification: left, center, right, full ...
Definition: MWAWParagraph.hxx:87
@ shadowBit
Definition: MWAWFont.hxx:183
void setTextListener(MWAWTextListenerPtr &listener)
sets the text listener
Definition: MWAWParser.cxx:146
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:105
std::string getDebugString(shared_ptr< MWAWFontConverter > &converter) const
returns a string which can be used for debugging
Definition: MWAWFont.cxx:181
T y() const
second element
Definition: libmwaw_internal.hxx:620
MWAWRSRCParserPtr & getRSRCParser()
returns the rsrc parser
Definition: MWAWParser.hxx:190
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:197
friend std::ostream & operator<<(std::ostream &o, WindowsInfo const &w)
Definition: MacWrtParser.cxx:254
SubDocument(MacWrtParser &pars, MWAWInputStreamPtr input, int zoneId)
Definition: MacWrtParser.cxx:293
FileHeader m_fileHeader
the header
Definition: MacWrtParser.cxx:279
virtual ~SubDocument()
destructor
Definition: MacWrtParser.cxx:297
void setFormWidth(const double formWidth)
set the total page width
Definition: MWAWPageSpan.hxx:177
void setEnd(long off)
sets the end offset
Definition: MWAWEntry.hxx:66
T x() const
first element
Definition: libmwaw_internal.hxx:615
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:48
bool readGraphic(MacWrtParserInternal::Information const &info)
read a graphics
Definition: MacWrtParser.cxx:1526
void setBegin(long off)
sets the begin offset
Definition: MWAWEntry.hxx:56
void setVersion(int vers)
sets the document's version
Definition: MWAWParser.hxx:206
long length() const
returns the length of the zone
Definition: MWAWEntry.hxx:82
@ PageBreak
Definition: MWAWListener.hxx:58
virtual bool operator==(MWAWSubDocument const &doc) const
operator!==
Definition: MacWrtParser.cxx:302
@ MWAW_R_BAD
Definition: MWAWPict.hxx:73
MacWrtParser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
constructor
Definition: MacWrtParser.cxx:349
Definition: libmwaw_internal.hxx:142
long begin() const
returns the begin offset
Definition: MWAWEntry.hxx:72
void setLength(long l)
sets the zone size
Definition: MWAWEntry.hxx:61
MWAWPageSpan const & getPageSpan() const
returns the actual page dimension
Definition: MWAWParser.hxx:160
bool readParagraph(MacWrtParserInternal::Information const &info)
read a paragraph
Definition: MacWrtParser.cxx:1387
Internal: the state of a MacWrtParser.
Definition: MacWrtParser.cxx:266
void setId(int newId)
sets the font id
Definition: MWAWFont.hxx:243
void setId(int newId)
sets the id
Definition: MWAWEntry.hxx:158
a field
Definition: libmwaw_internal.hxx:369
@ PageNumber
Definition: libmwaw_internal.hxx:371
static bool isMagicPic(librevenge::RVNGBinaryData const &dt)
test if a graphic is empty.
Definition: MacWrtParser.cxx:1603
void setMarginTop(const double marginTop)
set the page top margin
Definition: MWAWPageSpan.hxx:197
@ JustificationLeft
Definition: MWAWParagraph.hxx:87
bool read(MWAWInputStreamPtr input)
reads the struture in a file
Definition: MWAWPrinter.cxx:218
@ Char
Definition: MWAWPosition.hxx:51
the main class to read a MacWrite file
Definition: MacWrtParser.hxx:57
@ MWAW_T_MACWRITE
MacWrite.
Definition: MWAWDocument.hxx:134
MWAWParserStatePtr getParserState()
returns the parser state
Definition: MWAWParser.hxx:113
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:503
long end() const
returns the end offset
Definition: MWAWEntry.hxx:77
void setSize(float sz, bool isRelative=false)
sets the font size
Definition: MWAWFont.hxx:254
bool checkFreeList()
check the free list
Definition: MacWrtParser.cxx:1618
@ italicBit
Definition: MWAWFont.hxx:182
MWAWInputStreamPtr & getInput()
returns the actual input
Definition: MWAWParser.hxx:123
MWAWParser * m_parser
the main zone parser
Definition: MWAWSubDocument.hxx:75
void parse(MWAWListenerPtr &listener, libmwaw::SubDocumentType type)
the parser function
Definition: MacWrtParser.cxx:315
@ JustificationFull
Definition: MWAWParagraph.hxx:87
int m_actPage
the actual page
Definition: MacWrtParser.cxx:276
@ JustificationRight
Definition: MWAWParagraph.hxx:88
int m_numPages
the number of page of the final document
Definition: MacWrtParser.cxx:276
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
std::string m_compressCorr
the correspondance between int compressed and char : must be 15 character
Definition: MacWrtParser.cxx:274
void setStream(MWAWInputStreamPtr ip)
resets the input
Definition: MWAWDebug.hxx:73
void parse(librevenge::RVNGTextInterface *documentInterface)
virtual function used to parse the input
Definition: MacWrtParser.cxx:389
void newPage(int number)
adds a new page
Definition: MacWrtParser.cxx:373
void setMarginRight(const double marginRight)
set the page right margin
Definition: MWAWPageSpan.hxx:192
bool valid() const
returns true if the zone length is positive
Definition: MWAWEntry.hxx:88
std::vector< Information > m_informations
Definition: MacWrtParser.cxx:249
T const & get() const
return the current value
Definition: libmwaw_internal.hxx:581
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:513
void setHeaderFooter(MWAWHeaderFooter const &headerFooter)
add a header/footer on some page
Definition: MWAWPageSpan.cxx:223
bool isEmpty() const
small function used to recognized empty header or footer
Definition: MacWrtParser.cxx:218
MWAWVec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:1008
std::ostream & operator<<(std::ostream &o, FileHeader const &header)
Definition: MacWrtParser.cxx:87
int m_headerHeight
the header height if known
Definition: MacWrtParser.cxx:284
void createDocument(librevenge::RVNGTextInterface *documentInterface)
creates the listener which will be associated to the document
Definition: MacWrtParser.cxx:429
virtual ~MacWrtParser()
destructor
Definition: MacWrtParser.cxx:355
void setMargins(double margin, int wh=libmwaw::LeftBit|libmwaw::RightBit|libmwaw::TopBit|libmwaw::BottomBit)
set all the margins
Definition: MWAWPageSpan.hxx:207
std::vector< int > m_linesHeight
Definition: MacWrtParser.cxx:250
WindowsInfo()
Definition: MacWrtParser.cxx:211
Class to store font.
Definition: MWAWFont.hxx:44
Internal: the structures of a MacWrtParser.
Definition: MacWrtParser.cxx:58
bool sendWindow(int zone)
send a zone ( 0: MAIN ZONE, 1 : HEADER, 2 : FOOTER )
Definition: MacWrtParser.cxx:630
bool createZones()
finds the different objects zones
Definition: MacWrtParser.cxx:475
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:781
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:505
static MWAWPictData * get(MWAWInputStreamPtr input, int size)
checks if the data pointed by input is known
Definition: MWAWPictData.hxx:108
void setUnderlineStyle(Line::Style style=Line::None, bool doReset=true)
sets the underline style ( by default, we also reset the style)
Definition: MWAWFont.hxx:445
bool readInformationsV3(int numInfo, std::vector< MacWrtParserInternal::Information > &informations)
read the information ( version <= 3)
Definition: MacWrtParser.cxx:1035
shared_ptr< MWAWInputStream > m_input
the input
Definition: MWAWSubDocument.hxx:77
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:96
the windows structure
Definition: MacWrtParser.cxx:210
void resetTextListener()
resets the listener
Definition: MWAWParser.cxx:151
virtual bool operator!=(MWAWSubDocument const &doc) const
operator!=
Definition: MacWrtParser.cxx:336
void setFlags(uint32_t fl)
sets the font attributes bold, ...
Definition: MWAWFont.hxx:304
int m_id
the subdocument id
Definition: MacWrtParser.cxx:312
Generated on Wed Jun 17 2020 06:30:10 for libmwaw by
doxygen 1.8.18