DMParser.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 DM_PARSER
# define DM_PARSER
#include <string>
#include <vector>
#include <libwpd/libwpd.h>
#include "MWAWDebug.hxx"
#include "MWAWInputStream.hxx"
#include "MWAWParser.hxx"
namespace DMParserInternal
{
struct State;
}
class DMText;
class DMParser : public MWAWParser
{
friend class DMText;
public:
DMParser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header);
virtual ~DMParser();
bool checkHeader(MWAWHeader *header, bool strict=false);
// the main parse function
void parse(WPXDocumentInterface *documentInterface);
protected:
void init();
void createDocument(WPXDocumentInterface *documentInterface);
Vec2f getPageLeftTop() const;
void newPage(int number);
protected:
bool createZones();
bool readPictInfo(MWAWEntry const &entry);
bool readSTwD(MWAWEntry const &entry);
bool readXtr2(MWAWEntry const &entry);
// Intermediate level
bool sendPicture(int zId, int lId, double lineW);
void flushExtra();
MWAWInputStreamPtr rsrcInput();
libmwaw::DebugFile &rsrcAscii();
//
// data
//
shared_ptr<DMParserInternal::State> m_state;
shared_ptr<DMText> m_textParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
DMParser::readXtr2
bool readXtr2(MWAWEntry const &entry)
try to read an unknown zone ( resource xtr2 )
Definition: DMParser.cxx:641
MWAWHeader
a function used by MWAWDocument to store the version of document and the input
Definition: MWAWHeader.hxx:47
MWAWParser.hxx
DMParser::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: DMParser.cxx:402
DMParser
the main class to read a DocMake file
Definition: DMParser.hxx:56
libmwaw::DebugFile
an interface used to insert comment in a binary file, written in ascii form (if debug_with_files is n...
Definition: MWAWDebug.hxx:67
DMParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: DMParser.cxx:677
DMParser::newPage
void newPage(int number)
adds a new page
Definition: DMParser.cxx:233
DMParser::rsrcAscii
libmwaw::DebugFile & rsrcAscii()
a DebugFile used to write what we recognize when we parse the document in rsrc
Definition: DMParser.cxx:225
MWAWRSRCParserPtr
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:340
DMParser::createDocument
void createDocument(WPXDocumentInterface *documentInterface)
creates the listener which will be associated to the document
Definition: DMParser.cxx:280
DMParser::readSTwD
bool readSTwD(MWAWEntry const &entry)
try to read an unknown zone ( resource sTwD )
Definition: DMParser.cxx:604
DMParser::init
void init()
inits all internal variables
Definition: DMParser.cxx:211
MWAWInputStreamPtr
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:336
DMParser::m_state
shared_ptr< DMParserInternal::State > m_state
the state
Definition: DMParser.hxx:111
DMParser::sendPicture
bool sendPicture(int zId, int lId, double lineW)
try to send a picture knowing zId and local id
Definition: DMParser.cxx:419
MWAWInputStream.hxx
MWAWDebug.hxx
DMParser::~DMParser
virtual ~DMParser()
destructor
Definition: DMParser.cxx:207
DMParser::DMParser
DMParser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
constructor
Definition: DMParser.cxx:201
DMParser::createZones
bool createZones()
finds the different objects zones
Definition: DMParser.cxx:308
DMParser::m_textParser
shared_ptr< DMText > m_textParser
the text parser
Definition: DMParser.hxx:114
DMParser::readPictInfo
bool readPictInfo(MWAWEntry const &entry)
try to read a pict info zone ? ( resource pInf )
Definition: DMParser.cxx:478
MWAWParser
virtual class which defines the ancestor of all main zone parser
Definition: MWAWParser.hxx:87
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
Vec2< float >
DMParser::rsrcInput
MWAWInputStreamPtr rsrcInput()
return the input input
Definition: DMParser.cxx:220
DMParser::getPageLeftTop
Vec2f getPageLeftTop() const
returns the page left top point ( in inches)
DMParser::parse
void parse(WPXDocumentInterface *documentInterface)
virtual function used to parse the input
Definition: DMParser.cxx:249
DMText
the main class to read the text part of DocMaker file
Definition: DMText.hxx:59