ScriptWriterParser.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 Script Writer 1.3 text document
*
*/
#ifndef SCRIPT_WRITER_PARSER
# define SCRIPT_WRITER_PARSER
#include <vector>
#include "MWAWDebug.hxx"
#include "MWAWEntry.hxx"
#include "MWAWInputStream.hxx"
#include "MWAWParser.hxx"
namespace ScriptWriterParserInternal
{
struct Frame;
struct HFData;
struct Page;
struct State;
class SubDocument;
}
class ScriptWriterParser final : public MWAWTextParser
{
friend class ScriptWriterParserInternal::SubDocument;
public:
ScriptWriterParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
~ScriptWriterParser() 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();
bool readDocument();
bool readPrintInfo();
bool readFrame(ScriptWriterParserInternal::Frame &frame);
bool readCharStyle(ScriptWriterParserInternal::Page &page, int column);
bool readPage(ScriptWriterParserInternal::Page &page);
bool readTextZone();
bool readHFStyle(std::map<int,MWAWFont> &posToFontMap);
bool readPicture(MWAWEntry &entry);
bool readFont(MWAWFont &font);
//
// send data
//
bool send(ScriptWriterParserInternal::HFData const &hf);
bool sendText(ScriptWriterParserInternal::Frame const &frame);
bool sendMainZone();
bool sendText(ScriptWriterParserInternal::Page const &page);
protected:
//
// data
//
std::shared_ptr<ScriptWriterParserInternal::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
MWAWTextParser::MWAWTextParser
MWAWTextParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor (protected)
Definition MWAWParser.hxx:307
ScriptWriterParserInternal::SubDocument
Internal: the subdocument of a ScriptWriterParser.
Definition ScriptWriterParser.cxx:255
ScriptWriterParser::createZones
bool createZones()
finds the different objects zones
Definition ScriptWriterParser.cxx:402
ScriptWriterParser::m_state
std::shared_ptr< ScriptWriterParserInternal::State > m_state
the state
Definition ScriptWriterParser.hxx:127
ScriptWriterParser::parse
void parse(librevenge::RVNGTextInterface *documentInterface) final
virtual function used to parse the input
Definition ScriptWriterParser.cxx:328
ScriptWriterParser::readPage
bool readPage(ScriptWriterParserInternal::Page &page)
try to read page
Definition ScriptWriterParser.cxx:1005
ScriptWriterParser::~ScriptWriterParser
~ScriptWriterParser() final
destructor
Definition ScriptWriterParser.cxx:321
ScriptWriterParser::readFrame
bool readFrame(ScriptWriterParserInternal::Frame &frame)
try to read a frame entry
Definition ScriptWriterParser.cxx:724
ScriptWriterParser::readFont
bool readFont(MWAWFont &font)
try to read a font
Definition ScriptWriterParser.cxx:840
ScriptWriterParser::sendMainZone
bool sendMainZone()
try to send the main text zone
Definition ScriptWriterParser.cxx:1315
ScriptWriterParser::sendText
bool sendText(ScriptWriterParserInternal::Frame const &frame)
try to send a frame text
Definition ScriptWriterParser.cxx:1467
ScriptWriterParser::createDocument
void createDocument(librevenge::RVNGTextInterface *documentInterface)
creates the listener which will be associated to the document
Definition ScriptWriterParser.cxx:358
ScriptWriterParser::send
bool send(ScriptWriterParserInternal::HFData const &hf)
try to send a header/footer
Definition ScriptWriterParser.cxx:1346
ScriptWriterParser::readPrintInfo
bool readPrintInfo()
try to read the print information
Definition ScriptWriterParser.cxx:1195
ScriptWriterParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition ScriptWriterParser.cxx:1261
ScriptWriterParser::readTextZone
bool readTextZone()
try to read the main text zone
Definition ScriptWriterParser.cxx:1151
ScriptWriterParser::readHFStyle
bool readHFStyle(std::map< int, MWAWFont > &posToFontMap)
try to read the hf style
Definition ScriptWriterParser.cxx:928
ScriptWriterParser::ScriptWriterParser
ScriptWriterParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition ScriptWriterParser.cxx:309
ScriptWriterParser::readPicture
bool readPicture(MWAWEntry &entry)
try to read a picture entry
Definition ScriptWriterParser.cxx:1132
ScriptWriterParser::readDocument
bool readDocument()
try to read the document header
Definition ScriptWriterParser.cxx:446
ScriptWriterParser::readCharStyle
bool readCharStyle(ScriptWriterParserInternal::Page &page, int column)
try to read the character style
Definition ScriptWriterParser.cxx:868
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
ScriptWriterParserInternal
Internal: the structures of a ScriptWriterParser.
Definition ScriptWriterParser.cxx:63
librevenge
Definition MWAWDocument.hxx:57
ScriptWriterParserInternal::Frame
Internal: the frame of a ScriptWriterParser.
Definition ScriptWriterParser.cxx:120
ScriptWriterParserInternal::HFData
Internal: the data of a header footer of a ScriptWriterParser.
Definition ScriptWriterParser.cxx:155
ScriptWriterParserInternal::Page
Internal: the page of a ScriptWriterParser.
Definition ScriptWriterParser.cxx:137
ScriptWriterParserInternal::State
Internal: the state of a ScriptWriterParser.
Definition ScriptWriterParser.cxx:202