PowerPoint3Parser.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 POWER_POINT3_PARSER
# define POWER_POINT3_PARSER
#include <map>
#include <set>
#include <vector>
#include "MWAWDebug.hxx"
#include "MWAWInputStream.hxx"
#include "MWAWParser.hxx"
namespace PowerPoint3ParserInternal
{
struct FieldParser;
struct Frame;
struct Polygon;
struct Ruler;
struct Slide;
struct SlideContent;
struct SlideFormat;
struct State;
struct TextZone;
class SubDocument;
}
class PowerPoint3Parser final : public MWAWPresentationParser
{
friend class PowerPoint3ParserInternal::SubDocument;
public:
PowerPoint3Parser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
~PowerPoint3Parser() final;
bool checkHeader(MWAWHeader *header, bool strict=false) final;
// the main parse function
void parse(librevenge::RVNGPresentationInterface *documentInterface) final;
protected:
void createDocument(librevenge::RVNGPresentationInterface *documentInterface);
bool createZones();
void sendSlides();
bool readListZones(int &docInfoId);
bool readStructList(MWAWEntry const &entry, PowerPoint3ParserInternal::FieldParser &parser);
//
// internal level
//
bool readColors(MWAWEntry const &entry);
bool readColorZone(MWAWEntry const &entry);
bool readDocInfo(MWAWEntry const &entry);
bool readDocRoot(MWAWEntry const &entry);
bool readFont(MWAWFont &font, int schemeId);
bool readFontNamesList(std::map<int,int> const &fIdtoZIdMap);
bool readFontName(MWAWEntry const &entry, int id);
bool readFramesList(MWAWEntry const &entry, PowerPoint3ParserInternal::SlideContent &content);
bool readParagraph(MWAWParagraph &para, PowerPoint3ParserInternal::Ruler const &ruler, int schemeId);
bool readPictureDefinition(MWAWEntry const &entry, int id);
bool readPictureContent(MWAWEntry const &entry, MWAWEmbeddedObject &pict);
bool readPictureMain(MWAWEntry const &entry);
bool readPicturesList(std::map<int,int> const &pIdtoZIdMap);
bool readPrintInfo(MWAWEntry const &entry);
bool readRuler(MWAWEntry const &entry, int id);
bool readScheme(MWAWEntry const &entry, int id);
bool readSlide(MWAWEntry const &entry, PowerPoint3ParserInternal::Slide &slide, int zId);
bool readSlideContent(MWAWEntry const &entry, PowerPoint3ParserInternal::SlideContent &slide);
bool readSlideFormats(MWAWEntry const &entry, std::vector<PowerPoint3ParserInternal::SlideFormat> &formatList);
bool readSlidePolygons(MWAWEntry const &entry, std::vector<PowerPoint3ParserInternal::Polygon> &polyList);
bool readSlideTransition(MWAWEntry const &entry);
bool readSlidesList(MWAWEntry const &entry);
bool readTextZone(MWAWEntry const &entry, PowerPoint3ParserInternal::SlideContent &content);
//
// send data
//
bool sendSlide(PowerPoint3ParserInternal::SlideContent const &slide, bool master);
bool sendFrame(PowerPoint3ParserInternal::Frame const &frame, PowerPoint3ParserInternal::SlideContent const &content, bool master, std::set<int> &seen);
bool sendText(PowerPoint3ParserInternal::SlideContent const &slide, int tId, bool placeHolder, bool master);
//
// low level
//
bool readZone9(MWAWEntry const &entry);
bool readZone10(MWAWEntry const &entry);
bool getColor(int colorId, int schemeId, MWAWColor &color) const;
void checkForUnparsedZones();
protected:
//
// data
//
std::shared_ptr<PowerPoint3ParserInternal::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
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
MWAWPresentationParser::MWAWPresentationParser
MWAWPresentationParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor (protected)
Definition MWAWParser.hxx:275
PowerPoint3ParserInternal::SubDocument
Internal: the subdocument of a PowerPointParser.
Definition PowerPoint3Parser.cxx:708
PowerPoint3Parser::readFontNamesList
bool readFontNamesList(std::map< int, int > const &fIdtoZIdMap)
try to read a font names list
Definition PowerPoint3Parser.cxx:2889
PowerPoint3Parser::readScheme
bool readScheme(MWAWEntry const &entry, int id)
try to read a scheme
Definition PowerPoint3Parser.cxx:1429
PowerPoint3Parser::readSlidePolygons
bool readSlidePolygons(MWAWEntry const &entry, std::vector< PowerPoint3ParserInternal::Polygon > &polyList)
try to read the third child of slide content
Definition PowerPoint3Parser.cxx:1842
PowerPoint3Parser::createDocument
void createDocument(librevenge::RVNGPresentationInterface *documentInterface)
creates the listener which will be associated to the document
Definition PowerPoint3Parser.cxx:848
PowerPoint3Parser::checkForUnparsedZones
void checkForUnparsedZones()
check for unparsed zone
Definition PowerPoint3Parser.cxx:1136
PowerPoint3Parser::sendSlides
void sendSlides()
try to send all slides
Definition PowerPoint3Parser.cxx:3603
PowerPoint3Parser::readSlideFormats
bool readSlideFormats(MWAWEntry const &entry, std::vector< PowerPoint3ParserInternal::SlideFormat > &formatList)
try to read the second child of slide content which contains some shadow offset...
Definition PowerPoint3Parser.cxx:1783
PowerPoint3Parser::sendText
bool sendText(PowerPoint3ParserInternal::SlideContent const &slide, int tId, bool placeHolder, bool master)
try to send a text zone
Definition PowerPoint3Parser.cxx:3464
PowerPoint3Parser::readPictureDefinition
bool readPictureDefinition(MWAWEntry const &entry, int id)
try to read the picture definition
Definition PowerPoint3Parser.cxx:2644
PowerPoint3Parser::readListZones
bool readListZones(int &docInfoId)
try to read the list of zones
Definition PowerPoint3Parser.cxx:1048
PowerPoint3Parser::readPrintInfo
bool readPrintInfo(MWAWEntry const &entry)
try to read a print info zone
Definition PowerPoint3Parser.cxx:1336
PowerPoint3Parser::readDocInfo
bool readDocInfo(MWAWEntry const &entry)
try to read the document info zone
Definition PowerPoint3Parser.cxx:1158
PowerPoint3Parser::readSlideContent
bool readSlideContent(MWAWEntry const &entry, PowerPoint3ParserInternal::SlideContent &slide)
try to read the second/third child of slideMain: main, master ?
Definition PowerPoint3Parser.cxx:1675
PowerPoint3Parser::readSlidesList
bool readSlidesList(MWAWEntry const &entry)
try to read the first child of docRoot
Definition PowerPoint3Parser.cxx:1484
PowerPoint3Parser::sendSlide
bool sendSlide(PowerPoint3ParserInternal::SlideContent const &slide, bool master)
try to send a slide
Definition PowerPoint3Parser.cxx:3654
PowerPoint3Parser::readFont
bool readFont(MWAWFont &font, int schemeId)
try to read a font
Definition PowerPoint3Parser.cxx:2847
PowerPoint3Parser::readFontName
bool readFontName(MWAWEntry const &entry, int id)
try to read a font name : 11th zone
Definition PowerPoint3Parser.cxx:2899
PowerPoint3Parser::readPictureMain
bool readPictureMain(MWAWEntry const &entry)
try to read the 5th zone
Definition PowerPoint3Parser.cxx:3190
PowerPoint3Parser::readPicturesList
bool readPicturesList(std::map< int, int > const &pIdtoZIdMap)
try to read a picture list
Definition PowerPoint3Parser.cxx:2634
PowerPoint3Parser::readColors
bool readColors(MWAWEntry const &entry)
try to read a color list
Definition PowerPoint3Parser.cxx:3234
PowerPoint3Parser::readStructList
bool readStructList(MWAWEntry const &entry, PowerPoint3ParserInternal::FieldParser &parser)
try to read a list of structure
Definition PowerPoint3Parser.cxx:2568
PowerPoint3Parser::~PowerPoint3Parser
~PowerPoint3Parser() final
destructor
Definition PowerPoint3Parser.cxx:794
PowerPoint3Parser::readSlideTransition
bool readSlideTransition(MWAWEntry const &entry)
try to read the first child of slideMain
Definition PowerPoint3Parser.cxx:1615
PowerPoint3Parser::PowerPoint3Parser
PowerPoint3Parser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition PowerPoint3Parser.cxx:787
PowerPoint3Parser::createZones
bool createZones()
finds the different zones
Definition PowerPoint3Parser.cxx:890
PowerPoint3Parser::readPictureContent
bool readPictureContent(MWAWEntry const &entry, MWAWEmbeddedObject &pict)
try to read the first child of the picture
Definition PowerPoint3Parser.cxx:2749
PowerPoint3Parser::readZone9
bool readZone9(MWAWEntry const &entry)
try to read the 9th zone
Definition PowerPoint3Parser.cxx:3352
PowerPoint3Parser::parse
void parse(librevenge::RVNGPresentationInterface *documentInterface) final
virtual function used to parse the input
Definition PowerPoint3Parser.cxx:818
PowerPoint3Parser::readParagraph
bool readParagraph(MWAWParagraph &para, PowerPoint3ParserInternal::Ruler const &ruler, int schemeId)
try to read a paragraph
Definition PowerPoint3Parser.cxx:2972
PowerPoint3Parser::sendFrame
bool sendFrame(PowerPoint3ParserInternal::Frame const &frame, PowerPoint3ParserInternal::SlideContent const &content, bool master, std::set< int > &seen)
try to send a frame zone
Definition PowerPoint3Parser.cxx:3672
PowerPoint3Parser::readFramesList
bool readFramesList(MWAWEntry const &entry, PowerPoint3ParserInternal::SlideContent &content)
try to read a frame zone in a page
Definition PowerPoint3Parser.cxx:1901
PowerPoint3Parser::readTextZone
bool readTextZone(MWAWEntry const &entry, PowerPoint3ParserInternal::SlideContent &content)
try to read a text zone
Definition PowerPoint3Parser.cxx:2350
PowerPoint3Parser::readZone10
bool readZone10(MWAWEntry const &entry)
try to read the 10th zone
Definition PowerPoint3Parser.cxx:3395
PowerPoint3Parser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition PowerPoint3Parser.cxx:3837
PowerPoint3Parser::readRuler
bool readRuler(MWAWEntry const &entry, int id)
try to read some ruler
Definition PowerPoint3Parser.cxx:3124
PowerPoint3Parser::getColor
bool getColor(int colorId, int schemeId, MWAWColor &color) const
try to return a color corresponding to a scheme and color
Definition PowerPoint3Parser.cxx:798
PowerPoint3Parser::readDocRoot
bool readDocRoot(MWAWEntry const &entry)
try to read the main child of doc info
Definition PowerPoint3Parser.cxx:1366
PowerPoint3Parser::readSlide
bool readSlide(MWAWEntry const &entry, PowerPoint3ParserInternal::Slide &slide, int zId)
try to read a slide main zone
Definition PowerPoint3Parser.cxx:1551
PowerPoint3Parser::m_state
std::shared_ptr< PowerPoint3ParserInternal::State > m_state
the state
Definition PowerPoint3Parser.hxx:172
PowerPoint3Parser::readColorZone
bool readColorZone(MWAWEntry const &entry)
try to read a color zone, probably used to define the menu, ...: the 8th zone
Definition PowerPoint3Parser.cxx:3288
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
PowerPoint3ParserInternal
Internal: the structures of a PowerPoint3Parser.
Definition PowerPoint3Parser.cxx:59
librevenge
Definition MWAWDocument.hxx:57
MWAWColor
the class to store a color
Definition libmwaw_internal.hxx:192
MWAWEmbeddedObject
small class use to define a embedded object
Definition libmwaw_internal.hxx:467
PowerPoint3ParserInternal::FieldParser
Internal: virtual field parser of a PowerPoint3Parser.
Definition PowerPoint3Parser.cxx:103
PowerPoint3ParserInternal::Frame
Internal: a frame of a PowerPoint3Parser.
Definition PowerPoint3Parser.cxx:261
PowerPoint3ParserInternal::Polygon
Internal: a polygon of a PowerPoint3Parser.
Definition PowerPoint3Parser.cxx:310
PowerPoint3ParserInternal::Ruler
Internal: a ruler.
Definition PowerPoint3Parser.cxx:226
PowerPoint3ParserInternal::SlideContent
Internal: a slide of a PowerPoint3Parser.
Definition PowerPoint3Parser.cxx:408
PowerPoint3ParserInternal::SlideFormat
Internal: the third zone defining a slide of a PowerPoint3Parser.
Definition PowerPoint3Parser.cxx:354
PowerPoint3ParserInternal::Slide
Internal: a slide of a PowerPoint3Parser.
Definition PowerPoint3Parser.cxx:447
PowerPoint3ParserInternal::State
Internal: the state of a PowerPoint3Parser.
Definition PowerPoint3Parser.cxx:459
PowerPoint3ParserInternal::TextZone
Internal: a text zone of a PowerPoint3Parser.
Definition PowerPoint3Parser.cxx:371