PowerPoint3Parser.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_POINT3_PARSER
35 # define POWER_POINT3_PARSER
36 
37 #include <map>
38 #include <set>
39 #include <vector>
40 
41 #include "MWAWDebug.hxx"
42 #include "MWAWInputStream.hxx"
43 
44 #include "MWAWParser.hxx"
45 
47 {
48 struct FieldParser;
49 struct Frame;
50 struct Polygon;
51 struct Ruler;
52 struct Slide;
53 struct SlideContent;
54 struct SlideFormat;
55 struct State;
56 struct TextZone;
57 
58 class SubDocument;
59 }
60 
64 {
66 public:
70  virtual ~PowerPoint3Parser();
71 
73  bool checkHeader(MWAWHeader *header, bool strict=false);
74 
75  // the main parse function
76  void parse(librevenge::RVNGPresentationInterface *documentInterface);
77 
78 protected:
80  void createDocument(librevenge::RVNGPresentationInterface *documentInterface);
81 
83  bool createZones();
85  void sendSlides();
86 
88  bool readListZones(int &docInfoId);
90  bool readStructList(MWAWEntry const &entry, PowerPoint3ParserInternal::FieldParser &parser);
91 
92  //
93  // internal level
94  //
95 
97  bool readColors(MWAWEntry const &entry);
99  bool readColorZone(MWAWEntry const &entry);
101  bool readDocInfo(MWAWEntry const &entry);
103  bool readDocRoot(MWAWEntry const &entry);
105  bool readFont(MWAWFont &font, int schemeId);
107  bool readFontNamesList(std::map<int,int> const &fIdtoZIdMap);
109  bool readFontName(MWAWEntry const &entry, int id);
111  bool readFramesList(MWAWEntry const &entry, PowerPoint3ParserInternal::SlideContent &content);
113  bool readParagraph(MWAWParagraph &para, PowerPoint3ParserInternal::Ruler const &ruler, int schemeId);
115  bool readPictureDefinition(MWAWEntry const &entry, int id);
117  bool readPictureContent(MWAWEntry const &entry, MWAWEmbeddedObject &pict);
119  bool readPictureMain(MWAWEntry const &entry);
121  bool readPicturesList(std::map<int,int> const &pIdtoZIdMap);
123  bool readPrintInfo(MWAWEntry const &entry);
125  bool readRuler(MWAWEntry const &entry, int id);
127  bool readScheme(MWAWEntry const &entry, int id);
129  bool readSlide(MWAWEntry const &entry, PowerPoint3ParserInternal::Slide &slide, int zId);
131  bool readSlideContent(MWAWEntry const &entry, PowerPoint3ParserInternal::SlideContent &slide);
133  bool readSlideFormats(MWAWEntry const &entry, std::vector<PowerPoint3ParserInternal::SlideFormat> &formatList);
135  bool readSlidePolygons(MWAWEntry const &entry, std::vector<PowerPoint3ParserInternal::Polygon> &polyList);
137  bool readSlideTransition(MWAWEntry const &entry);
139  bool readSlidesList(MWAWEntry const &entry);
141  bool readTextZone(MWAWEntry const &entry, PowerPoint3ParserInternal::SlideContent &content);
142 
143 
144  //
145  // send data
146  //
148  bool sendSlide(PowerPoint3ParserInternal::SlideContent const &slide, bool master);
150  bool sendFrame(PowerPoint3ParserInternal::Frame const &frame, PowerPoint3ParserInternal::SlideContent const &content, std::set<int> &seen);
152  bool sendText(PowerPoint3ParserInternal::SlideContent const &slide, int tId, bool placeHolder);
153 
154  //
155  // low level
156  //
158  bool readZone9(MWAWEntry const &entry);
160  bool readZone10(MWAWEntry const &entry);
161 
162 
164  bool getColor(int colorId, int schemeId, MWAWColor &color) const;
166  void checkForUnparsedZones();
167 protected:
168  //
169  // data
170  //
172  shared_ptr<PowerPoint3ParserInternal::State> m_state;
173 };
174 #endif
175 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:56
Internal: a frame of a PowerPoint3Parser.
Definition: PowerPoint3Parser.cxx:249
Internal: a slide of a PowerPoint3Parser.
Definition: PowerPoint3Parser.cxx:373
the class to store a color
Definition: libmwaw_internal.hxx:182
Internal: the subdocument of a PowerPointParser.
Definition: PowerPoint3Parser.cxx:649
Class to store font.
Definition: MWAWFont.hxx:43
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:513
Internal: a slide of a PowerPoint3Parser.
Definition: PowerPoint3Parser.cxx:405
Internal: the structures of a PowerPoint3Parser.
Definition: PowerPoint3Parser.cxx:56
void parse(MWAWListenerPtr &listener, libmwaw::SubDocumentType type)
the parser function
Definition: PowerPoint3Parser.cxx:694
virtual class which defines the ancestor of all presentation zone parser
Definition: MWAWParser.hxx:265
the main class to read a Microsoft PowerPoint v3 files (MacOs and Windows)
Definition: PowerPoint3Parser.hxx:63
small class use to define a embedded object
Definition: libmwaw_internal.hxx:425
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:503
Internal: virtual field parser of a PowerPoint3Parser.
Definition: PowerPoint3Parser.cxx:101
bool getColor(int color, MWAWColor &col)
try to convert a file data to a color
Definition: FullWrtStruct.cxx:45
class to store the paragraph properties
Definition: MWAWParagraph.hxx:81
Internal: a ruler.
Definition: PowerPoint3Parser.cxx:215
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
shared_ptr< PowerPoint3ParserInternal::State > m_state
the state
Definition: PowerPoint3Parser.hxx:172

Generated on Tue Jun 13 2017 18:37:56 for libmwaw by doxygen 1.8.13