SpringBoardParser.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 SPRINGBOARD_PARSER
# define SPRINGBOARD_PARSER
#include <string>
#include <utility>
#include <vector>
#include <librevenge/librevenge.h>
#include "MWAWDebug.hxx"
#include "MWAWInputStream.hxx"
#include "MWAWParser.hxx"
namespace SpringBoardParserInternal
{
struct State;
class SubDocument;
}
class SpringBoardParser final : public MWAWGraphicParser
{
friend class SpringBoardParserInternal::SubDocument;
public:
SpringBoardParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
~SpringBoardParser() final;
bool checkHeader(MWAWHeader *header, bool strict=false) final;
// the main parse function
void parse(librevenge::RVNGDrawingInterface *documentInterface) final;
protected:
void createDocument(librevenge::RVNGDrawingInterface *documentInterface);
bool parsePageNumbering(MWAWEntry const &entry);
bool parseDataList(int id, MWAWEntry const &entry);
bool parseLastZone(int id, MWAWEntry const &entry);
bool parseFrames(int page, long pos);
// data
bool parseData(int id, MWAWEntry const &entry, MWAWVec2i const &indices);
bool parseParagraphStyle(MWAWEntry const &entry, MWAWVec2i const &indices);
bool parseShape(long pos, std::pair<int,int> const &pageId);
protected:
bool createZones();
// Intermediate level
bool readFont(MWAWFont &font, int szFieldSize);
bool sendHeaderFooter(int hfId);
bool sendFrame(std::pair<int,int> const &pageId);
bool sendTextShape(std::pair<int,int> const &pageId, int minParagraph=0, int maxParagraph=-1);
bool sendLinkShape(std::pair<int,int> const &linkId, bool isTop);
//
// low level
//
bool isPositionValid(long pos) const;
bool isEntryValid(MWAWEntry const &entry) const;
//
// data
//
std::shared_ptr<SpringBoardParserInternal::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
MWAWFont
Class to store font.
Definition MWAWFont.hxx:44
MWAWGraphicParser::MWAWGraphicParser
MWAWGraphicParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor (protected)
Definition MWAWParser.hxx:259
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition MWAWHeader.hxx:57
SpringBoardParserInternal::SubDocument
Internal: the subdocument of a SpringBoardParser.
Definition SpringBoardParser.cxx:236
SpringBoardParser::SpringBoardParser
SpringBoardParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition SpringBoardParser.cxx:338
SpringBoardParser::m_state
std::shared_ptr< SpringBoardParserInternal::State > m_state
the state
Definition SpringBoardParser.hxx:130
SpringBoardParser::sendHeaderFooter
bool sendHeaderFooter(int hfId)
try to send a header/footer text
Definition SpringBoardParser.cxx:1695
SpringBoardParser::parse
void parse(librevenge::RVNGDrawingInterface *documentInterface) final
virtual function used to parse the input
Definition SpringBoardParser.cxx:380
SpringBoardParser::createZones
bool createZones()
finds the different objects zones
Definition SpringBoardParser.cxx:481
SpringBoardParser::readFont
bool readFont(MWAWFont &font, int szFieldSize)
try to read a font
Definition SpringBoardParser.cxx:588
SpringBoardParser::sendLinkShape
bool sendLinkShape(std::pair< int, int > const &linkId, bool isTop)
try to send a link text
Definition SpringBoardParser.cxx:1561
SpringBoardParser::parseDataList
bool parseDataList(int id, MWAWEntry const &entry)
try to parse a list of data
Definition SpringBoardParser.cxx:702
SpringBoardParser::parseLastZone
bool parseLastZone(int id, MWAWEntry const &entry)
try to parse a second entry zones
Definition SpringBoardParser.cxx:1087
SpringBoardParser::parseShape
bool parseShape(long pos, std::pair< int, int > const &pageId)
try to parse a shape
Definition SpringBoardParser.cxx:1200
SpringBoardParser::~SpringBoardParser
~SpringBoardParser() final
destructor
Definition SpringBoardParser.cxx:347
SpringBoardParser::parseParagraphStyle
bool parseParagraphStyle(MWAWEntry const &entry, MWAWVec2i const &indices)
try to parse a list of paragraph style: zone8
Definition SpringBoardParser.cxx:972
SpringBoardParser::sendFrame
bool sendFrame(std::pair< int, int > const &pageId)
try to send a frame (with a shape)
Definition SpringBoardParser.cxx:1447
SpringBoardParser::parseData
bool parseData(int id, MWAWEntry const &entry, MWAWVec2i const &indices)
try to parse some data
Definition SpringBoardParser.cxx:766
SpringBoardParser::parseFrames
bool parseFrames(int page, long pos)
try to parse a list of frames corresponding to a page
Definition SpringBoardParser.cxx:1330
SpringBoardParser::isPositionValid
bool isPositionValid(long pos) const
returns true if the position is a valid file positions, ie.
Definition SpringBoardParser.cxx:351
SpringBoardParser::createDocument
void createDocument(librevenge::RVNGDrawingInterface *documentInterface)
creates the listener which will be associated to the document
Definition SpringBoardParser.cxx:420
SpringBoardParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition SpringBoardParser.cxx:1776
SpringBoardParser::parsePageNumbering
bool parsePageNumbering(MWAWEntry const &entry)
try to parse the page numbering zone
Definition SpringBoardParser.cxx:633
SpringBoardParser::sendTextShape
bool sendTextShape(std::pair< int, int > const &pageId, int minParagraph=0, int maxParagraph=-1)
try to send a shape text
Definition SpringBoardParser.cxx:1598
SpringBoardParser::isEntryValid
bool isEntryValid(MWAWEntry const &entry) const
returns true if the zone is a valid zone positions, ie.
Definition SpringBoardParser.cxx:359
MWAWVec2i
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition libmwaw_internal.hxx:838
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
SpringBoardParserInternal
Internal: the structures of a SpringBoardParser.
Definition SpringBoardParser.cxx:58
librevenge
Definition MWAWDocument.hxx:57
SpringBoardParserInternal::State
Internal: the state of a SpringBoardParser.
Definition SpringBoardParser.cxx:178