WordMakerParser.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.
*/
/*
* Parser to convert some WordMaker 1.0 text document
*
*/
#ifndef WORD_MAKER_PARSER
# define WORD_MAKER_PARSER
#include <vector>
#include "MWAWDebug.hxx"
#include "MWAWEntry.hxx"
#include "MWAWInputStream.hxx"
#include "MWAWParser.hxx"
namespace WordMakerParserInternal
{
struct State;
struct Zone;
class SubDocument;
}
class WordMakerParser final : public MWAWTextParser
{
friend class WordMakerParserInternal::SubDocument;
public:
WordMakerParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
~WordMakerParser() final;
bool checkHeader(MWAWHeader *header, bool strict=false) final;
// the main parse function
void parse(librevenge::RVNGTextInterface *documentInterface) final;
protected:
void createDocument(librevenge::RVNGTextInterface *documentInterface);
bool createZones();
void newPage();
bool sendZone(WordMakerParserInternal::Zone const &zone);
bool sendPicture(MWAWEntry const &entry);
protected:
//
// data
//
bool readFont(long len, MWAWFont &font);
bool readFontNames(long len);
bool readParagraph(long len, MWAWParagraph &para, MWAWFont &font);
bool readPicture(long len, MWAWEmbeddedObject &object, MWAWBox2f &bdbox, int &page);
bool readTabulations(long len, MWAWParagraph &para);
bool readPrintInfo(long len);
std::shared_ptr<WordMakerParserInternal::State> m_state;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
MWAWEntry.hxx
MWAWInputStream.hxx
MWAWParser.hxx
MWAWEntry
basic class to store an entry in a file This contained :
Definition MWAWEntry.hxx:47
MWAWFont
Class to store font.
Definition MWAWFont.hxx:44
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition MWAWHeader.hxx:57
MWAWParagraph
class to store the paragraph properties
Definition MWAWParagraph.hxx:85
MWAWTextParser::MWAWTextParser
MWAWTextParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor (protected)
Definition MWAWParser.hxx:307
WordMakerParserInternal::SubDocument
Internal: the subdocument of a WordMakerParser.
Definition WordMakerParser.cxx:130
WordMakerParser::sendPicture
bool sendPicture(MWAWEntry const &entry)
try to send a picture
Definition WordMakerParser.cxx:831
WordMakerParser::readFont
bool readFont(long len, MWAWFont &font)
try to read a font and its beginning position
Definition WordMakerParser.cxx:600
WordMakerParser::createZones
bool createZones()
finds the different objects zones
Definition WordMakerParser.cxx:282
WordMakerParser::~WordMakerParser
~WordMakerParser() final
destructor
Definition WordMakerParser.cxx:191
WordMakerParser::sendZone
bool sendZone(WordMakerParserInternal::Zone const &zone)
try to send the content of a zone
Definition WordMakerParser.cxx:859
WordMakerParser::WordMakerParser
WordMakerParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition WordMakerParser.cxx:179
WordMakerParser::readParagraph
bool readParagraph(long len, MWAWParagraph &para, MWAWFont &font)
try to read a paragraph (and its default font)
Definition WordMakerParser.cxx:658
WordMakerParser::createDocument
void createDocument(librevenge::RVNGTextInterface *documentInterface)
creates the listener which will be associated to the document
Definition WordMakerParser.cxx:235
WordMakerParser::readFontNames
bool readFontNames(long len)
try to read the fonts names
Definition WordMakerParser.cxx:571
WordMakerParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition WordMakerParser.cxx:481
WordMakerParser::readTabulations
bool readTabulations(long len, MWAWParagraph &para)
try to read a list of tabulations
Definition WordMakerParser.cxx:726
WordMakerParser::m_state
std::shared_ptr< WordMakerParserInternal::State > m_state
the state
Definition WordMakerParser.hxx:110
WordMakerParser::readPrintInfo
bool readPrintInfo(long len)
try to read the printer information
Definition WordMakerParser.cxx:517
WordMakerParser::readPicture
bool readPicture(long len, MWAWEmbeddedObject &object, MWAWBox2f &bdbox, int &page)
try to read a picture (and its size)
Definition WordMakerParser.cxx:775
WordMakerParser::parse
void parse(librevenge::RVNGTextInterface *documentInterface) final
virtual function used to parse the input
Definition WordMakerParser.cxx:198
WordMakerParser::newPage
void newPage()
adds a new page
Definition WordMakerParser.cxx:820
MWAWBox2f
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition libmwaw_internal.hxx:1193
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
WordMakerParserInternal
Internal: the structures of a WordMakerParser.
Definition WordMakerParser.cxx:59
librevenge
Definition MWAWDocument.hxx:57
MWAWEmbeddedObject
small class use to define a embedded object
Definition libmwaw_internal.hxx:467
WordMakerParserInternal::State
Internal: the state of a WordMakerParser.
Definition WordMakerParser.cxx:99
WordMakerParserInternal::Zone
Internal: small structure used to store a zone of a WordMakerParser.
Definition WordMakerParser.cxx:61