MacWrtParser.hxx
Go to the documentation of this file.
/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
/* libmwaw
* Version: MPL 2.0 / LGPLv2+
*
* The contents of this file are subject to the Mozilla Public License Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
* Copyright (C) 2006, 2007 Andrew Ziem
* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
*
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
* in which case the provisions of the LGPLv2+ are applicable
* instead of those above.
*/
#ifndef MAC_WRT_PARSER
# define MAC_WRT_PARSER
#include <vector>
#include "MWAWDebug.hxx"
#include "MWAWInputStream.hxx"
#include "MWAWParser.hxx"
namespace MacWrtParserInternal
{
struct State;
struct Information;
class SubDocument;
}
class MacWrtParser final : public MWAWTextParser
{
friend class MacWrtParserInternal::SubDocument;
public:
MacWrtParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
~MacWrtParser() final;
bool checkHeader(MWAWHeader *header, bool strict=false) final;
// the main parse function
void parse(librevenge::RVNGTextInterface *documentInterface) final;
protected:
void init();
void createDocument(librevenge::RVNGTextInterface *documentInterface);
bool sendWindow(int zone);
bool createZones();
bool createZonesV3();
bool readPrintInfo();
bool readWindowsInfo(int wh);
bool readLinesHeight(MWAWEntry const &entry, std::vector<int> &firstParagLine,
std::vector<int> &linesHeight);
bool readInformationsV3(int numInfo,
std::vector<MacWrtParserInternal::Information> &informations);
bool readInformations(MWAWEntry const &entry,
std::vector<MacWrtParserInternal::Information> &informations);
bool readParagraph(MacWrtParserInternal::Information const &info);
bool readGraphic(MacWrtParserInternal::Information const &info);
static bool isMagicPic(librevenge::RVNGBinaryData const &dt);
bool readText(MacWrtParserInternal::Information const &info, std::vector<int> const &lineHeight);
bool readPageBreak(MacWrtParserInternal::Information const &info);
bool checkFreeList();
void newPage(int number);
protected:
//
// data
//
std::shared_ptr<MacWrtParserInternal::State> m_state;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
MWAWInputStream.hxx
MWAWParser.hxx
MWAWEntry
basic class to store an entry in a file This contained :
Definition MWAWEntry.hxx:47
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition MWAWHeader.hxx:57
MWAWTextParser::MWAWTextParser
MWAWTextParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor (protected)
Definition MWAWParser.hxx:307
MacWrtParserInternal::SubDocument
Internal: the subdocument of a MacWrtParser.
Definition MacWrtParser.cxx:313
MacWrtParser::sendWindow
bool sendWindow(int zone)
send a zone ( 0: MAIN ZONE, 1 : HEADER, 2 : FOOTER )
Definition MacWrtParser.cxx:650
MacWrtParser::readLinesHeight
bool readLinesHeight(MWAWEntry const &entry, std::vector< int > &firstParagLine, std::vector< int > &linesHeight)
read the line height
Definition MacWrtParser.cxx:983
MacWrtParser::init
void init()
inits all internal variables
Definition MacWrtParser.cxx:380
MacWrtParser::checkFreeList
bool checkFreeList()
check the free list
Definition MacWrtParser.cxx:1650
MacWrtParser::parse
void parse(librevenge::RVNGTextInterface *documentInterface) final
virtual function used to parse the input
Definition MacWrtParser.cxx:410
MacWrtParser::newPage
void newPage(int number)
adds a new page
Definition MacWrtParser.cxx:394
MacWrtParser::readInformationsV3
bool readInformationsV3(int numInfo, std::vector< MacWrtParserInternal::Information > &informations)
read the information ( version <= 3)
Definition MacWrtParser.cxx:1056
MacWrtParser::readInformations
bool readInformations(MWAWEntry const &entry, std::vector< MacWrtParserInternal::Information > &informations)
read the information
Definition MacWrtParser.cxx:1102
MacWrtParser::readPageBreak
bool readPageBreak(MacWrtParserInternal::Information const &info)
read a page break zone ( version <= 3)
Definition MacWrtParser.cxx:1511
MacWrtParser::m_state
std::shared_ptr< MacWrtParserInternal::State > m_state
the state
Definition MacWrtParser.hxx:132
MacWrtParser::MacWrtParser
MacWrtParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition MacWrtParser.cxx:369
MacWrtParser::isMagicPic
static bool isMagicPic(librevenge::RVNGBinaryData const &dt)
test if a graphic is empty.
Definition MacWrtParser.cxx:1635
MacWrtParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition MacWrtParser.cxx:718
MacWrtParser::readPrintInfo
bool readPrintInfo()
read the print info zone
Definition MacWrtParser.cxx:820
MacWrtParser::createZonesV3
bool createZonesV3()
finds the different objects zones (version <= 3)
Definition MacWrtParser.cxx:548
MacWrtParser::~MacWrtParser
~MacWrtParser() final
destructor
Definition MacWrtParser.cxx:376
MacWrtParser::readParagraph
bool readParagraph(MacWrtParserInternal::Information const &info)
read a paragraph
Definition MacWrtParser.cxx:1420
MacWrtParser::readWindowsInfo
bool readWindowsInfo(int wh)
read the windows zone
Definition MacWrtParser.cxx:873
MacWrtParser::createDocument
void createDocument(librevenge::RVNGTextInterface *documentInterface)
creates the listener which will be associated to the document
Definition MacWrtParser.cxx:450
MacWrtParser::readGraphic
bool readGraphic(MacWrtParserInternal::Information const &info)
read a graphics
Definition MacWrtParser.cxx:1559
MacWrtParser::createZones
bool createZones()
finds the different objects zones
Definition MacWrtParser.cxx:496
MacWrtParser::readText
bool readText(MacWrtParserInternal::Information const &info, std::vector< int > const &lineHeight)
read a text zone
Definition MacWrtParser.cxx:1235
MWAWRSRCParserPtr
std::shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition libmwaw_internal.hxx:561
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition libmwaw_internal.hxx:551
MacWrtParserInternal
Internal: the structures of a MacWrtParser.
Definition MacWrtParser.cxx:58
librevenge
Definition MWAWDocument.hxx:57
MacWrtParserInternal::Information
the paragraph... information
Definition MacWrtParser.cxx:118
MacWrtParserInternal::State
Internal: the state of a MacWrtParser.
Definition MacWrtParser.cxx:283