PowerPoint1Parser.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_POINT1_PARSER
# define POWER_POINT1_PARSER
#include <vector>
#include "MWAWDebug.hxx"
#include "MWAWInputStream.hxx"
#include "MWAWParser.hxx"
namespace PowerPoint1ParserInternal
{
struct Frame;
struct Scheme;
struct Slide;
struct TextZone;
struct State;
class SubDocument;
}
class PowerPoint1Parser final : public MWAWPresentationParser
{
friend class PowerPoint1ParserInternal::SubDocument;
public:
PowerPoint1Parser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
~PowerPoint1Parser() 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);
//
// internal level
//
bool readFramesList(MWAWEntry const &entry, std::vector<PowerPoint1ParserInternal::Frame> &frame, int schemeId);
bool readZoneIdList(MWAWEntry const &entry, int zId);
bool readZoneIdList2(MWAWEntry const &entry, int zId);
bool readColors(MWAWEntry const &entry);
bool readColorZone(MWAWEntry const &entry);
bool readFonts(MWAWEntry const &entry);
bool readFontNames(MWAWEntry const &entry);
bool readPicture(MWAWEntry const &entry, MWAWEmbeddedObject &picture);
bool readPictureDefinition(MWAWEntry const &entry, size_t id);
bool readPrintInfo(MWAWEntry const &entry);
bool readRulers(MWAWEntry const &entry);
bool readRuler(MWAWEntry const &entry, size_t id);
bool readScheme(MWAWEntry const &entry, int id);
bool readSchemes();
bool readTextZone(MWAWEntry const &entry, PowerPoint1ParserInternal::TextZone &zone);
bool readSlide(MWAWEntry const &entry, std::vector<int> &slideIds);
bool readDocInfo(MWAWEntry const &entry);
bool readZone2(MWAWEntry const &entry);
//
// send data
//
bool sendSlide(PowerPoint1ParserInternal::Slide const &slide, bool master);
bool sendFrame(PowerPoint1ParserInternal::Frame const &frame, PowerPoint1ParserInternal::TextZone const &textZone);
bool sendPicture(MWAWPosition const &position, MWAWGraphicStyle const &style, int pId);
bool sendText(PowerPoint1ParserInternal::TextZone const &textZone, MWAWVec2i tId, int rulerId);
bool sendSlideNote(PowerPoint1ParserInternal::Slide const &slide);
//
// low level
//
bool getColor(int colorId, int schemeId, MWAWColor &color) const;
void checkForUnparsedZones();
protected:
//
// data
//
std::shared_ptr<PowerPoint1ParserInternal::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
MWAWGraphicStyle
a structure used to define a picture style
Definition MWAWGraphicStyle.hxx:48
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition MWAWHeader.hxx:57
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document.
Definition MWAWPosition.hxx:48
MWAWPresentationParser::MWAWPresentationParser
MWAWPresentationParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor (protected)
Definition MWAWParser.hxx:275
PowerPoint1ParserInternal::SubDocument
Internal: the subdocument of a PowerPointParser.
Definition PowerPoint1Parser.cxx:300
PowerPoint1Parser::readListZones
bool readListZones(int &docInfoId)
try to read the list of zones
Definition PowerPoint1Parser.cxx:574
PowerPoint1Parser::parse
void parse(librevenge::RVNGPresentationInterface *documentInterface) final
virtual function used to parse the input
Definition PowerPoint1Parser.cxx:416
PowerPoint1Parser::sendPicture
bool sendPicture(MWAWPosition const &position, MWAWGraphicStyle const &style, int pId)
try to send a picture
Definition PowerPoint1Parser.cxx:2314
PowerPoint1Parser::readColors
bool readColors(MWAWEntry const &entry)
try to read a color list
Definition PowerPoint1Parser.cxx:1925
PowerPoint1Parser::readPictureDefinition
bool readPictureDefinition(MWAWEntry const &entry, size_t id)
try to read the picture definition: windows v2
Definition PowerPoint1Parser.cxx:1514
PowerPoint1Parser::readPicture
bool readPicture(MWAWEntry const &entry, MWAWEmbeddedObject &picture)
try to read a picture zone
Definition PowerPoint1Parser.cxx:1579
PowerPoint1Parser::readZoneIdList
bool readZoneIdList(MWAWEntry const &entry, int zId)
try to read a zone id list zone
Definition PowerPoint1Parser.cxx:1608
PowerPoint1Parser::PowerPoint1Parser
PowerPoint1Parser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition PowerPoint1Parser.cxx:385
PowerPoint1Parser::readSchemes
bool readSchemes()
try to read the schemes
Definition PowerPoint1Parser.cxx:2182
PowerPoint1Parser::readColorZone
bool readColorZone(MWAWEntry const &entry)
try to read a color zone, probably used to define the menu, ...
Definition PowerPoint1Parser.cxx:1984
PowerPoint1Parser::m_state
std::shared_ptr< PowerPoint1ParserInternal::State > m_state
the state
Definition PowerPoint1Parser.hxx:157
PowerPoint1Parser::readFramesList
bool readFramesList(MWAWEntry const &entry, std::vector< PowerPoint1ParserInternal::Frame > &frame, int schemeId)
try to read a frame zone in a page
Definition PowerPoint1Parser.cxx:725
PowerPoint1Parser::sendSlideNote
bool sendSlideNote(PowerPoint1ParserInternal::Slide const &slide)
try to send the slide note text
Definition PowerPoint1Parser.cxx:2291
PowerPoint1Parser::readSlide
bool readSlide(MWAWEntry const &entry, std::vector< int > &slideIds)
try to read a slide zone, update the list of slide ids
Definition PowerPoint1Parser.cxx:1143
PowerPoint1Parser::readRulers
bool readRulers(MWAWEntry const &entry)
try to read the paragraph style
Definition PowerPoint1Parser.cxx:1794
PowerPoint1Parser::sendFrame
bool sendFrame(PowerPoint1ParserInternal::Frame const &frame, PowerPoint1ParserInternal::TextZone const &textZone)
try to send a frame zone
Definition PowerPoint1Parser.cxx:2545
PowerPoint1Parser::getColor
bool getColor(int colorId, int schemeId, MWAWColor &color) const
try to return a color corresponding to a scheme and color
Definition PowerPoint1Parser.cxx:396
PowerPoint1Parser::readScheme
bool readScheme(MWAWEntry const &entry, int id)
try to read a scheme
Definition PowerPoint1Parser.cxx:2191
PowerPoint1Parser::readTextZone
bool readTextZone(MWAWEntry const &entry, PowerPoint1ParserInternal::TextZone &zone)
try to read a text zone
Definition PowerPoint1Parser.cxx:989
PowerPoint1Parser::sendSlides
void sendSlides()
try to send all slides
Definition PowerPoint1Parser.cxx:660
PowerPoint1Parser::~PowerPoint1Parser
~PowerPoint1Parser() final
destructor
Definition PowerPoint1Parser.cxx:392
PowerPoint1Parser::readZone2
bool readZone2(MWAWEntry const &entry)
try to read a unknown zone with size 22: related to scheme?
Definition PowerPoint1Parser.cxx:2247
PowerPoint1Parser::createDocument
void createDocument(librevenge::RVNGPresentationInterface *documentInterface)
creates the listener which will be associated to the document
Definition PowerPoint1Parser.cxx:448
PowerPoint1Parser::readDocInfo
bool readDocInfo(MWAWEntry const &entry)
try to read the document info zone
Definition PowerPoint1Parser.cxx:1301
PowerPoint1Parser::checkForUnparsedZones
void checkForUnparsedZones()
check for unparsed zone
Definition PowerPoint1Parser.cxx:692
PowerPoint1Parser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition PowerPoint1Parser.cxx:2594
PowerPoint1Parser::readRuler
bool readRuler(MWAWEntry const &entry, size_t id)
try to read some ruler: windows v2
Definition PowerPoint1Parser.cxx:1856
PowerPoint1Parser::readFontNames
bool readFontNames(MWAWEntry const &entry)
try to read a font names list
Definition PowerPoint1Parser.cxx:2105
PowerPoint1Parser::sendText
bool sendText(PowerPoint1ParserInternal::TextZone const &textZone, MWAWVec2i tId, int rulerId)
try to send a text zone
Definition PowerPoint1Parser.cxx:2336
PowerPoint1Parser::sendSlide
bool sendSlide(PowerPoint1ParserInternal::Slide const &slide, bool master)
try to send a slide
Definition PowerPoint1Parser.cxx:2271
PowerPoint1Parser::createZones
bool createZones()
finds the different zones
Definition PowerPoint1Parser.cxx:484
PowerPoint1Parser::readFonts
bool readFonts(MWAWEntry const &entry)
try to read a font style list
Definition PowerPoint1Parser.cxx:2048
PowerPoint1Parser::readZoneIdList2
bool readZoneIdList2(MWAWEntry const &entry, int zId)
try to read a zone id list zone for v2 pc file
Definition PowerPoint1Parser.cxx:1664
PowerPoint1Parser::readPrintInfo
bool readPrintInfo(MWAWEntry const &entry)
try to read a print info zone
Definition PowerPoint1Parser.cxx:1764
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
PowerPoint1ParserInternal
Internal: the structures of a PowerPoint1Parser.
Definition PowerPoint1Parser.cxx:57
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
PowerPoint1ParserInternal::Frame
Internal: a frame of a PowerPoint1Parser.
Definition PowerPoint1Parser.cxx:145
PowerPoint1ParserInternal::Scheme
a scheme of a PowerPoint1Parser
Definition PowerPoint1Parser.cxx:97
PowerPoint1ParserInternal::Slide
Internal: a slide of a PowerPoint1Parser.
Definition PowerPoint1Parser.cxx:173
PowerPoint1ParserInternal::State
Internal: the state of a PowerPoint1Parser.
Definition PowerPoint1Parser.cxx:192
PowerPoint1ParserInternal::TextZone
Internal: a text zone of a PowerPoint1Parser.
Definition PowerPoint1Parser.cxx:102