ScoopParser.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 SCOOP_PARSER
# define SCOOP_PARSER
#include <string>
#include <vector>
#include <librevenge/librevenge.h>
#include "MWAWDebug.hxx"
#include "MWAWInputStream.hxx"
#include "MWAWParser.hxx"
namespace ScoopParserInternal
{
struct FrameZone;
struct Paragraph;
struct Shape;
struct TextZone;
struct State;
class SubDocument;
}
class ScoopParser final : public MWAWGraphicParser
{
friend class ScoopParserInternal::SubDocument;
public:
ScoopParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
~ScoopParser() 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);
protected:
bool createZones();
// Intermediate level
bool readPrintInfo();
bool readHeader();
bool readTextZone(ScoopParserInternal::TextZone &tZone);
bool readTextZoneParagraph(ScoopParserInternal::Paragraph &para, int id);
bool readFont(MWAWFont &font);
bool readParagraph(MWAWParagraph &para, bool define=false);
bool readText(MWAWEntry &entry, std::string const &what);
bool readShapesList(std::vector<ScoopParserInternal::Shape> &shapes, int depth=0);
bool readShape(ScoopParserInternal::Shape &shape, int id, int depth=0);
bool readBitmap(MWAWEntry const &entry, MWAWEmbeddedObject &object, bool compressed=true);
//
// low level
//
//
// data
//
bool send(ScoopParserInternal::Shape const &shape, MWAWVec2i const &decal);
bool sendText(long tZoneId, int subZone);
bool sendText(ScoopParserInternal::Paragraph const &paragraph);
std::shared_ptr<ScoopParserInternal::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
MWAWParagraph
class to store the paragraph properties
Definition MWAWParagraph.hxx:85
ScoopParserInternal::SubDocument
Internal: the subdocument of a ScoopParser.
Definition ScoopParser.cxx:296
ScoopParser::readPrintInfo
bool readPrintInfo()
try to read the print info zone
Definition ScoopParser.cxx:2076
ScoopParser::readFont
bool readFont(MWAWFont &font)
try to read a font style
Definition ScoopParser.cxx:1251
ScoopParser::m_state
std::shared_ptr< ScoopParserInternal::State > m_state
the state
Definition ScoopParser.hxx:128
ScoopParser::readHeader
bool readHeader()
try to the header zone
Definition ScoopParser.cxx:1962
ScoopParser::readTextZoneParagraph
bool readTextZoneParagraph(ScoopParserInternal::Paragraph &para, int id)
try to read a frame paragraph
Definition ScoopParser.cxx:1062
ScoopParser::readBitmap
bool readBitmap(MWAWEntry const &entry, MWAWEmbeddedObject &object, bool compressed=true)
try to read a bitmap
Definition ScoopParser.cxx:1845
ScoopParser::readShape
bool readShape(ScoopParserInternal::Shape &shape, int id, int depth=0)
try to read a shape
Definition ScoopParser.cxx:1566
ScoopParser::readShapesList
bool readShapesList(std::vector< ScoopParserInternal::Shape > &shapes, int depth=0)
try to read a list of shape
Definition ScoopParser.cxx:1525
ScoopParser::createDocument
void createDocument(librevenge::RVNGDrawingInterface *documentInterface)
creates the listener which will be associated to the document
Definition ScoopParser.cxx:427
ScoopParser::readTextZone
bool readTextZone(ScoopParserInternal::TextZone &tZone)
try to read the data associated to a text zone: its name, its content, the list of shape which displa...
Definition ScoopParser.cxx:844
ScoopParser::send
bool send(ScoopParserInternal::Shape const &shape, MWAWVec2i const &decal)
try to send a shape
Definition ScoopParser.cxx:503
ScoopParser::readText
bool readText(MWAWEntry &entry, std::string const &what)
try to read a text zone
Definition ScoopParser.cxx:1497
ScoopParser::ScoopParser
ScoopParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition ScoopParser.cxx:353
ScoopParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition ScoopParser.cxx:1926
ScoopParser::readParagraph
bool readParagraph(MWAWParagraph &para, bool define=false)
try to read a paragraph style
Definition ScoopParser.cxx:1296
ScoopParser::~ScoopParser
~ScoopParser() final
destructor
Definition ScoopParser.cxx:362
ScoopParser::createZones
bool createZones()
finds the different objects zones
Definition ScoopParser.cxx:469
ScoopParser::sendText
bool sendText(long tZoneId, int subZone)
try to send the text of a text zone
Definition ScoopParser.cxx:749
ScoopParser::parse
void parse(librevenge::RVNGDrawingInterface *documentInterface) final
virtual function used to parse the input
Definition ScoopParser.cxx:369
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
ScoopParserInternal
Internal: the structures of a ScoopParser.
Definition ScoopParser.cxx:57
librevenge
Definition MWAWDocument.hxx:57
MWAWEmbeddedObject
small class use to define a embedded object
Definition libmwaw_internal.hxx:467
ScoopParserInternal::Paragraph
Internal: a paragraph of a ScoopParser.
Definition ScoopParser.cxx:139
ScoopParserInternal::Shape
Internal: the shape of a ScoopParser.
Definition ScoopParser.cxx:62
ScoopParserInternal::State
Internal: the state of a ScoopParser.
Definition ScoopParser.cxx:218
ScoopParserInternal::TextZone
Internal: a text zone of a ScoopParser.
Definition ScoopParser.cxx:193