the main class to read a Writerperfect file More...
#include <WPParser.hxx>
Public Member Functions | |
WPParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header) | |
constructor | |
virtual | ~WPParser () |
destructor | |
bool | checkHeader (MWAWHeader *header, bool strict=false) |
checks if the document header is correct (or not) | |
void | parse (WPXDocumentInterface *documentInterface) |
virtual function used to parse the input | |
Protected Member Functions | |
void | init () |
inits all internal variables | |
void | createDocument (WPXDocumentInterface *documentInterface) |
creates the listener which will be associated to the document | |
bool | createZones () |
finds the different objects zones | |
bool | readPrintInfo () |
read the print info zone | |
bool | readWindowsInfo (int zone) |
read the main info for zone ( 0: MAIN ZONE, 1 : HEADER, 2 : FOOTER ) | |
bool | sendWindow (int zone, Vec2i limits=Vec2i(-1,-1)) |
send a zone ( 0: MAIN ZONE, 1 : HEADER, 2 : FOOTER ) | |
bool | readWindowsZone (int zone) |
read the page info zone | |
bool | readPageInfo (int zone) |
read the page info zone | |
bool | readColInfo (int zone) |
read the col info zone ? | |
bool | readParagraphInfo (int zone) |
read the paragraph info zone | |
bool | findSection (int zone, Vec2i limits, MWAWSection &sec) |
try to find the data which correspond to a section ( mainly column ) | |
bool | readSection (WPParserInternal::ParagraphInfo const &info, bool mainBlock) |
read a section | |
bool | readText (WPParserInternal::ParagraphInfo const &info) |
read a text | |
bool | readTable (WPParserInternal::ParagraphInfo const &info) |
read a table | |
bool | readGraphic (WPParserInternal::ParagraphInfo const &info) |
read a graphic | |
bool | readUnknown (WPParserInternal::ParagraphInfo const &info) |
read a unknown section | |
double | getTextHeight () const |
returns the page height, ie. paper size less margin (in inches) and header/footer | |
void | newPage (int number) |
adds a new page | |
bool | readParagraphData (WPParserInternal::ParagraphInfo const &info, bool hasFonts, WPParserInternal::ParagraphData &data) |
reads a paragraph data | |
MWAWParagraph | getParagraph (WPParserInternal::ParagraphData const &data) |
returns a paragraph corresponding to a paragraph data | |
bool | readFonts (int nFonts, int type, std::vector< WPParserInternal::Font > &fonts) |
reads a list of font (with position) | |
bool | readLines (WPParserInternal::ParagraphInfo const &info, int nLines, std::vector< WPParserInternal::Line > &lines) |
reads a list of line (with position) | |
Protected Attributes | |
shared_ptr < WPParserInternal::State > | m_state |
the state | |
Friends | |
class | WPParserInternal::SubDocument |
the main class to read a Writerperfect file
WPParser::WPParser | ( | MWAWInputStreamPtr | input, |
MWAWRSRCParserPtr | rsrcParser, | ||
MWAWHeader * | header | ||
) |
constructor
WPParser::~WPParser | ( | ) | [virtual] |
destructor
bool WPParser::checkHeader | ( | MWAWHeader * | header, |
bool | strict = false |
||
) | [virtual] |
void WPParser::createDocument | ( | WPXDocumentInterface * | documentInterface | ) | [protected] |
creates the listener which will be associated to the document
Referenced by parse().
bool WPParser::createZones | ( | ) | [protected] |
finds the different objects zones
Referenced by parse().
bool WPParser::findSection | ( | int | zone, |
Vec2i | limits, | ||
MWAWSection & | sec | ||
) | [protected] |
try to find the data which correspond to a section ( mainly column )
Referenced by sendWindow().
MWAWParagraph WPParser::getParagraph | ( | WPParserInternal::ParagraphData const & | data | ) | [protected] |
returns a paragraph corresponding to a paragraph data
Referenced by readText().
double WPParser::getTextHeight | ( | ) | const [protected] |
returns the page height, ie. paper size less margin (in inches) and header/footer
Referenced by readPageInfo().
void WPParser::init | ( | ) | [protected] |
inits all internal variables
Referenced by WPParser().
void WPParser::newPage | ( | int | number | ) | [protected] |
adds a new page
Referenced by sendWindow().
void WPParser::parse | ( | WPXDocumentInterface * | documentInterface | ) | [virtual] |
virtual function used to parse the input
Implements MWAWParser.
bool WPParser::readColInfo | ( | int | zone | ) | [protected] |
read the col info zone ?
Referenced by readWindowsZone().
bool WPParser::readFonts | ( | int | nFonts, |
int | type, | ||
std::vector< WPParserInternal::Font > & | fonts | ||
) | [protected] |
reads a list of font (with position)
Referenced by readParagraphData().
bool WPParser::readGraphic | ( | WPParserInternal::ParagraphInfo const & | info | ) | [protected] |
read a graphic
Referenced by sendWindow().
bool WPParser::readLines | ( | WPParserInternal::ParagraphInfo const & | info, |
int | nLines, | ||
std::vector< WPParserInternal::Line > & | lines | ||
) | [protected] |
reads a list of line (with position)
Referenced by readText().
bool WPParser::readPageInfo | ( | int | zone | ) | [protected] |
read the page info zone
Referenced by readWindowsZone().
bool WPParser::readParagraphData | ( | WPParserInternal::ParagraphInfo const & | info, |
bool | hasFonts, | ||
WPParserInternal::ParagraphData & | data | ||
) | [protected] |
reads a paragraph data
Referenced by readGraphic(), readSection(), readTable(), readText(), and readUnknown().
bool WPParser::readParagraphInfo | ( | int | zone | ) | [protected] |
read the paragraph info zone
Referenced by readWindowsZone().
bool WPParser::readPrintInfo | ( | ) | [protected] |
read the print info zone
Referenced by createZones().
bool WPParser::readSection | ( | WPParserInternal::ParagraphInfo const & | info, |
bool | mainBlock | ||
) | [protected] |
read a section
Referenced by sendWindow().
bool WPParser::readTable | ( | WPParserInternal::ParagraphInfo const & | info | ) | [protected] |
read a table
Referenced by sendWindow().
bool WPParser::readText | ( | WPParserInternal::ParagraphInfo const & | info | ) | [protected] |
read a text
Referenced by sendWindow().
bool WPParser::readUnknown | ( | WPParserInternal::ParagraphInfo const & | info | ) | [protected] |
read a unknown section
Referenced by sendWindow().
bool WPParser::readWindowsInfo | ( | int | zone | ) | [protected] |
read the main info for zone ( 0: MAIN ZONE, 1 : HEADER, 2 : FOOTER )
Referenced by checkHeader(), and createZones().
bool WPParser::readWindowsZone | ( | int | zone | ) | [protected] |
read the page info zone
Referenced by createZones().
bool WPParser::sendWindow | ( | int | zone, |
Vec2i | limits = Vec2i(-1,-1) |
||
) | [protected] |
send a zone ( 0: MAIN ZONE, 1 : HEADER, 2 : FOOTER )
Referenced by parse().
friend class WPParserInternal::SubDocument [friend] |
shared_ptr<WPParserInternal::State> WPParser::m_state [protected] |
the state
Referenced by checkHeader(), createDocument(), createZones(), findSection(), getTextHeight(), init(), newPage(), readColInfo(), readPageInfo(), readParagraphInfo(), readWindowsInfo(), readWindowsZone(), and sendWindow().