PowerPoint7Parser.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_POINT7_PARSER
35 # define POWER_POINT7_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
46 namespace PowerPoint7ParserInternal
47 {
48 struct State;
49 }
50
51 namespace PowerPoint7Struct
52 {
53 struct SlideId;
54 }
55
56 class PowerPoint7Graph;
57 class PowerPoint7Text;
58
61 class PowerPoint7Parser final : public MWAWPresentationParser
62 {
63 friend class PowerPoint7Graph;
64 friend class PowerPoint7Text;
65 public:
67 PowerPoint7Parser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
69 ~PowerPoint7Parser() final;
70
72 bool checkHeader(MWAWHeader *header, bool strict=false) final;
73
74 // the main parse function
75 void parse(librevenge::RVNGPresentationInterface *documentInterface) final;
76
77 protected:
79 void createDocument(librevenge::RVNGPresentationInterface *documentInterface);
80
82 bool createZones();
84 void sendSlides();
85
86 //
87 // send data
88 //
89
90 // interface with the text parser
91
93 bool getColor(int cId, MWAWColor &col) const;
95 bool sendText(int textId);
96
97 //
98 // low level
99 //
100
102 bool readDocRoot();
104 bool readMainSub10(long endPos);
106 bool readDocument(long endPos);
108 bool readDocAtom(int level, long endPos);
110 bool readSlideInformation(int level, long endPos);
112 bool readSlides(int level, long endPos, bool master);
114 bool readSlideAtom(int level, long endPos,
115 PowerPoint7Struct::SlideId &sId, PowerPoint7Struct::SlideId &mId);
117 bool readNotes(int level, long endPos);
119 bool readNoteAtom(int level, long endPos, PowerPoint7Struct::SlideId &sId);
121 bool readEnvironment(int level, long endPos);
123 bool readColorScheme(int level, long endPos, std::vector<MWAWColor> &colors);
125 bool readZone1015(int level, long endPos);
127 bool readSlideShowInfo(int level, long endPos);
129 bool readSlideViewInfo(int level, long endPos);
131 bool readGuideAtom(int level, long endPos);
133 bool readViewInfoAtom(int level, long endPos);
135 bool readSlideViewInfoAtom(int level, long endPos);
137 bool readVbaInfo(int level, long endPos);
139 bool readVbaInfoAtom(int level, long endPos);
141 bool readSSDocInfoAtom(int level, long endPos);
143 bool readSummary(int level, long endPos);
145 bool readZone1028(int level, long endPos);
147 bool readZone1028Atom(int level, long endPos);
149 bool readOutlineViewInfo(int level, long endPos);
151 bool readSorterViewInfo(int level, long endPos);
152
154 bool readContainerList(int level, long endPos);
156 bool readContainerAtom(int level, long endPos, int &N);
158 bool readIdentifier(int level, long endPos, int &id, std::string const &wh);
160 bool readBookmarkCollection(int level, long endPos);
162 bool readSoundCollection(int level, long endPos);
164 bool readBookmarkSeedAtom(int level, long endPos);
166 bool readZone2026(int level, long endPos);
168 bool readColorList(int level, long endPos, std::vector<MWAWColor> &colors);
169
171 bool readZone3000(int level, long endPos);
173 bool readZone3012(int level, long endPos);
175 bool readZone3012Atom(int level, long endPos);
176
178 bool readTextCharsAtom(int level, long endPos);
180 bool readStyleTextPropAtom(int level, long endPos, int &textId);
182 bool readOutlineTextProps9Atom(int level, long endPos,
183 int &pId, PowerPoint7Struct::SlideId &sId);
185 bool readOutlineTextPropsHeader9Atom(int level, long endPos);
187 bool readString(int level, long endPos, std::string &string, int &zId, std::string const &what="");
189 bool readSlideIdentifier(int level, long endPos, PowerPoint7Struct::SlideId &sId);
191 bool readZone4039(int level, long endPos);
193 bool readKinsoku(int level, long endPos);
195 bool readHandout(int level, long endPos);
197 bool readZone4042(int level, long endPos);
199 bool readKinsokuAtom(int level, long endPos);
201 bool readZone1028Data(int level, long endPos);
203 bool readSlideIdentifierContainer(int level, long endPos, PowerPoint7Struct::SlideId &sId);
205 bool readHeaderFooters(int level, long endPos);
207 bool readHeaderFooterAtom(int level, long endPos);
209 bool readZone4072(int level, long endPos);
210
212 bool readZone(int level, long endPos);
214 bool readZoneNoData(int level, long endPos, std::string const &name, std::string const &wh="");
215
217 bool parseTextContent(MWAWInputStreamPtr input);
219 void checkForUnparsedZones();
220 protected:
221 //
222 // data
223 //
225 std::shared_ptr<PowerPoint7ParserInternal::State> m_state;
226 };
227 #endif
228 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:56
MWAWParser.hxx
librevenge
Definition: MWAWDocument.hxx:56
PowerPoint7Text::m_state
std::shared_ptr< PowerPoint7TextInternal::State > m_state
the state
Definition: PowerPoint7Text.hxx:149
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:192
MWAWRSRCParserPtr
std::shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:557
PowerPoint7Text::PowerPoint7Parser
friend class PowerPoint7Parser
Definition: PowerPoint7Text.hxx:69
PowerPoint7ParserInternal
Internal: the structures of a PowerPoint7Parser.
Definition: PowerPoint7Parser.cxx:60
MWAWPresentationParser
virtual class which defines the ancestor of all presentation zone parser
Definition: MWAWParser.hxx:266
PowerPoint7Text
the main class to read the text part of a PowerPoint 95 file
Definition: PowerPoint7Text.hxx:67
MWAWInputStream.hxx
MWAWDebug.hxx
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:547
FullWrtStruct::getColor
bool getColor(int color, MWAWColor &col)
try to convert a file data to a color
Definition: FullWrtStruct.cxx:45
PowerPoint7Parser
the main class to read a Microsoft PowerPoint 95 files (Windows)
Definition: PowerPoint7Parser.hxx:61
PowerPoint7Graph
the main class to read the graphic part of a PowerPoint 95 file
Definition: PowerPoint7Graph.hxx:73
PowerPoint7Struct
namespace used to define basic struct of a Microsoft PowerPoint 95 files (Windows) ...
Definition: PowerPoint7Graph.hxx:61
PowerPoint7Text::sendText
bool sendText(int textId)
try to send the text content
Definition: PowerPoint7Text.cxx:1526