PowerPoint1Parser.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2 
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33 
34 #ifndef POWER_POINT1_PARSER
35 # define POWER_POINT1_PARSER
36 
37 #include <vector>
38 
39 #include "MWAWDebug.hxx"
40 #include "MWAWInputStream.hxx"
41 
42 #include "MWAWParser.hxx"
43 
44 namespace PowerPoint1ParserInternal
45 {
46 struct Frame;
47 struct Scheme;
48 struct Slide;
49 struct TextZone;
50 
51 struct State;
52 
53 class SubDocument;
54 }
55 
61 {
63 public:
67  virtual ~PowerPoint1Parser();
68 
70  bool checkHeader(MWAWHeader *header, bool strict=false);
71 
72  // the main parse function
73  void parse(librevenge::RVNGPresentationInterface *documentInterface);
74 
75 protected:
77  void createDocument(librevenge::RVNGPresentationInterface *documentInterface);
78 
80  bool createZones();
82  void sendSlides();
83 
85  bool readListZones(int &docInfoId);
86 
87  //
88  // internal level
89  //
90 
92  bool readFramesList(MWAWEntry const &entry, std::vector<PowerPoint1ParserInternal::Frame> &frame, int schemeId);
94  bool readZoneIdList(MWAWEntry const &entry, int zId);
96  bool readZoneIdList2(MWAWEntry const &entry, int zId);
97 
99  bool readColors(MWAWEntry const &entry);
101  bool readColorZone(MWAWEntry const &entry);
103  bool readFonts(MWAWEntry const &entry);
105  bool readPicture(MWAWEntry const &entry, MWAWEmbeddedObject &picture);
107  bool readPrintInfo(MWAWEntry const &entry);
109  bool readRulers(MWAWEntry const &entry);
111  bool readScheme(MWAWEntry const &entry, int id);
113  bool readSchemes();
117  bool readSlide(MWAWEntry const &entry, std::vector<int> &slideIds);
119  bool readDocInfo(MWAWEntry const &entry);
121  bool readZone2(MWAWEntry const &entry);
122 
123  //
124  // send data
125  //
126 
128  bool sendSlide(PowerPoint1ParserInternal::Slide const &slide, bool master);
132  bool sendPicture(MWAWPosition const &position, MWAWGraphicStyle const &style, int pId);
134  bool sendText(PowerPoint1ParserInternal::TextZone const &textZone, MWAWVec2i tId, int rulerId);
137 
138  //
139  // low level
140  //
141 
143  bool getColor(int colorId, int schemeId, MWAWColor &color) const;
145  void checkForUnparsedZones();
146 protected:
147  //
148  // data
149  //
151  shared_ptr<PowerPoint1ParserInternal::State> m_state;
152 };
153 #endif
154 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
bool sendSlideNote(PowerPoint1ParserInternal::Slide const &slide)
try to send the slide note text
Definition: PowerPoint1Parser.cxx:1854
void parse(librevenge::RVNGPresentationInterface *documentInterface)
virtual function used to parse the input
Definition: PowerPoint1Parser.cxx:378
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:56
virtual ~PowerPoint1Parser()
destructor
Definition: PowerPoint1Parser.cxx:354
bool readPrintInfo(MWAWEntry const &entry)
try to read a print info zone
Definition: PowerPoint1Parser.cxx:1511
bool readSchemes()
try to read the schemes
Definition: PowerPoint1Parser.cxx:1761
bool readDocInfo(MWAWEntry const &entry)
try to read the document info zone
Definition: PowerPoint1Parser.cxx:1140
bool readListZones(int &docInfoId)
try to read the list of zones
Definition: PowerPoint1Parser.cxx:522
Internal: a frame of a PowerPoint1Parser.
Definition: PowerPoint1Parser.cxx:136
bool readZoneIdList2(MWAWEntry const &entry, int zId)
try to read a zone id list zone for v2 pc file
Definition: PowerPoint1Parser.cxx:1429
Internal: a text zone of a PowerPoint1Parser.
Definition: PowerPoint1Parser.cxx:102
bool readTextZone(MWAWEntry const &entry, PowerPoint1ParserInternal::TextZone &zone)
try to read a text zone
Definition: PowerPoint1Parser.cxx:903
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:47
bool readColorZone(MWAWEntry const &entry)
try to read a color zone, probably used to define the menu, ...
Definition: PowerPoint1Parser.cxx:1659
void createDocument(librevenge::RVNGPresentationInterface *documentInterface)
creates the listener which will be associated to the document
Definition: PowerPoint1Parser.cxx:410
bool readFramesList(MWAWEntry const &entry, std::vector< PowerPoint1ParserInternal::Frame > &frame, int schemeId)
try to read a frame zone in a page
Definition: PowerPoint1Parser.cxx:675
void checkForUnparsedZones()
check for unparsed zone
Definition: PowerPoint1Parser.cxx:640
bool readScheme(MWAWEntry const &entry, int id)
try to read a scheme
Definition: PowerPoint1Parser.cxx:1770
the class to store a color
Definition: libmwaw_internal.hxx:182
PowerPoint1Parser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
constructor
Definition: PowerPoint1Parser.cxx:348
the main class to read a Mac Microsoft PowerPoint v1, v2 files
Definition: PowerPoint1Parser.hxx:60
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:513
shared_ptr< PowerPoint1ParserInternal::State > m_state
the state
Definition: PowerPoint1Parser.hxx:151
bool readRulers(MWAWEntry const &entry)
try to read the paragraph style
Definition: PowerPoint1Parser.cxx:1541
bool readZoneIdList(MWAWEntry const &entry, int zId)
try to read a zone id list zone
Definition: PowerPoint1Parser.cxx:1373
bool readPicture(MWAWEntry const &entry, MWAWEmbeddedObject &picture)
try to read a picture zone
Definition: PowerPoint1Parser.cxx:1344
virtual class which defines the ancestor of all presentation zone parser
Definition: MWAWParser.hxx:265
small class use to define a embedded object
Definition: libmwaw_internal.hxx:425
bool checkHeader(MWAWHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: PowerPoint1Parser.cxx:2083
bool createZones()
finds the different zones
Definition: PowerPoint1Parser.cxx:446
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:503
bool sendPicture(MWAWPosition const &position, MWAWGraphicStyle const &style, int pId)
try to send a picture
Definition: PowerPoint1Parser.cxx:1878
bool readZone2(MWAWEntry const &entry)
try to read a unknown zone with size 22: related to scheme?
Definition: PowerPoint1Parser.cxx:1811
Internal: the subdocument of a PowerPointParser.
Definition: PowerPoint1Parser.cxx:269
void sendSlides()
try to send all slides
Definition: PowerPoint1Parser.cxx:608
Internal: a slide of a PowerPoint1Parser.
Definition: PowerPoint1Parser.cxx:157
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: MWAWPosition.hxx:47
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
bool readSlide(MWAWEntry const &entry, std::vector< int > &slideIds)
try to read a slide zone, update the list of slide ids
Definition: PowerPoint1Parser.cxx:990
bool sendText(PowerPoint1ParserInternal::TextZone const &textZone, MWAWVec2i tId, int rulerId)
try to send a text zone
Definition: PowerPoint1Parser.cxx:1900
bool getColor(int colorId, int schemeId, MWAWColor &color) const
try to return a color corresponding to a scheme and color
Definition: PowerPoint1Parser.cxx:358
bool readFonts(MWAWEntry const &entry)
try to read a font style list
Definition: PowerPoint1Parser.cxx:1718
bool sendFrame(PowerPoint1ParserInternal::Frame const &frame, PowerPoint1ParserInternal::TextZone const &textZone)
try to send a frame zone
Definition: PowerPoint1Parser.cxx:2035
bool readColors(MWAWEntry const &entry)
try to read a color list
Definition: PowerPoint1Parser.cxx:1605
bool sendSlide(PowerPoint1ParserInternal::Slide const &slide, bool master)
try to send a slide
Definition: PowerPoint1Parser.cxx:1834

Generated on Mon Jul 10 2017 08:22:31 for libmwaw by doxygen 1.8.7