20#include "powerpoint.h"
21#include "presentation.h"
38static inline unsigned long readU16(
const void* p )
40 const unsigned char* ptr = (
const unsigned char*) p;
41 return ptr[0]+(ptr[1]<<8);
44static inline signed long readS16(
const void* p )
46 const unsigned char* ptr = (
const unsigned char*) p;
47 return ptr[0]+(ptr[1]<<8);
50static inline unsigned long readU32(
const void* p )
52 const unsigned char* ptr = (
const unsigned char*) p;
53 return ptr[0]+(ptr[1]<<8)+(ptr[2]<<16)+(ptr[3]<<24);
56static inline signed long readS32(
const void* p )
58 const unsigned char* ptr = (
const unsigned char*) p;
59 return ptr[0]+(ptr[1]<<8)+(ptr[2]<<16)+(ptr[3]<<24);
66std::ostream& operator<<( std::ostream& s,
UString ustring )
68 char* str = ustring.
ascii();
76using namespace Libppt;
81const unsigned int Record::id = 0;
94Record* Record::create(
unsigned type )
98 if( type == BookmarkCollectionContainer::id )
99 record =
new BookmarkCollectionContainer();
101 else if( type == DocumentContainer::id )
102 record =
new DocumentContainer();
104 else if( type == EnvironmentContainer::id )
105 record =
new EnvironmentContainer();
107 else if( type == ExObjListContainer::id )
108 record =
new ExObjListContainer();
110 else if( type == ExOleObjStgContainer::id )
111 record =
new ExOleObjStgContainer();
113 else if( type == ExHyperlinkContainer::id )
114 record =
new ExHyperlinkContainer();
116 else if( type == ExEmbedContainer::id )
117 record =
new ExEmbedContainer();
119 else if( type == ExLinkContainer::id )
120 record =
new ExLinkContainer();
122 else if( type == FontCollectionContainer::id )
123 record =
new FontCollectionContainer();
125 else if( type == HandoutContainer::id )
126 record =
new HandoutContainer();
128 else if( type == HeadersFootersContainer::id )
129 record =
new HeadersFootersContainer();
131 else if( type == ListContainer::id )
132 record =
new ListContainer();
134 else if( type == SlideContainer::id )
135 record =
new SlideContainer();
137 else if( type == SlideBaseContainer::id )
138 record =
new SlideBaseContainer();
140 else if( type == MainMasterContainer::id )
141 record =
new MainMasterContainer();
143 else if( type == NotesContainer::id )
144 record =
new NotesContainer();
146 else if( type == RunArrayContainer::id )
147 record =
new RunArrayContainer();
149 else if( type == SlideListWithTextContainer::id )
150 record =
new SlideListWithTextContainer();
152 else if( type == SlideViewInfoContainer::id )
153 record =
new SlideViewInfoContainer();
155 else if( type == SorterViewInfoContainer::id )
156 record =
new SorterViewInfoContainer();
158 else if( type == SrKinsokuContainer::id )
159 record =
new SrKinsokuContainer();
161 else if( type == SummaryContainer::id )
162 record =
new SummaryContainer();
164 else if( type == OutlineViewInfoContainer::id )
165 record =
new OutlineViewInfoContainer();
167 else if( type == ProgStringTagContainer ::id )
168 record =
new ProgStringTagContainer ();
170 else if( type == PPDrawingGroupContainer ::id )
171 record =
new PPDrawingGroupContainer ();
173 else if( type == PPDrawingContainer ::id )
174 record =
new PPDrawingContainer ();
176 else if( type == ProgBinaryTagContainer ::id )
177 record =
new ProgBinaryTagContainer ();
179 else if( type == ProgTagsContainer ::id )
180 record =
new ProgTagsContainer ();
182 else if( type == VBAInfoContainer::id )
183 record =
new VBAInfoContainer();
185 else if( type == ViewInfoContainer::id )
186 record =
new ViewInfoContainer();
189 else if( type == msofbtDgContainer::id )
190 record =
new msofbtDgContainer();
192 else if( type == msofbtSpgrContainer::id )
193 record =
new msofbtSpgrContainer();
195 else if( type == msofbtSpContainer::id )
196 record =
new msofbtSpContainer();
198 else if( type == msofbtDggContainer::id )
199 record =
new msofbtDggContainer();
201 else if( type == msofbtBstoreContainer::id )
202 record =
new msofbtBstoreContainer();
204 else if( type == msofbtSolverContainer::id )
205 record =
new msofbtSolverContainer();
208 else if( type == BookmarkEntityAtom::id )
209 record =
new BookmarkEntityAtom();
211 else if( type == CStringAtom::id )
212 record =
new CStringAtom();
214 else if( type == ColorSchemeAtom::id )
215 record =
new ColorSchemeAtom();
217 else if( type == CurrentUserAtom::id )
218 record =
new CurrentUserAtom();
220 else if( type == DocumentAtom::id )
221 record =
new DocumentAtom();
223 else if( type == EndDocumentAtom::id )
224 record =
new EndDocumentAtom();
226 else if( type == ExEmbedAtom::id )
227 record =
new ExEmbedAtom();
229 else if( type == ExHyperlinkAtom::id )
230 record =
new ExHyperlinkAtom();
232 else if( type == ExLinkAtom::id )
233 record =
new ExLinkAtom();
235 else if( type == ExObjListAtom::id )
236 record =
new ExObjListAtom();
238 else if( type == ExOleObjAtom::id )
239 record =
new ExOleObjAtom();
241 else if( type == FontEntityAtom::id )
242 record =
new FontEntityAtom();
244 else if( type == GuideAtom::id )
245 record =
new GuideAtom();
247 else if( type == HeadersFootersAtom ::id )
248 record =
new HeadersFootersAtom ();
250 else if( type == NotesAtom::id )
251 record =
new NotesAtom();
253 else if( type == PersistIncrementalBlockAtom::id )
254 record =
new PersistIncrementalBlockAtom();
256 else if( type == Record1043::id )
257 record =
new Record1043 ();
259 else if( type == Record1044::id )
260 record =
new Record1044 ();
262 else if( type == SrKinsokuAtom::id )
263 record =
new SrKinsokuAtom();
265 else if( type == SlideAtom::id )
266 record =
new SlideAtom();
268 else if( type == SlidePersistAtom::id )
269 record =
new SlidePersistAtom();
271 else if( type == StyleTextPropAtom::id )
272 record =
new StyleTextPropAtom();
274 else if( type == SlideViewInfoAtom::id )
275 record =
new SlideViewInfoAtom();
277 else if( type == SSDocInfoAtom ::id )
278 record =
new SSDocInfoAtom();
280 else if( type == SSlideLayoutAtom ::id )
281 record =
new SSlideLayoutAtom();
283 else if( type == SSSlideInfoAtom ::id )
284 record =
new SSSlideInfoAtom();
286 else if( type == TextHeaderAtom ::id )
287 record =
new TextHeaderAtom();
289 else if( type == TextBookmarkAtom ::id )
290 record =
new TextBookmarkAtom();
292 else if( type == TextBytesAtom::id )
293 record =
new TextBytesAtom ();
295 else if( type == TextCharsAtom::id )
296 record =
new TextCharsAtom ();
298 else if( type == TextSpecInfoAtom ::id )
299 record =
new TextSpecInfoAtom();
301 else if( type == TxCFStyleAtom ::id )
302 record =
new TxCFStyleAtom();
304 else if( type == TxMasterStyleAtom ::id )
305 record =
new TxMasterStyleAtom();
307 else if( type == TxPFStyleAtom ::id )
308 record =
new TxPFStyleAtom();
310 else if( type == TxSIStyleAtom ::id )
311 record =
new TxSIStyleAtom();
313 else if( type == UserEditAtom::id )
314 record =
new UserEditAtom();
316 else if( type == ViewInfoAtom::id )
317 record =
new ViewInfoAtom();
319 else if( type == msofbtDgAtom::id )
320 record =
new msofbtDgAtom() ;
322 else if( type == msofbtSpgrAtom::id )
323 record =
new msofbtSpgrAtom() ;
325 else if( type == msofbtSpAtom::id )
326 record =
new msofbtSpAtom() ;
328 else if( type == msofbtOPTAtom::id )
329 record =
new msofbtOPTAtom() ;
331 else if( type == msofbtChildAnchorAtom::id )
332 record =
new msofbtChildAnchorAtom() ;
334 else if( type == msofbtClientAnchorAtom::id )
335 record =
new msofbtClientAnchorAtom() ;
337 else if( type == msofbtClientDataAtom::id )
338 record =
new msofbtClientDataAtom() ;
340 else if( type == msofbtClientTextboxAtom::id )
341 record =
new msofbtClientTextboxAtom() ;
343 else if( type == msofbtDggAtom::id )
344 record =
new msofbtDggAtom() ;
346 else if( type == msofbtColorMRUAtom::id )
347 record =
new msofbtColorMRUAtom() ;
349 else if( type == msofbtSplitMenuColorsAtom::id )
350 record =
new msofbtSplitMenuColorsAtom() ;
352 else if( type == msofbtBSEAtom::id )
353 record =
new msofbtBSEAtom() ;
355 else if( type == msofbtCLSIDAtom::id )
356 record =
new msofbtCLSIDAtom() ;
358 else if( type == msofbtRegroupItemsAtom::id )
359 record =
new msofbtRegroupItemsAtom() ;
361 else if( type == msofbtColorSchemeAtom::id )
362 record =
new msofbtColorSchemeAtom() ;
364 else if( type == msofbtClientTextboxAtom::id )
365 record =
new msofbtClientTextboxAtom() ;
367 else if( type == msofbtAnchorAtom::id )
368 record =
new msofbtAnchorAtom() ;
370 else if( type == msofbtOleObjectAtom::id )
371 record =
new msofbtOleObjectAtom() ;
373 else if( type == msofbtDeletedPsplAtom::id )
374 record =
new msofbtDeletedPsplAtom() ;
376 else if( type == msofbtConnectorRuleAtom::id )
377 record =
new msofbtConnectorRuleAtom() ;
379 else if( type == msofbtAlignRuleAtom::id )
380 record =
new msofbtAlignRuleAtom() ;
382 else if( type == msofbtArcRuleAtom::id )
383 record =
new msofbtArcRuleAtom() ;
385 else if( type == msofbtClientRuleAtom::id )
386 record =
new msofbtClientRuleAtom() ;
388 else if( type == msofbtCalloutRuleAtom::id )
389 record =
new msofbtCalloutRuleAtom() ;
391 else if( type == msofbtSelectionAtom::id )
392 record =
new msofbtSelectionAtom() ;
397void Record::setParent( Record* parent )
399 record_parent = parent;
402const Record* Record::parent()
const
404 return record_parent;
407void Record::setPosition(
unsigned pos )
409 stream_position = pos;
412unsigned Record::position()
const
414 return stream_position;
417void Record::setInstance(
unsigned instance )
419 record_instance = instance;
422unsigned Record::instance()
const
424 return record_instance;
427void Record::setData(
unsigned,
const unsigned char* )
431void Record::setData(
unsigned,
const unsigned char*,
unsigned )
435void Record::dump( std::ostream& )
const
442Container::Container()
448const unsigned int BookmarkCollectionContainer::id = 2019;
450BookmarkCollectionContainer::BookmarkCollectionContainer()
456const unsigned int msofbtDggContainer::id = 61440;
458msofbtDggContainer::msofbtDggContainer()
464const unsigned int msofbtBstoreContainer::id = 61441;
466msofbtBstoreContainer::msofbtBstoreContainer()
472const unsigned int msofbtDgContainer::id = 61442;
474msofbtDgContainer::msofbtDgContainer()
480const unsigned int msofbtSpgrContainer::id = 61443;
482msofbtSpgrContainer::msofbtSpgrContainer()
488const unsigned int msofbtSpContainer::id = 61444;
490msofbtSpContainer::msofbtSpContainer()
496const unsigned int msofbtSolverContainer::id = 61445;
498msofbtSolverContainer::msofbtSolverContainer()
505const unsigned int DocumentContainer::id = 1000;
507DocumentContainer::DocumentContainer()
513const unsigned int NotesContainer::id = 1008;
515NotesContainer::NotesContainer()
521const unsigned int ExOleObjStgContainer::id = 4113;
523ExOleObjStgContainer::ExOleObjStgContainer()
529const unsigned int FontCollectionContainer::id = 2005;
531FontCollectionContainer::FontCollectionContainer()
538const unsigned int ExObjListContainer::id = 1033;
540ExObjListContainer::ExObjListContainer()
546const unsigned int SlideContainer::id = 1006;
548SlideContainer::SlideContainer()
554const unsigned int SlideBaseContainer::id = 1004;
556SlideBaseContainer::SlideBaseContainer()
562const unsigned int SlideListWithTextContainer::id = 4080;
564SlideListWithTextContainer::SlideListWithTextContainer()
570const unsigned int SlideViewInfoContainer::id = 1018;
572SlideViewInfoContainer::SlideViewInfoContainer()
578const unsigned int OutlineViewInfoContainer::id = 1031;
580OutlineViewInfoContainer::OutlineViewInfoContainer()
586const unsigned int SorterViewInfoContainer::id = 1032;
588SorterViewInfoContainer::SorterViewInfoContainer()
594const unsigned int HandoutContainer::id = 4041;
596HandoutContainer::HandoutContainer()
602const unsigned int ListContainer::id = 2000;
604ListContainer::ListContainer()
610const unsigned int ExEmbedContainer::id = 4044;
612ExEmbedContainer::ExEmbedContainer()
618const unsigned int ExLinkContainer::id = 4046;
620ExLinkContainer::ExLinkContainer()
626const unsigned int ExHyperlinkContainer::id = 4055;
628ExHyperlinkContainer::ExHyperlinkContainer()
634const unsigned int MainMasterContainer::id = 1016;
636MainMasterContainer::MainMasterContainer()
642const unsigned int EnvironmentContainer::id = 1010;
644EnvironmentContainer::EnvironmentContainer()
650const unsigned int HeadersFootersContainer::id = 4057;
652HeadersFootersContainer::HeadersFootersContainer()
658const unsigned int RunArrayContainer::id = 2028;
660RunArrayContainer::RunArrayContainer()
666const unsigned int SrKinsokuContainer::id = 4040;
668SrKinsokuContainer::SrKinsokuContainer()
674const unsigned int ProgTagsContainer::id = 5000;
676ProgTagsContainer::ProgTagsContainer()
682const unsigned int ProgBinaryTagContainer::id = 5002;
684ProgBinaryTagContainer::ProgBinaryTagContainer()
690const unsigned int ProgStringTagContainer::id = 5001;
692ProgStringTagContainer::ProgStringTagContainer()
698const unsigned int PPDrawingGroupContainer::id = 1035;
700PPDrawingGroupContainer::PPDrawingGroupContainer()
706const unsigned int PPDrawingContainer::id = 1036;
708PPDrawingContainer::PPDrawingContainer()
714const unsigned int SummaryContainer::id = 1026;
716SummaryContainer::SummaryContainer()
722const unsigned int VBAInfoContainer::id = 1023;
724VBAInfoContainer::VBAInfoContainer()
730const unsigned int ViewInfoContainer::id = 1020;
732ViewInfoContainer::ViewInfoContainer()
738const unsigned int CStringAtom::id = 4026;
740class CStringAtom::Private
747CStringAtom::CStringAtom()
752CStringAtom::~CStringAtom()
757UString CStringAtom::ustring()
const
762void CStringAtom::setUString(
const UString& ustr )
767void CStringAtom::setData(
unsigned size,
const unsigned char* data )
770 for(
unsigned k=0; k<(size/2); k++ )
772 unsigned uchar = readU16( data + k*2 );
778 str.
append( UString(uchar) );
783void CStringAtom::dump( std::ostream& out )
const
785 out <<
"CStringAtom" << std::endl;
786 out <<
"String : [" << ustring() <<
"]" << std::endl;
791const unsigned int DocumentAtom::id = 1001;
793class DocumentAtom::Private
802 int notesMasterPersist;
803 int handoutMasterPersist;
812DocumentAtom::DocumentAtom()
815 d->slideWidth = 5760;
816 d->slideHeight = 4320;
817 d->notesWidth = 4320;
818 d->notesHeight = 5760;
821 d->notesMasterPersist = 0;
822 d->handoutMasterPersist = 0;
823 d->firstSlideNum = 0;
824 d->slideSizeType = 0;
825 d->saveWithFonts = 0;
826 d->omitTitlePlace = 0;
831DocumentAtom::~DocumentAtom()
836int DocumentAtom::slideWidth()
const
838 return d->slideWidth;
841void DocumentAtom::setSlideWidth(
int w )
846int DocumentAtom::slideHeight()
const
848 return d->slideHeight;
851void DocumentAtom::setSlideHeight(
int h )
856int DocumentAtom::notesWidth()
const
858 return d->notesWidth;
861void DocumentAtom::setNotesWidth(
int nw )
866int DocumentAtom::notesHeight()
const
868 return d->notesHeight;
871void DocumentAtom::setNotesHeight(
int nh )
876int DocumentAtom::zoomNumer ()
const
881void DocumentAtom::setZoomNumer(
int numer )
883 d->zoomNumer = numer;
886int DocumentAtom::zoomDenom()
const
891void DocumentAtom::setZoomDenom(
int denom )
893 d->zoomDenom = denom;
896int DocumentAtom::notesMasterPersist()
const
898 return d->notesMasterPersist;
901void DocumentAtom::setNotesMasterPersist(
int notesMasterPersist )
903 d->notesMasterPersist = notesMasterPersist;
906int DocumentAtom::handoutMasterPersist()
const
908 return d->handoutMasterPersist;
911void DocumentAtom::setHandoutMasterPersist(
int handoutMasterPersist)
913 d->handoutMasterPersist = handoutMasterPersist;
916int DocumentAtom::firstSlideNum()
const
918 return d->firstSlideNum;
921void DocumentAtom::setFirstSlideNum(
int firstSlideNum )
923 d->firstSlideNum = firstSlideNum;
926int DocumentAtom::slideSizeType()
const
928 return d->slideSizeType;
931void DocumentAtom::setSlideSizeType(
int slideSizeType )
933 d->slideSizeType = slideSizeType;
936int DocumentAtom::saveWithFonts()
const
938 return d->saveWithFonts;
941void DocumentAtom::setSaveWithFonts(
int saveWithFonts )
943 d->saveWithFonts = saveWithFonts;
946int DocumentAtom::omitTitlePlace()
const
948 return d->omitTitlePlace;
951void DocumentAtom::setOmitTitlePlace(
int omitTitlePlace )
953 d->omitTitlePlace = omitTitlePlace;
956int DocumentAtom::rightToLeft()
const
958 return d->rightToLeft;
961void DocumentAtom::setRightToLeft(
int rightToLeft )
963 d->rightToLeft = rightToLeft;
966int DocumentAtom::showComments()
const
968 return d->showComments;
971void DocumentAtom::setShowComments(
int showComments)
973 d->showComments = showComments;
976void DocumentAtom::setData(
unsigned ,
const unsigned char* data )
978 setSlideWidth( readU32( data+0 ) );
979 setSlideHeight( readU32( data+4 ) );
980 setNotesWidth( readU32( data+8 ) );
981 setNotesHeight( readU32( data+12 ) );
982 setZoomNumer( readS32( data+16 ) );
983 setZoomDenom( readS32( data+20) );
984 setNotesMasterPersist( readU32( data+24 ) );
985 setHandoutMasterPersist ( readU32( data+28 ) );
986 setFirstSlideNum( readU16( data+32 ) );
987 setSlideSizeType( readS16( data+34 ) );
988 setSaveWithFonts(data[36]);
989 setOmitTitlePlace(data[37]);
990 setRightToLeft(data[38]);
991 setShowComments(data[39]);
994void DocumentAtom::dump( std::ostream& out )
const
996 out <<
"DocumentAtom" << std::endl;
997 out <<
"slide width " << slideWidth() << std::endl;
998 out <<
"slide height " << slideHeight() << std::endl;
999 out <<
"notes width " << notesWidth() << std::endl;
1000 out <<
"notes height " << notesHeight() << std::endl;
1001 out <<
"zoom numer " << zoomNumer() << std::endl;
1002 out <<
"zoom denum " << zoomDenom() << std::endl;
1003 out <<
"notesMasterPersist " << notesMasterPersist() << std::endl;
1004 out <<
"handoutMasterPersist " << handoutMasterPersist() << std::endl;
1005 out <<
"firstSlideNum " << firstSlideNum() << std::endl;
1006 out <<
"slideSizeType " << slideSizeType() << std::endl;
1007 out <<
"saveWithFonts " << saveWithFonts() << std::endl;
1008 out <<
"omitTitlePlace " << omitTitlePlace() << std::endl;
1009 out <<
"rightToLeft " << rightToLeft() << std::endl;
1010 out <<
"showComments " << showComments() << std::endl;
1015const unsigned int EndDocumentAtom::id = 1002;
1017EndDocumentAtom::EndDocumentAtom()
1021void EndDocumentAtom::dump( std::ostream& out )
const
1023 out <<
"EndDocumentAtom" << std::endl;
1029const unsigned int FontEntityAtom::id = 4023;
1031class FontEntityAtom::Private
1042FontEntityAtom::FontEntityAtom()
1046 d->clipPrecision = 0;
1048 d->pitchAndFamily = 0;
1051FontEntityAtom::~FontEntityAtom()
1056UString FontEntityAtom::ustring()
const
1061void FontEntityAtom::setUString(
const UString& ustring )
1063 d->ustring = ustring;
1066int FontEntityAtom::charset()
const
1071void FontEntityAtom::setCharset(
int charset )
1073 d->charset = charset;
1076int FontEntityAtom::clipPrecision()
const
1078 return d->clipPrecision;
1081void FontEntityAtom::setClipPrecision(
int clipPrecision)
1083 d->clipPrecision = clipPrecision ;
1086int FontEntityAtom::quality()
const
1091void FontEntityAtom::setQuality(
int quality )
1093 d->quality = quality;
1096int FontEntityAtom::pitchAndFamily()
const
1098 return d->pitchAndFamily;
1101void FontEntityAtom::setPitchAndFamily(
int pitchAndFamily )
1103 d->pitchAndFamily = pitchAndFamily;
1106void FontEntityAtom::setData(
unsigned ,
const unsigned char* data )
1110 for(
unsigned k=0; k<32; k++ )
1112 unsigned uchar = readU16( data + k*2 );
1113 str.
append( UString(uchar) );
1116 setCharset( data[64] );
1117 setClipPrecision( data[65] );
1118 setQuality( data[66] );
1119 setPitchAndFamily( data[67] );
1122void FontEntityAtom::dump( std::ostream& out )
const
1124 out <<
"FontEntityAtom" << std::endl;
1125 out <<
"String : [" << ustring() <<
"]" << std::endl;
1126 out <<
"Charset " << charset() << std::endl;
1127 out <<
"ClipPrecision " << clipPrecision() << std::endl;
1128 out <<
"Quality " << quality() << std::endl;
1129 out <<
"PitchAndFamily " << pitchAndFamily() << std::endl;
1134const unsigned int TextCharsAtom::id = 4000;
1137class TextCharsAtom::Private
1140 std::vector<unsigned> index;
1141 std::vector<UString> ustring;
1144TextCharsAtom::TextCharsAtom()
1149TextCharsAtom::~TextCharsAtom()
1154unsigned TextCharsAtom::listSize()
const
1156 return d->ustring.size();
1159UString TextCharsAtom::strValue(
unsigned index )
const
1161 return d->ustring[index];
1164void TextCharsAtom::setText(
UString ustring )
1166 d->ustring.push_back( ustring );
1169void TextCharsAtom::setData(
unsigned size,
const unsigned char* data )
1174 for(
unsigned k=0; k<((0.5*size) + 1); k++ )
1176 unsigned uchar = readU16( data + k*2 );
1177 if ( (uchar == 0x0b) | (uchar == 0x0d) | (k == 0.5*size) )
1184 tempStr.
append( UString(uchar) );
1186 if ( ( uchar & 0xff00 ) == 0xf000 )
1188 std::cout <<
"got a symbol at " << k <<
"th character" << std::endl;
1194void TextCharsAtom::dump( std::ostream& out )
const
1196 out <<
"TextCharsAtom" << std::endl;
1197 out <<
"listSize " << listSize() << std::endl;
1199 for (uint i=0; i<listSize() ; i++)
1201 out <<
"String " << i <<
" [" << strValue(i) <<
"]" << std::endl;
1209const unsigned int GuideAtom::id = 1019;
1211class GuideAtom::Private
1218GuideAtom::GuideAtom ()
1225GuideAtom::~GuideAtom ()
1230int GuideAtom::type()
const
1235void GuideAtom::setType(
int type)
1240int GuideAtom::pos()
const
1245void GuideAtom::setPos(
int pos)
1250void GuideAtom::setData(
unsigned ,
const unsigned char* data )
1252 setType( readS32( data + 0 ) );
1253 setPos( readS32( data + 4 ) );
1256void GuideAtom::dump( std::ostream& out )
const
1258 out <<
"GuideAtom" << std::endl;
1259 out <<
"type " << type() << std::endl;
1260 out <<
"pos " << pos() << std::endl;
1266const unsigned int SSlideLayoutAtom::id = 1015;
1268class SSlideLayoutAtom ::Private
1275SSlideLayoutAtom::SSlideLayoutAtom ()
1279 d->placeholderId = 0;
1282SSlideLayoutAtom::~SSlideLayoutAtom ()
1287int SSlideLayoutAtom::geom()
const
1292void SSlideLayoutAtom::setGeom(
int geom)
1297int SSlideLayoutAtom::placeholderId()
const
1299 return d->placeholderId;
1302void SSlideLayoutAtom::setPlaceholderId(
int placeholderId)
1304 d->placeholderId= placeholderId;
1307void SSlideLayoutAtom ::setData(
unsigned ,
const unsigned char* data )
1309 setGeom( readS32( data + 0 ) );
1310 setPlaceholderId( data [4] );
1313void SSlideLayoutAtom ::dump( std::ostream& out )
const
1315 out <<
"SSlideLayoutAtom" << std::endl;
1316 out <<
"geom " << geom() << std::endl;
1317 out <<
"placeholderId " << placeholderId() << std::endl;
1322const unsigned int ExLinkAtom::id = 4049;
1324class ExLinkAtom ::Private
1332ExLinkAtom::ExLinkAtom ()
1340ExLinkAtom::~ExLinkAtom ()
1345int ExLinkAtom::exObjId()
const
1350void ExLinkAtom::setExObjId(
int exObjId)
1352 d->exObjId= exObjId;
1355int ExLinkAtom::flags()
const
1360void ExLinkAtom::setFlags(
int flags)
1365int ExLinkAtom::unavailable()
const
1367 return d->unavailable;
1370void ExLinkAtom::setUnavailable(
int unavailable)
1372 d->unavailable= unavailable;
1375void ExLinkAtom ::setData(
unsigned ,
const unsigned char* data )
1377 setExObjId( readU32( data + 0 ) );
1378 setFlags( readU16( data + 4 ) );
1379 setUnavailable( data [6] );
1383void ExLinkAtom ::dump( std::ostream& out )
const
1385 out <<
"ExLinkAtom" << std::endl;
1386 out <<
"exObjId " << exObjId() << std::endl;
1387 out <<
"flags " << flags() << std::endl;
1388 out <<
"unavailable " << unavailable() << std::endl;
1393const unsigned int NotesAtom::id = 1009;
1395class NotesAtom ::Private
1402NotesAtom::NotesAtom ()
1409NotesAtom::~NotesAtom ()
1414int NotesAtom::slideId()
const
1419void NotesAtom::setSlideId(
int slideId)
1421 d->slideId= slideId;
1424int NotesAtom::flags()
const
1429void NotesAtom::setFlags(
int flags)
1434void NotesAtom ::setData(
unsigned ,
const unsigned char* data )
1436 setSlideId( readS32( data + 0 ) );
1437 setFlags( readU16( data + 4 ) );
1440void NotesAtom ::dump( std::ostream& out )
const
1442 out <<
"NotesAtom" << std::endl;
1443 out <<
"slideId " << slideId() << std::endl;
1444 out <<
"flags " << flags() << std::endl;
1450const unsigned int ExObjListAtom::id = 1034;
1452class ExObjListAtom ::Private
1458ExObjListAtom::ExObjListAtom ()
1461 d->objectIdSeed = 0;
1464ExObjListAtom::~ExObjListAtom ()
1469int ExObjListAtom::objectIdSeed()
const
1471 return d->objectIdSeed;
1474void ExObjListAtom::setObjectIdSeed(
int objectIdSeed)
1476 d->objectIdSeed= objectIdSeed;
1479void ExObjListAtom ::setData(
unsigned ,
const unsigned char* data )
1481 setObjectIdSeed( readU32( data + 0 ) );
1484void ExObjListAtom ::dump( std::ostream& out )
const
1486 out <<
"ExObjListAtom" << std::endl;
1487 out <<
"objectIdSeed " << objectIdSeed() << std::endl;
1493const unsigned int ExEmbedAtom::id = 4045;
1495class ExEmbedAtom ::Private
1498 int followColorScheme;
1499 int cantLockServerB;
1500 int noSizeToServerB;
1504ExEmbedAtom::ExEmbedAtom ()
1507 d->followColorScheme = 0;
1508 d->cantLockServerB = 0;
1509 d->noSizeToServerB = 0;
1513ExEmbedAtom::~ExEmbedAtom ()
1518int ExEmbedAtom::followColorScheme()
const
1520 return d->followColorScheme;
1523void ExEmbedAtom::setFollowColorScheme(
int followColorScheme)
1525 d->followColorScheme= followColorScheme;
1528int ExEmbedAtom::cantLockServerB()
const
1530 return d->cantLockServerB;
1533void ExEmbedAtom::setCantLockServerB(
int cantLockServerB)
1535 d->cantLockServerB= cantLockServerB;
1538int ExEmbedAtom::noSizeToServerB()
const
1540 return d->noSizeToServerB;
1543void ExEmbedAtom::setNoSizeToServerB(
int noSizeToServerB)
1545 d->noSizeToServerB= noSizeToServerB;
1548int ExEmbedAtom::isTable()
const
1553void ExEmbedAtom::setIsTable(
int isTable)
1555 d->isTable= isTable;
1558void ExEmbedAtom ::setData(
unsigned ,
const unsigned char* data )
1560 setFollowColorScheme( readS32( data + 0 ) );
1561 setCantLockServerB( data [4] );
1562 setNoSizeToServerB( data[5] );
1563 setIsTable( data[6] );
1566void ExEmbedAtom ::dump( std::ostream& out )
const
1568 out <<
"ExEmbedAtom" << std::endl;
1569 out <<
"followColorScheme " << followColorScheme() << std::endl;
1570 out <<
"cantLockServerB " << cantLockServerB() << std::endl;
1571 out <<
"noSizeToServerB " << noSizeToServerB() << std::endl;
1572 out <<
"isTable " << isTable() << std::endl;
1577const unsigned int ExOleObjAtom::id = 4035;
1579class ExOleObjAtom ::Private
1590ExOleObjAtom::ExOleObjAtom ()
1597 d->objStgDataRef = 0;
1601ExOleObjAtom::~ExOleObjAtom ()
1606int ExOleObjAtom::drawAspect()
const
1608 return d->drawAspect;
1611void ExOleObjAtom::setDrawAspect(
int drawAspect)
1613 d->drawAspect= drawAspect;
1616int ExOleObjAtom::type()
const
1621void ExOleObjAtom::setType(
int type)
1626int ExOleObjAtom::objID()
const
1631void ExOleObjAtom::setObjID(
int objID)
1636int ExOleObjAtom::subType()
const
1641void ExOleObjAtom::setSubType(
int subType)
1643 d->subType= subType;
1646int ExOleObjAtom::objStgDataRef()
const
1648 return d->objStgDataRef;
1651void ExOleObjAtom::setObjStgDataRef(
int objStgDataRef)
1653 d->objStgDataRef= objStgDataRef;
1656int ExOleObjAtom::isBlank()
const
1661void ExOleObjAtom::setIsBlank(
int isBlank)
1663 d->isBlank= isBlank;
1666void ExOleObjAtom ::setData(
unsigned ,
const unsigned char* data )
1668 setDrawAspect( readU32( data + 0 ) );
1669 setType( readS32( data + 4 ) );
1670 setObjID( readS32( data + 8 ) );
1671 setSubType( readS32( data + 12 ) );
1672 setObjStgDataRef( readS32( data + 16 ) );
1673 setIsBlank( data[20] );
1676void ExOleObjAtom ::dump( std::ostream& out )
const
1678 out <<
"ExOleObjAtom" << std::endl;
1679 out <<
"drawAspect " << drawAspect() << std::endl;
1680 out <<
"type " << type() << std::endl;
1681 out <<
"objID " << objID() << std::endl;
1682 out <<
"subType " << subType() << std::endl;
1683 out <<
"objID " << objID() << std::endl;
1684 out <<
"objStgDataRef " << objStgDataRef() << std::endl;
1685 out <<
"isBlank " << isBlank() << std::endl;
1690const unsigned int ExHyperlinkAtom::id = 4051;
1692class ExHyperlinkAtom ::Private
1698ExHyperlinkAtom ::ExHyperlinkAtom ()
1704ExHyperlinkAtom ::~ExHyperlinkAtom ()
1709int ExHyperlinkAtom ::objID()
const
1714void ExHyperlinkAtom ::setObjID(
int objID)
1719void ExHyperlinkAtom::setData(
unsigned ,
const unsigned char* data )
1721 setObjID( readU32( data + 0 ) );
1724void ExHyperlinkAtom ::dump( std::ostream& out )
const
1726 out <<
"ExHyperlinkAtom" << std::endl;
1727 out <<
"objID " << objID() << std::endl;
1733const unsigned int PersistIncrementalBlockAtom::id = 6002;
1735class PersistIncrementalBlockAtom::Private
1738 std::vector<unsigned long> references;
1739 std::vector<unsigned long> offsets;
1742PersistIncrementalBlockAtom::PersistIncrementalBlockAtom()
1747PersistIncrementalBlockAtom::~PersistIncrementalBlockAtom()
1752unsigned PersistIncrementalBlockAtom::entryCount()
const
1754 return d->references.size();
1757unsigned long PersistIncrementalBlockAtom::reference(
unsigned index )
const
1759 unsigned long r = 0;
1760 if( index < d->references.size() )
1761 r = d->references[index];
1765unsigned long PersistIncrementalBlockAtom::offset(
unsigned index )
const
1767 unsigned long ofs = 0;
1768 if( index < d->offsets.size() )
1769 ofs = d->offsets[index];
1773void PersistIncrementalBlockAtom ::setData(
unsigned size,
const unsigned char* data )
1775 d->references.clear();
1781 long k = readU32( data+ ofs );
1782 unsigned count = k>>20;
1783 unsigned start = k&0xfffff;
1785 for(
unsigned c=0; c < count; c++, ofs+=4 )
1787 if( ofs >= size )
break;
1788 long of = readU32( data + ofs );
1789 d->references.push_back( start+c );
1790 d->offsets.push_back( of );
1795void PersistIncrementalBlockAtom ::dump( std::ostream& out )
const
1797 out <<
"PersistIncrementalBlockAtom" << std::endl;
1798 for(
unsigned i = 0; i < entryCount(); i++ )
1799 out <<
" Ref #" << reference(i) <<
" at offset " << offset(i) << std::endl;
1805const unsigned int HeadersFootersAtom::id = 4058;
1807class HeadersFootersAtom ::Private
1814HeadersFootersAtom::HeadersFootersAtom ()
1821HeadersFootersAtom::~HeadersFootersAtom ()
1826int HeadersFootersAtom::formatId()
const
1831void HeadersFootersAtom::setFormatId(
int formatId)
1833 d->formatId= formatId;
1836int HeadersFootersAtom::flags()
const
1841void HeadersFootersAtom::setFlags(
int flags)
1846void HeadersFootersAtom::setData(
unsigned ,
const unsigned char* data )
1848 setFormatId( readS16( data + 0 ) );
1849 setFlags( readU16( data + 2 ) );
1852void HeadersFootersAtom::dump( std::ostream& out )
const
1854 out <<
"HeadersFootersAtom" << std::endl;
1855 out <<
"formatId " << formatId() << std::endl;
1856 out <<
"flags " << flags() << std::endl;
1862const unsigned int ColorSchemeAtom::id = 2032;
1864class ColorSchemeAtom ::Private
1873 int accentAndHyperlink;
1874 int accentAndFollowedHyperlink;
1878ColorSchemeAtom::ColorSchemeAtom ()
1882 d->textAndLines = 0;
1887 d->accentAndHyperlink = 0;
1888 d->accentAndFollowedHyperlink = 0;
1892ColorSchemeAtom::~ColorSchemeAtom ()
1897int ColorSchemeAtom::background()
const
1899 return d->background;
1902void ColorSchemeAtom::setBackground(
int background )
1904 d->background = background;
1907int ColorSchemeAtom::textAndLines()
const
1909 return d->textAndLines;
1912void ColorSchemeAtom::setTextAndLines(
int textAndLines )
1914 d->textAndLines = textAndLines;
1917int ColorSchemeAtom::shadows()
const
1922void ColorSchemeAtom::setShadows(
int shadows )
1924 d->shadows = shadows;
1927int ColorSchemeAtom::titleText()
const
1929 return d->titleText;
1932void ColorSchemeAtom::setTitleText(
int titleText )
1934 d->titleText = titleText;
1937int ColorSchemeAtom::fills()
const
1942void ColorSchemeAtom::setFills(
int fills )
1947int ColorSchemeAtom::accent()
const
1952void ColorSchemeAtom::setAccent(
int accent )
1957int ColorSchemeAtom::accentAndHyperlink()
const
1959 return d->accentAndHyperlink;
1962void ColorSchemeAtom::setAccentAndHyperlink (
int accentAndHyperlink )
1964 d->accentAndHyperlink = accentAndHyperlink;
1967int ColorSchemeAtom::accentAndFollowedHyperlink()
const
1969 return d->accentAndFollowedHyperlink;
1972void ColorSchemeAtom::setAccentAndFollowedHyperlink(
int accentAndFollowedHyperlink )
1974 d->accentAndFollowedHyperlink = accentAndFollowedHyperlink;
1977void ColorSchemeAtom ::setData(
unsigned ,
const unsigned char* data )
1979 setBackground( readS32( data + 0 ) );
1980 setTextAndLines( readU32( data + 4 ) );
1981 setShadows( readU32( data + 8 ) );
1982 setTitleText( readU32( data + 12 ) );
1983 setFills( readU32( data + 16 ) );
1984 setAccent( readU32( data + 20 ) );
1985 setAccentAndHyperlink( readU32( data + 24 ) );
1986 setAccentAndFollowedHyperlink( readU32( data + 28 ) );
1990void ColorSchemeAtom ::dump( std::ostream& out )
const
1992 out <<
"ColorSchemeAtom" << std::endl;
1993 out <<
"background " << background() << std::endl;
1994 out <<
" R " << ( (background() >> 0 ) & 0xff ) ;
1995 out <<
" G " << ( (background() >> 8 ) & 0xff ) ;
1996 out <<
" B " << ( (background() >> 16 ) & 0xff ) ;
1997 out <<
" I " << ( (background() >> 24 ) & 0xff ) << std::endl;
1998 out <<
"text and Lines " << textAndLines() << std::endl;
1999 out <<
" R " << ( ( textAndLines() >> 0 ) & 0xff ) ;
2000 out <<
" G " << ( ( textAndLines() >> 8 ) & 0xff ) ;
2001 out <<
" B " << ( ( textAndLines() >> 16 ) & 0xff ) ;
2002 out <<
" I " << ( ( textAndLines() >> 24 ) & 0xff ) << std::endl;
2003 out <<
"shadows " << shadows() << std::endl;
2004 out <<
" R " << ( ( shadows() >> 0 ) & 0xff ) ;
2005 out <<
" G " << ( ( shadows() >> 8 ) & 0xff ) ;
2006 out <<
" B " << ( ( shadows() >> 16 ) & 0xff ) ;
2007 out <<
" I " << ( ( shadows() >> 24 ) & 0xff ) << std::endl;
2008 out <<
"titleText " << titleText() << std::endl;
2009 out <<
" R " << ( ( titleText() >> 0 ) & 0xff ) ;
2010 out <<
" G " << ( ( titleText() >> 8 ) & 0xff ) ;
2011 out <<
" B " << ( ( titleText() >> 16 ) & 0xff ) ;
2012 out <<
" I " << ( ( titleText() >> 24 ) & 0xff ) << std::endl;
2013 out <<
"fills " << fills() << std::endl;
2014 out <<
" R " << ( ( fills() >> 0 ) & 0xff ) ;
2015 out <<
" G " << ( ( fills() >> 8 ) & 0xff ) ;
2016 out <<
" B " << ( ( fills() >> 16 ) & 0xff ) ;
2017 out <<
" I " << ( ( fills() >> 24 ) & 0xff ) << std::endl;
2018 out <<
"accent " << accent() << std::endl;
2019 out <<
" R " << ( ( accent() >> 0 ) & 0xff ) ;
2020 out <<
" G " << ( ( accent() >> 8 ) & 0xff ) ;
2021 out <<
" B " << ( ( accent() >> 16 ) & 0xff ) ;
2022 out <<
" I " << ( ( accent() >> 24 ) & 0xff ) << std::endl;
2023 out <<
"accentAndHyperlink " << accentAndHyperlink() << std::endl;
2024 out <<
" R " << ( ( accentAndHyperlink() >> 0 ) & 0xff ) ;
2025 out <<
" G " << ( ( accentAndHyperlink() >> 8 ) & 0xff ) ;
2026 out <<
" B " << ( ( accentAndHyperlink() >> 16 ) & 0xff ) ;
2027 out <<
" I " << ( ( accentAndHyperlink() >> 24 ) & 0xff ) << std::endl;
2028 out <<
"accentAndFollowedHyperlink " << accentAndFollowedHyperlink() << std::endl;
2029 out <<
" R " << ( ( accentAndFollowedHyperlink() >> 0 ) & 0xff ) ;
2030 out <<
" G " << ( ( accentAndFollowedHyperlink() >> 8 ) & 0xff ) ;
2031 out <<
" B " << ( ( accentAndFollowedHyperlink() >> 16 ) & 0xff ) ;
2032 out <<
" I " << ( ( accentAndFollowedHyperlink() >> 24 ) & 0xff ) << std::endl;
2038const unsigned int CurrentUserAtom::id = 4086;
2040class CurrentUserAtom ::Private
2045 int offsetToCurrentEdit;
2052CurrentUserAtom::CurrentUserAtom ()
2057 d->offsetToCurrentEdit = 0;
2058 d->lenUserName = 0 ;
2059 d->docFileVersion = 0 ;
2060 d->majorVersion = 0;
2061 d->minorVersion = 0;
2064CurrentUserAtom::~CurrentUserAtom ()
2069int CurrentUserAtom::size()
const
2074void CurrentUserAtom::setSize(
int size )
2079int CurrentUserAtom::magic()
const
2084void CurrentUserAtom::setMagic(
int magic )
2089int CurrentUserAtom::offsetToCurrentEdit()
const
2091 return d->offsetToCurrentEdit;
2094void CurrentUserAtom::setOffsetToCurrentEdit(
int offsetToCurrentEdit )
2096 d->offsetToCurrentEdit = offsetToCurrentEdit;
2099int CurrentUserAtom::lenUserName()
const
2101 return d->lenUserName;
2104void CurrentUserAtom::setLenUserName(
int lenUserName )
2106 d->lenUserName = lenUserName;
2109int CurrentUserAtom::docFileVersion()
const
2111 return d->docFileVersion;
2114void CurrentUserAtom::setDocFileVersion(
int docFileVersion )
2116 d->docFileVersion = docFileVersion;
2119int CurrentUserAtom::majorVersion()
const
2121 return d->majorVersion;
2124void CurrentUserAtom::setMajorVersion(
int majorVersion )
2126 d->majorVersion = majorVersion;
2129int CurrentUserAtom::minorVersion()
const
2131 return d->minorVersion;
2134void CurrentUserAtom::setMinorVersion(
int minorVersion )
2136 d->minorVersion = minorVersion;
2139void CurrentUserAtom ::setData(
unsigned ,
const unsigned char* data )
2141 setSize( readU32( data + 0 ) );
2142 setMagic( readU32( data + 4 ) );
2143 setOffsetToCurrentEdit( readU32( data + 8 ) );
2144 setLenUserName( readU16( data + 12 ) );
2145 setDocFileVersion( readU32( data + 14 ) );
2146 setMajorVersion( data[18] );
2147 setMinorVersion( data[19] );
2150void CurrentUserAtom ::dump( std::ostream& out )
const
2152 out <<
" CurrentUserAtom" << std::endl;
2153 out <<
" size " << size() << std::endl;
2154 out <<
" magic " << magic() << std::endl;
2155 out <<
" offsetToCurrentEdit " << offsetToCurrentEdit() << std::endl;
2156 out <<
" lenUserName " << lenUserName() << std::endl;
2157 out <<
" docFileVersion " << docFileVersion() << std::endl;
2158 out <<
" majorVersion " << majorVersion() << std::endl;
2159 out <<
" minorVersion " << minorVersion() << std::endl;
2165const unsigned int UserEditAtom::id = 4085;
2167class UserEditAtom::Private
2173 unsigned long offsetLastEdit;
2174 unsigned long offsetPersistDir;
2175 unsigned long documentRef;
2178UserEditAtom::UserEditAtom()
2182 d->majorVersion = 0;
2183 d->minorVersion = 0;
2186UserEditAtom::~UserEditAtom()
2191int UserEditAtom::lastSlideId()
const
2193 return d->lastSlideId;
2196void UserEditAtom::setLastSlideId(
int id )
2198 d->lastSlideId = id;
2201int UserEditAtom::majorVersion()
const
2203 return d->majorVersion;
2206void UserEditAtom::setMajorVersion(
int majorVersion )
2208 d->majorVersion = majorVersion;
2211int UserEditAtom::minorVersion()
const
2213 return d->minorVersion;
2216void UserEditAtom::setMinorVersion(
int minorVersion )
2218 d->minorVersion = minorVersion;
2221unsigned long UserEditAtom::offsetLastEdit()
const
2223 return d->offsetLastEdit;
2226void UserEditAtom::setOffsetLastEdit(
unsigned long ofs )
2228 d->offsetLastEdit = ofs;
2231unsigned long UserEditAtom::offsetPersistDir()
const
2233 return d->offsetPersistDir;
2236void UserEditAtom::setOffsetPersistDir(
unsigned long ofs )
const
2238 d->offsetPersistDir = ofs;
2241unsigned long UserEditAtom::documentRef()
const
2243 return d->documentRef;
2246void UserEditAtom::setDocumentRef(
unsigned long ref )
const
2248 d->documentRef = ref;
2251void UserEditAtom::setData(
unsigned ,
const unsigned char* data )
2253 setLastSlideId( readU32( data + 0 ) );
2254 setMinorVersion( readU16( data + 4 ) );
2255 setMajorVersion( readU16( data + 6 ) );
2256 setOffsetLastEdit( readU32( data + 8 ) );
2257 setOffsetPersistDir( readU32( data + 12 ) );
2258 setDocumentRef( readU32( data + 16 ) );
2261void UserEditAtom::dump( std::ostream& out )
const
2263 out <<
" UserEditAtom" << std::endl;
2264 out <<
" LastSlideID " << lastSlideId() << std::endl;
2265 out <<
" MajorVersion " << majorVersion() << std::endl;
2266 out <<
" MinorVersion " << minorVersion() << std::endl;
2267 out <<
" Offset Last Edit " << offsetLastEdit() << std::endl;
2268 out <<
" Offset Persist Dir " << offsetPersistDir() << std::endl;
2269 out <<
" Document Ref " << documentRef() << std::endl;
2274const unsigned int TextBookmarkAtom::id = 4007;
2276class TextBookmarkAtom::Private
2284TextBookmarkAtom::TextBookmarkAtom()
2292TextBookmarkAtom::~TextBookmarkAtom()
2297int TextBookmarkAtom::begin()
const
2302void TextBookmarkAtom::setBegin(
int begin )
2307int TextBookmarkAtom::end()
const
2312void TextBookmarkAtom::setEnd(
int end )
2317int TextBookmarkAtom::bookmarkID()
const
2319 return d->bookmarkID;
2322void TextBookmarkAtom::setBookmarkID(
int bookmarkID )
2324 d->bookmarkID = bookmarkID;
2327void TextBookmarkAtom::setData(
unsigned ,
const unsigned char* data )
2329 setBegin( readU32( data + 0 ) );
2330 setEnd( readU32( data + 4 ) );
2331 setBookmarkID( readU32( data + 8 ) );
2334void TextBookmarkAtom::dump( std::ostream& out )
const
2336 out <<
"TextBookmarkAtom" << std::endl;
2337 out <<
"begin " << begin() << std::endl;
2338 out <<
"end " << end() << std::endl;
2339 out <<
"bookmarkID " << bookmarkID() << std::endl;
2344const unsigned int BookmarkEntityAtom::id = 4048;
2346class BookmarkEntityAtom::Private
2353BookmarkEntityAtom::BookmarkEntityAtom()
2357 d->bookmarkName = 0;
2360BookmarkEntityAtom::~BookmarkEntityAtom()
2365int BookmarkEntityAtom::bookmarkID()
const
2367 return d->bookmarkID;
2370void BookmarkEntityAtom::setBookmarkID(
int bookmarkID )
2372 d->bookmarkID = bookmarkID;
2375int BookmarkEntityAtom::bookmarkName()
const
2377 return d->bookmarkName;
2380void BookmarkEntityAtom::setBookmarkName(
int bookmarkName )
2382 d->bookmarkName = bookmarkName;
2385void BookmarkEntityAtom::setData(
unsigned ,
const unsigned char* data )
2387 setBookmarkID( readU32( data + 0 ) );
2388 setBookmarkName( readU16( data + 4 ) );
2391void BookmarkEntityAtom::dump( std::ostream& out )
const
2393 out <<
"BookmarkEntityAtom" << std::endl;
2394 out <<
"bookmarkID " << bookmarkID() << std::endl;
2395 out <<
"bookmarkName " << bookmarkName() << std::endl;
2400const unsigned int SSDocInfoAtom::id = 1025;
2402class SSDocInfoAtom::Private
2416SSDocInfoAtom::SSDocInfoAtom()
2420 d->penColorGreen = 0;
2421 d->penColorBlue = 0;
2422 d->penColorIndex = 0;
2430SSDocInfoAtom::~SSDocInfoAtom()
2435int SSDocInfoAtom::penColorRed()
const
2437 return d->penColorRed;
2440void SSDocInfoAtom::setPenColorRed(
int penColorRed )
2442 d->penColorRed = penColorRed;
2445int SSDocInfoAtom::penColorGreen()
const
2447 return d->penColorGreen;
2450void SSDocInfoAtom::setPenColorGreen(
int penColorGreen )
2452 d->penColorGreen = penColorGreen;
2455int SSDocInfoAtom::penColorBlue()
const
2457 return d->penColorBlue;
2460void SSDocInfoAtom::setPenColorBlue(
int penColorBlue )
2462 d->penColorBlue = penColorBlue;
2465int SSDocInfoAtom::penColorIndex()
const
2467 return d->penColorIndex;
2470void SSDocInfoAtom::setPenColorIndex(
int penColorIndex )
2472 d->penColorIndex = penColorIndex;
2475int SSDocInfoAtom::restartTime()
const
2477 return d->restartTime;
2480void SSDocInfoAtom::setRestartTime(
int restartTime )
2482 d->restartTime = restartTime;
2485int SSDocInfoAtom::startSlide()
const
2487 return d->startSlide;
2490void SSDocInfoAtom::setStartSlide(
int startSlide )
2492 d->startSlide = startSlide;
2495int SSDocInfoAtom::endSlide()
const
2500void SSDocInfoAtom::setEndSlide(
int endSlide )
2502 d->endSlide = endSlide;
2505int SSDocInfoAtom::namedShow()
const
2507 return d->namedShow;
2510void SSDocInfoAtom::setNamedShow(
int namedShow )
2512 d->namedShow = namedShow;
2515int SSDocInfoAtom::flags()
const
2520void SSDocInfoAtom::setFlags(
int flags )
2525void SSDocInfoAtom::setData(
unsigned ,
const unsigned char* data )
2527 setPenColorRed( data[0] );
2528 setPenColorGreen( data[1] );
2529 setPenColorBlue( data[2]);
2530 setPenColorIndex( data[3] );
2531 setRestartTime( readS32( data + 4 ) );
2532 setStartSlide( readS16( data + 8 ) );
2533 setEndSlide( readS16( data + 10 ) );
2534 setNamedShow( readU16( data + 12 ) );
2535 setFlags( readU16( data + 76 ) );
2538void SSDocInfoAtom::dump( std::ostream& out )
const
2540 out <<
"UserEditAtom" << std::endl;
2541 out <<
"penColorRed " << penColorRed() << std::endl;
2542 out <<
"penColorGreen " << penColorGreen() << std::endl;
2543 out <<
"penColorBlue " << penColorBlue() << std::endl;
2544 out <<
"penColorIndex " << penColorIndex() << std::endl;
2545 out <<
"restartTime " << restartTime() << std::endl;
2546 out <<
"startSlide " << startSlide() << std::endl;
2547 out <<
"endSlide " << endSlide() << std::endl;
2548 out <<
"namedShow " << namedShow() << std::endl;
2549 out <<
"Flags " << flags() << std::endl;
2554const unsigned int SrKinsokuAtom::id = 4050;
2556SrKinsokuAtom::SrKinsokuAtom()
2560SrKinsokuAtom::~SrKinsokuAtom()
2564void SrKinsokuAtom::dump( std::ostream& out )
const
2566 out <<
"SrKinsokuAtom - not yet implemented" << std::endl;
2571const unsigned int TxMasterStyleAtom::id = 4003;
2573TxMasterStyleAtom::TxMasterStyleAtom()
2577TxMasterStyleAtom::~TxMasterStyleAtom()
2581void TxMasterStyleAtom::dump( std::ostream& out )
const
2583 out <<
"TxMasterStyleAtom - not yet implemented" << std::endl;
2588const unsigned int SlideViewInfoAtom::id = 1022;
2590class SlideViewInfoAtom ::Private
2598SlideViewInfoAtom::SlideViewInfoAtom ()
2606SlideViewInfoAtom::~SlideViewInfoAtom ()
2611int SlideViewInfoAtom::showGuides()
const
2613 return d->showGuides;
2616void SlideViewInfoAtom::setShowGuides(
int showGuides)
2618 d->showGuides= showGuides;
2621int SlideViewInfoAtom::snapToGrid()
const
2623 return d->snapToGrid;
2626void SlideViewInfoAtom::setSnapToGrid(
int snapToGrid)
2628 d->snapToGrid= snapToGrid;
2631int SlideViewInfoAtom::snapToShape()
const
2633 return d->snapToShape;
2636void SlideViewInfoAtom::setSnapToShape(
int snapToShape)
2638 d->snapToGrid= snapToShape;
2641void SlideViewInfoAtom ::setData(
unsigned ,
const unsigned char* data )
2643 setShowGuides(data[0]);
2644 setSnapToGrid(data[1]);
2645 setSnapToShape(data[2]);
2648void SlideViewInfoAtom ::dump( std::ostream& out )
const
2650 out <<
"SlideViewInfoAtom" << std::endl;
2651 out <<
"showGuides " << showGuides() << std::endl;
2652 out <<
"snapToGrid " << snapToGrid() << std::endl;
2653 out <<
"snapToShape " << snapToShape() << std::endl;
2658const unsigned int ViewInfoAtom::id = 1021;
2660class ViewInfoAtom ::Private
2680ViewInfoAtom::ViewInfoAtom ()
2683 d->curScaleXNum = 0;
2684 d->curScaleXDen = 0;
2685 d->curScaleYNum = 0;
2686 d->curScaleYDen = 0;
2687 d->prevScaleXNum = 0;
2688 d->prevScaleXDen = 0;
2689 d->prevScaleYNum = 0;
2690 d->prevScaleYDen = 0;
2700ViewInfoAtom::~ViewInfoAtom ()
2705int ViewInfoAtom::varScale()
const
2710void ViewInfoAtom::setVarScale(
int varScale)
2712 d->varScale= varScale;
2715int ViewInfoAtom::draftMode()
const
2717 return d->draftMode;
2720void ViewInfoAtom::setDraftMode(
int draftMode)
2722 d->draftMode= draftMode;
2725int ViewInfoAtom::padding()
const
2730void ViewInfoAtom::setPadding(
int padding)
2732 d->padding= padding;
2735int ViewInfoAtom::viewSizeX()
const
2737 return d->viewSizeX;
2740void ViewInfoAtom::setViewSizeX(
int viewSizeX)
2742 d->viewSizeX= viewSizeX;
2745int ViewInfoAtom::viewSizeY()
const
2747 return d->viewSizeY;
2750void ViewInfoAtom::setViewSizeY(
int viewSizeY)
2752 d->viewSizeY= viewSizeY;
2755int ViewInfoAtom::originX()
const
2760void ViewInfoAtom::setOriginX(
int originX)
2762 d->originX= originX;
2765int ViewInfoAtom::originY()
const
2770void ViewInfoAtom::setOriginY (
int originY)
2772 d->originY= originY;
2775int ViewInfoAtom::prevScaleXNum()
const
2777 return d->prevScaleXNum;
2780void ViewInfoAtom::setPrevScaleXNum(
int prevScaleXNum)
2782 d->prevScaleXNum= prevScaleXNum;
2785int ViewInfoAtom::prevScaleXDen()
const
2787 return d->prevScaleXDen;
2790void ViewInfoAtom::setPrevScaleXDen(
int prevScaleXDen)
2792 d->prevScaleXDen= prevScaleXDen;
2795int ViewInfoAtom::prevScaleYNum()
const
2797 return d->prevScaleYNum;
2800void ViewInfoAtom::setPrevScaleYNum(
int prevScaleYNum)
2802 d->prevScaleYNum= prevScaleYNum;
2805int ViewInfoAtom::prevScaleYDen()
const
2807 return d->prevScaleYDen;
2810void ViewInfoAtom::setPrevScaleYDen(
int prevScaleYDen)
2812 d->prevScaleYDen= prevScaleYDen;
2815int ViewInfoAtom::curScaleXNum()
const
2817 return d->curScaleXNum;
2820void ViewInfoAtom::setCurScaleXNum(
int curScaleXNum)
2822 d->curScaleXNum= curScaleXNum;
2825int ViewInfoAtom::curScaleXDen()
const
2827 return d->curScaleXDen;
2830void ViewInfoAtom::setCurScaleXDen(
int curScaleXDen)
2832 d->curScaleXDen= curScaleXDen;
2835int ViewInfoAtom::curScaleYNum()
const
2837 return d->curScaleYNum;
2840void ViewInfoAtom::setCurScaleYNum(
int curScaleYNum)
2842 d->curScaleYNum= curScaleYNum;
2845int ViewInfoAtom::curScaleYDen()
const
2847 return d->curScaleYDen;
2850void ViewInfoAtom::setCurScaleYDen(
int curScaleYDen)
2852 d->curScaleYDen= curScaleYDen;
2855void ViewInfoAtom ::setData(
unsigned ,
const unsigned char* data )
2857 setCurScaleXNum(readS32( data + 0));
2858 setCurScaleXDen(readS32( data + 4 ));
2859 setCurScaleYNum(readS32( data + 8));
2860 setCurScaleYDen(readS32( data + 12 ));
2861 setPrevScaleXNum(readS32( data + 16 ));
2862 setPrevScaleXDen(readS32( data + 20 ));
2863 setPrevScaleYNum(readS32( data + 24 ));
2864 setPrevScaleYDen(readS32( data + 28 ));
2865 setViewSizeX(readS32( data + 32 ));
2866 setViewSizeY(readS32( data + 36 ));
2867 setOriginX(readS32( data + 40 ));
2868 setOriginY(readS32( data + 44));
2869 setVarScale(data[48]);
2870 setDraftMode(data[49]);
2871 setPadding(readU16( data + 50 ));
2874void ViewInfoAtom ::dump( std::ostream& out )
const
2876 out <<
"ViewInfoAtom" << std::endl;
2877 out <<
"curScaleXNum " << curScaleXNum() << std::endl;
2878 out <<
"curScaleXDen " << curScaleXDen() << std::endl;
2879 out <<
"curScaleYNum " << curScaleYNum() << std::endl;
2880 out <<
"curScaleYDen " << curScaleYDen() << std::endl;
2881 out <<
"prevScaleXNum " << prevScaleXNum() << std::endl;
2882 out <<
"prevScaleXDen " << prevScaleXNum() << std::endl;
2883 out <<
"prevScaleYNum " << prevScaleYNum() << std::endl;
2884 out <<
"prevScaleYDen " << prevScaleYNum() << std::endl;
2885 out <<
"viewSizeX " << viewSizeX() << std::endl;
2886 out <<
"viewSizeY " << viewSizeY() << std::endl;
2887 out <<
"originX " << originX() << std::endl;
2888 out <<
"originY " << originY() << std::endl;
2889 out <<
"varScale " << varScale() << std::endl;
2890 out <<
"draftMode " << draftMode() << std::endl;
2891 out <<
"padding " << padding() << std::endl;
2896const unsigned int StyleTextPropAtom ::id = 4001;
2898class StyleTextPropAtom::Private
2901 unsigned stringLength;
2909 , bulletHardColor(0)
2927 unsigned bulletHardFont;
2928 unsigned bulletHardColor;
2929 unsigned bulletChar;
2930 unsigned bulletFont;
2931 unsigned bulletHeight;
2932 unsigned bulletColor;
2942 std::vector<PropAtomData> atomData;
2949StyleTextPropAtom::StyleTextPropAtom()
2957StyleTextPropAtom::~StyleTextPropAtom()
2962unsigned StyleTextPropAtom::listSize()
const
2964 return d->atomData.size();
2967int StyleTextPropAtom::charCount(
unsigned index )
const
2969 return d->atomData[index].charCount;
2972int StyleTextPropAtom::depth(
unsigned index )
const
2974 return d->atomData[index].depth;
2977int StyleTextPropAtom::bulletOn(
unsigned index )
const
2979 return d->atomData[index].bulletOn;
2982int StyleTextPropAtom::bulletHardFont(
unsigned index )
const
2984 return d->atomData[index].bulletHardFont;
2987int StyleTextPropAtom::bulletHardColor(
unsigned index )
const
2989 return d->atomData[index].bulletHardColor;
2992int StyleTextPropAtom::bulletChar(
unsigned index )
const
2994 return d->atomData[index].bulletChar;
2997int StyleTextPropAtom::bulletFont(
unsigned index )
const
2999 return d->atomData[index].bulletFont;
3002int StyleTextPropAtom::bulletHeight(
unsigned index )
const
3004 return d->atomData[index].bulletHeight;
3007int StyleTextPropAtom::bulletColor(
unsigned index )
const
3009 return d->atomData[index].bulletColor;
3012int StyleTextPropAtom::lineFeed(
unsigned index )
const
3014 return d->atomData[index].lineFeed;
3017int StyleTextPropAtom::upperDist(
unsigned index )
const
3019 return d->atomData[index].upperDist;
3022int StyleTextPropAtom::lowerDist(
unsigned index )
const
3024 return d->atomData[index].lowerDist;
3027int StyleTextPropAtom::align(
unsigned index )
const
3029 return d->atomData[index].align;
3032int StyleTextPropAtom::asianLB1(
unsigned index )
const
3034 return d->atomData[index].asianLB1;
3037int StyleTextPropAtom::asianLB2(
unsigned index )
const
3039 return d->atomData[index].asianLB2;
3042int StyleTextPropAtom::asianLB3(
unsigned index )
const
3044 return d->atomData[index].asianLB3;
3047int StyleTextPropAtom::biDi(
unsigned index )
const
3049 return d->atomData[index].biDi;
3052int StyleTextPropAtom::charMask()
const
3057void StyleTextPropAtom::setCharMask(
int charMask )
3059 d->charMask = charMask;
3062int StyleTextPropAtom::charFlags()
const
3064 return d->charFlags;
3067void StyleTextPropAtom::setCharFlags(
int charFlags )
3069 d->charFlags = charFlags;
3072void StyleTextPropAtom::setData(
unsigned ,
const unsigned char* data,
unsigned lastSize )
3074 unsigned charRead = 0;
3075 unsigned charCount = 0;
3076 unsigned stringLength = unsigned( (0.5*lastSize) + 1 );
3078 bool isTextPropAtom =
true;
3081 while ( charRead < stringLength )
3083 if ( isTextPropAtom ==
true )
3085 Private::PropAtomData atomData;
3086 charCount = readU32(data+k) - 1;
3088 atomData.charCount = charCount;
3089 atomData.depth = readU16(data+k);
3091 unsigned mask = readU32(data+6);
3096 int bulletFlag = readU16(data+k);
3098 atomData.bulletOn = ( bulletFlag & 1 ) ? 1 : 0;
3099 atomData.bulletHardFont = ( bulletFlag & 2 ) ? 1 : 0;
3100 atomData.bulletHardColor = ( bulletFlag & 4 ) ? 1 : 0;
3103 if ( mask & 0x0080 )
3105 atomData.bulletChar = readU16(data+k);
3109 if ( mask & 0x0010 )
3111 atomData.bulletFont = readU16(data+k);
3115 if ( mask & 0x0040 )
3117 atomData.bulletHeight = readU16(data+k);
3121 if ( mask & 0x0020 )
3123 atomData.bulletColor = readU32(data+k);
3127 if ( mask & 0x0F00 )
3131 unsigned dummy = readU16(data+k);
3132 atomData.align = ( dummy & 3 );
3152 if ( mask & 0x1000 )
3154 atomData.lineFeed = readU16(data+k);
3158 if ( mask & 0x2000 )
3160 atomData.upperDist = readU16(data+k);
3164 if ( mask & 0x4000 )
3166 atomData.lowerDist = readU16(data+k);
3170 if ( mask & 0x8000 )
3176 if ( mask & 0x10000 )
3182 if ( mask & 0xe0000 )
3184 unsigned dummy = readU16(data+k);
3185 if ( mask & 0x20000 )
3186 atomData.asianLB1 = dummy & 1;
3187 if ( mask & 0x40000 )
3188 atomData.asianLB2 = (dummy >> 1) & 1;
3189 if ( mask & 0x80000 )
3190 atomData.asianLB3 = (dummy >> 2) & 1;
3195 if ( mask & 0x200000 )
3197 atomData.biDi = readU16(data+k);
3200 d->atomData.push_back( atomData );
3204 std::cout <<
"isTextPropAtom == false " << std::endl;
3205 charCount = stringLength;
3206 Private::PropAtomData atomData;
3207 atomData.charCount = charCount;
3208 d->atomData.push_back( atomData );
3211 if ( ( charCount > stringLength ) || ( stringLength - ( charRead + charCount ) < 0 ) )
3213 isTextPropAtom =
false;
3214 charCount = stringLength - charRead;
3215 Private::PropAtomData atomData;
3216 atomData.charCount = charCount;
3217 d->atomData.push_back( atomData );
3220 charRead += charCount + 1;
3326void StyleTextPropAtom::dump( std::ostream& out )
const
3328 out <<
"StyleTextPropAtom" << std::endl;
3329 out <<
"listSize " << listSize() << std::endl << std::endl;
3330 for (
unsigned i = 0; i < listSize(); i++)
3332 out <<
"charCount " << charCount(i) << std::endl;
3333 out <<
"depth " << depth(i) << std::endl;
3334 out <<
"isBulletOn " << bulletOn(i) << std::endl;
3335 out <<
"isbulletHardFont " << bulletHardFont(i) << std::endl;
3336 out <<
"isbulletHardColor " << bulletHardColor(i) << std::endl;
3337 out <<
"bulletChar " << bulletChar(i) << std::endl;
3338 out <<
"bulletFont " << bulletFont(i) << std::endl;
3339 out <<
"bulletHeight " << bulletHeight(i) << std::endl;
3340 out <<
"bulletColor " << std::endl;
3341 out <<
" R " << ((bulletColor(i) >>0) & 0xff) << std::endl;
3342 out <<
" G " << ((bulletColor(i) >>8) & 0xff) << std::endl;
3343 out <<
" B " << ((bulletColor(i) >>16) & 0xff) << std::endl;
3344 out <<
" I " << ((bulletColor(i) >>24) & 0xff) << std::endl;
3345 out <<
"align " << align(i) << std::endl;
3346 out <<
"lineFeed " << lineFeed(i) << std::endl;
3347 out <<
"upperDist " << upperDist(i) << std::endl;
3348 out <<
"lowerDist " << lowerDist(i) << std::endl;
3349 out <<
"biDi " << biDi(i) << std::endl;
3362const unsigned int TxCFStyleAtom ::id = 4004;
3365class TxCFStyleAtom ::Private
3376TxCFStyleAtom ::TxCFStyleAtom ()
3387TxCFStyleAtom ::~TxCFStyleAtom ()
3392int TxCFStyleAtom::flags1()
const
3397void TxCFStyleAtom::setFlags1(
int flags1 )
3402int TxCFStyleAtom::flags2()
const
3407void TxCFStyleAtom::setFlags2(
int flags2 )
3412int TxCFStyleAtom::flags3()
const
3417void TxCFStyleAtom::setFlags3(
int flags3 )
3422int TxCFStyleAtom::n1()
const
3427void TxCFStyleAtom::setN1(
int n1 )
3432int TxCFStyleAtom::fontHeight()
const
3434 return d->fontHeight;
3437void TxCFStyleAtom::setFontHeight(
int fontHeight )
3439 d->fontHeight = fontHeight;
3442int TxCFStyleAtom::fontColor()
const
3444 return d->fontColor;
3447void TxCFStyleAtom::setFontColor(
int fontColor )
3449 d->fontColor = fontColor;
3452void TxCFStyleAtom::setData(
unsigned ,
const unsigned char* data )
3454 setFlags1(readU16( data + 0));
3455 setFlags2(readU16( data + 2));
3456 setFlags3(readU16( data + 4));
3457 setN1(readU32( data + 6));
3458 setFontHeight(readU16( data + 10));
3459 setFontColor(readU32( data + 12));
3462void TxCFStyleAtom ::dump( std::ostream& out )
const
3464 out <<
"TxCFStyleAtom " << std::endl;
3465 out <<
"flags1 " << flags1() << std::endl;
3466 out <<
"flags2 " << flags2() << std::endl;
3467 out <<
"flags3 " << flags3() << std::endl;
3468 out <<
"n1 " << n1() << std::endl;
3469 out <<
"font height " << fontHeight() << std::endl;
3470 out <<
"font color " << fontColor() << std::endl;
3475const unsigned int TxPFStyleAtom::id = 4005;
3477TxPFStyleAtom::TxPFStyleAtom()
3481TxPFStyleAtom::~TxPFStyleAtom()
3485void TxPFStyleAtom::dump( std::ostream& out )
const
3487 out <<
"TxPFStyleAtom - need special parse code" << std::endl;
3492const unsigned int TxSIStyleAtom ::id = 4009;
3494TxSIStyleAtom ::TxSIStyleAtom ()
3498TxSIStyleAtom ::~TxSIStyleAtom ()
3502void TxSIStyleAtom ::dump( std::ostream& out )
const
3504 out <<
"TxSIStyleAtom - need special parse code" << std::endl;
3509const unsigned int Record1043::id = 1043;
3511Record1043::Record1043()
3515void Record1043::dump( std::ostream& out )
const
3517 out <<
"Record1043 - not known" << std::endl;
3522const unsigned int Record1044::id = 1044;
3524Record1044::Record1044()
3528void Record1044::dump( std::ostream& out )
const
3530 out <<
"Record1044 - not known" << std::endl;
3535const unsigned int SlideAtom::id = 1007;
3537class SlideAtom::Private
3541 int layoutPlaceholderId1;
3542 int layoutPlaceholderId2;
3543 int layoutPlaceholderId3;
3544 int layoutPlaceholderId4;
3545 int layoutPlaceholderId5;
3546 int layoutPlaceholderId6;
3547 int layoutPlaceholderId7;
3548 int layoutPlaceholderId8;
3554SlideAtom::SlideAtom()
3558 d->layoutPlaceholderId1 = 0;
3559 d->layoutPlaceholderId2 = 0;
3560 d->layoutPlaceholderId3 = 0;
3561 d->layoutPlaceholderId4 = 0;
3562 d->layoutPlaceholderId5 = 0;
3563 d->layoutPlaceholderId6 = 0;
3564 d->layoutPlaceholderId7 = 0;
3565 d->layoutPlaceholderId8 = 0;
3571SlideAtom::~SlideAtom()
3576int SlideAtom::layoutGeom()
const
3578 return d->layoutGeom;
3581void SlideAtom::setLayoutGeom(
int layoutGeom )
3583 d->layoutGeom = layoutGeom;
3587int SlideAtom::layoutPlaceholderId()
const
3589 return d->layoutPlaceholderId1;
3590 return d->layoutPlaceholderId2;
3591 return d->layoutPlaceholderId3;
3592 return d->layoutPlaceholderId4;
3593 return d->layoutPlaceholderId5;
3594 return d->layoutPlaceholderId6;
3595 return d->layoutPlaceholderId7;
3596 return d->layoutPlaceholderId8;
3599void SlideAtom::setLayoutPlaceholderId(
int layoutPlaceholderId1,
int layoutPlaceholderId2,
int layoutPlaceholderId3,
int layoutPlaceholderId4,
int layoutPlaceholderId5,
int layoutPlaceholderId6,
int layoutPlaceholderId7,
int layoutPlaceholderId8)
3601 d->layoutPlaceholderId1 = layoutPlaceholderId1;
3602 d->layoutPlaceholderId2 = layoutPlaceholderId2;
3603 d->layoutPlaceholderId3 = layoutPlaceholderId3;
3604 d->layoutPlaceholderId4 = layoutPlaceholderId4;
3605 d->layoutPlaceholderId5 = layoutPlaceholderId5;
3606 d->layoutPlaceholderId6 = layoutPlaceholderId6;
3607 d->layoutPlaceholderId7 = layoutPlaceholderId7;
3608 d->layoutPlaceholderId8 = layoutPlaceholderId8;
3611int SlideAtom::masterId()
const
3616void SlideAtom::setMasterId(
int masterId )
3618 d->masterId = masterId;
3621int SlideAtom::notesId()
const
3626void SlideAtom::setNotesId(
int notesId)
3628 d->notesId = notesId;
3631int SlideAtom::flags()
const
3636void SlideAtom::setFlags(
int flags)
3641void SlideAtom::setData(
unsigned ,
const unsigned char* data )
3643 setLayoutGeom(readS32( data + 0 ) );
3644 setLayoutPlaceholderId (data[4], data[5], data[6], data[7], data[8], data[9], data[10],data[11]);
3645 setMasterId( readS32( data + 12 ) );
3646 setNotesId( readS32( data + 16 ) );
3647 setFlags( readU16( data + 20 ) );
3650void SlideAtom::dump( std::ostream& out )
const
3652 out <<
"SlideAtom" << std::endl;
3653 out <<
"layoutGeom " << layoutGeom() << std::endl;
3655 out <<
"layoutPlaceholderId1 " << d->layoutPlaceholderId1 <<std::endl;
3656 out <<
"layoutPlaceholderId2 " << d->layoutPlaceholderId2 <<std::endl;
3657 out <<
"layoutPlaceholderId3 " << d->layoutPlaceholderId3 <<std::endl;
3658 out <<
"layoutPlaceholderId4 " << d->layoutPlaceholderId4 <<std::endl;
3659 out <<
"layoutPlaceholderId5 " << d->layoutPlaceholderId5 <<std::endl;
3660 out <<
"layoutPlaceholderId6 " << d->layoutPlaceholderId6 <<std::endl;
3661 out <<
"layoutPlaceholderId7 " << d->layoutPlaceholderId7 <<std::endl;
3662 out <<
"layoutPlaceholderId8 " << d->layoutPlaceholderId8 <<std::endl;
3663 out <<
"masterId " << masterId() << std::endl;
3664 out <<
"notesId " << notesId() << std::endl;
3665 out <<
"flags " << flags() << std::endl;
3670const unsigned int SSSlideInfoAtom::id = 1017;
3672class SSSlideInfoAtom ::Private
3683SSSlideInfoAtom ::SSSlideInfoAtom ()
3694SSSlideInfoAtom ::~SSSlideInfoAtom ()
3699int SSSlideInfoAtom ::transType()
const
3701 return d->transType;
3704void SSSlideInfoAtom ::settransType(
int transType)
3706 d->transType = transType;
3709int SSSlideInfoAtom ::speed()
const
3711 return d->transType;
3714void SSSlideInfoAtom ::setspeed(
int speed)
3719int SSSlideInfoAtom ::direction()
const
3721 return d->transType;
3724void SSSlideInfoAtom ::setdirection(
int direction)
3726 d->direction = direction;
3729int SSSlideInfoAtom ::slideTime()
const
3731 return d->slideTime;
3734void SSSlideInfoAtom ::setslideTime(
int slideTime)
3736 d->slideTime = slideTime;
3739int SSSlideInfoAtom ::buildFlags()
const
3741 return d->buildFlags;
3744void SSSlideInfoAtom ::setbuildFlags(
int buildFlags)
3746 d->buildFlags = buildFlags;
3749int SSSlideInfoAtom ::soundRef()
const
3754void SSSlideInfoAtom ::setsoundRef(
int soundRef)
3756 d->soundRef = soundRef;
3759void SSSlideInfoAtom ::setData(
unsigned ,
const unsigned char* data )
3761 settransType( readU32( data + 0 ) );
3762 setspeed(readS32( data + 4 ));
3763 setdirection(readS32( data + 8 ));
3764 setslideTime(readS32( data + 12 ));
3765 setbuildFlags(readS32( data + 16 ));
3766 setsoundRef(readS32( data + 20 ));
3769void SSSlideInfoAtom ::dump( std::ostream& out )
const
3771 out <<
"SSSlideInfoAtom" << std::endl;
3772 out <<
"transType " << transType() << std::endl;
3773 out <<
"speed " << speed() << std::endl;
3774 out <<
"direction " << direction() << std::endl;
3775 out <<
"slideTime " << slideTime() << std::endl;
3776 out <<
"buildFlags " << buildFlags() << std::endl;
3777 out <<
"soundRef " << soundRef() << std::endl;
3782const unsigned int TextHeaderAtom::id = 3999;
3784class TextHeaderAtom ::Private
3790TextHeaderAtom ::TextHeaderAtom ()
3796TextHeaderAtom ::~TextHeaderAtom ()
3801int TextHeaderAtom ::textType()
const
3806void TextHeaderAtom ::setTextType(
int type )
3811void TextHeaderAtom ::setData(
unsigned size,
const unsigned char* data )
3813 if( size < 4 )
return;
3814 setTextType( readU32( data + 0 ) );
3817void TextHeaderAtom ::dump( std::ostream& out )
const
3819 out <<
"TextHeaderAtom" << std::endl;
3820 out <<
" textType " << textType() << std::endl;
3825const unsigned int TextBytesAtom::id = 4008;
3827class TextBytesAtom::Private
3830 std::vector<unsigned> index;
3831 std::vector<UString> ustring;
3832 unsigned stringLength;
3835TextBytesAtom::TextBytesAtom()
3840TextBytesAtom::~TextBytesAtom()
3845unsigned TextBytesAtom::listSize()
const
3847 return d->ustring.size();
3850unsigned TextBytesAtom::stringLength()
const
3852 return d->stringLength;
3855void TextBytesAtom::setStringLength(
unsigned stringLength )
3857 d->stringLength = stringLength;
3860UString TextBytesAtom::strValue(
unsigned index )
const
3862 return d->ustring[index];
3865void TextBytesAtom::setText(
UString ustring )
3867 d->ustring.push_back( ustring );
3870void TextBytesAtom::setData(
unsigned size,
const unsigned char* data )
3874 unsigned length = 0;
3875 for(
unsigned k=0; k<(size + 1); k++ )
3877 unsigned uchar = data[k];
3878 if ( (uchar == 0x0b) | (uchar == 0x0d) | (k == size) )
3885 tempStr.
append( UString(uchar) );
3887 if ( ( uchar & 0xff00 ) == 0xf000 )
3889 std::cout <<
"got a symbol at " << k <<
"th character" << std::endl;
3894 setStringLength(length);
3897void TextBytesAtom::dump( std::ostream& out )
const
3899 out <<
"TextBytesAtom" << std::endl;
3900 out <<
"stringLength " << stringLength() << std::endl;
3901 out <<
"listSize " << listSize() << std::endl;
3902 for (uint i=0; i<listSize() ; i++)
3904 out <<
"String " << i <<
" [" << strValue(i) <<
"]" << std::endl;
3912const unsigned int TextSpecInfoAtom::id = 4010;
3914class TextSpecInfoAtom::Private
3921TextSpecInfoAtom::TextSpecInfoAtom ()
3928TextSpecInfoAtom::~TextSpecInfoAtom ()
3933int TextSpecInfoAtom::charCount()
const
3935 return d->charCount;
3938void TextSpecInfoAtom::setCharCount(
int charCount)
3940 d->charCount = charCount;
3943int TextSpecInfoAtom::flags()
const
3948void TextSpecInfoAtom::setFlags(
int flags)
3953void TextSpecInfoAtom::setData(
unsigned ,
const unsigned char* data )
3955 setCharCount( readU32( data + 0 ) );
3956 setFlags( readU32( data + 4 ) );
3960void TextSpecInfoAtom::dump( std::ostream& out )
const
3962 out <<
"TextSpecInfoAtom" << std::endl;
3963 out <<
"charCount " << charCount() << std::endl;
3964 out <<
"flags " << flags() << std::endl;
3969const unsigned int SlidePersistAtom::id = 1011;
3971class SlidePersistAtom::Private
3981SlidePersistAtom::SlidePersistAtom ()
3984 d->psrReference = 0;
3991SlidePersistAtom::~SlidePersistAtom ()
3996int SlidePersistAtom::psrReference()
const
3998 return d->psrReference;
4001void SlidePersistAtom::setPsrReference(
int psrReference )
4003 d->psrReference = psrReference;
4006int SlidePersistAtom::flags()
const
4011void SlidePersistAtom::setFlags(
int flags )
4016int SlidePersistAtom::numberTexts()
const
4018 return d->numberTexts;
4021void SlidePersistAtom::setNumberTexts(
int numberTexts )
4023 d->numberTexts = numberTexts;
4026int SlidePersistAtom::slideId()
const
4031void SlidePersistAtom::setSlideId(
int slideId )
4033 d->slideId = slideId;
4036int SlidePersistAtom::reserved()
const
4041void SlidePersistAtom::setReserved(
int reserved )
4043 d->reserved = reserved;
4046void SlidePersistAtom::setData(
unsigned size,
const unsigned char* data )
4048 if( size < 20 )
return;
4050 setPsrReference( readU32( data + 0 ) );
4051 setFlags( readU32( data + 4 ) );
4052 setNumberTexts( readS32( data + 8 ) );
4053 setSlideId( readS32( data + 12 ) );
4054 setReserved(readU32( data + 16) );
4057void SlidePersistAtom ::dump( std::ostream& out )
const
4059 out <<
"SlidePersistAtom" << std::endl;
4060 out <<
"psrReference " << psrReference() << std::endl;
4061 out <<
"flags " << flags() << std::endl;
4062 out <<
"numberTexts " << numberTexts() << std::endl;
4063 out <<
"slideId " << slideId() << std::endl;
4064 out <<
"reserved " << reserved() <<
" always 0."<<std::endl;
4069const unsigned int msofbtDgAtom::id = 61448;
4071msofbtDgAtom ::msofbtDgAtom ()
4075msofbtDgAtom ::~msofbtDgAtom ()
4079void msofbtDgAtom ::dump( std::ostream& out )
const
4081 out <<
"msofbtDgAtom " << std::endl;
4086const unsigned int msofbtSpgrAtom::id = 61449;
4088msofbtSpgrAtom ::msofbtSpgrAtom ()
4092msofbtSpgrAtom ::~msofbtSpgrAtom ()
4096void msofbtSpgrAtom ::dump( std::ostream& out )
const
4098 out <<
"msofbtSpgrAtom " << std::endl;
4103const unsigned int msofbtSpAtom::id = 61450;
4105class msofbtSpAtom::Private
4108 unsigned long shapeId;
4109 unsigned long persistentFlag;
4115msofbtSpAtom ::msofbtSpAtom ()
4119 d->persistentFlag = 0;
4120 d->background =
false;
4125msofbtSpAtom ::~msofbtSpAtom ()
4130unsigned long msofbtSpAtom::shapeId()
const
4135void msofbtSpAtom::setShapeId(
unsigned long id )
4140const char* msofbtSpAtom::shapeTypeAsString()
const
4142 switch( instance() )
4144 case 0:
return "msosptMin";
4145 case 1:
return "msosptRectangle";
4146 case 2:
return "msosptRoundRectangle";
4147 case 3:
return "msosptEllipse";
4148 case 4:
return "msosptDiamond";
4149 case 5:
return "msosptIsoscelesTriangle";
4150 case 6:
return "msosptRightTriangle";
4151 case 7:
return "msosptParallelogram";
4152 case 8:
return "msosptTrapezoid";
4153 case 9:
return "msosptHexagon";
4154 case 10:
return "msosptOctagon";
4155 case 11:
return "msosptPlus";
4156 case 12:
return "msosptStar";
4157 case 13:
return "msosptArrow";
4158 case 14:
return "msosptThickArrow";
4159 case 15:
return "msosptHomePlate";
4160 case 16:
return "msosptCube";
4161 case 17:
return "msosptBalloon";
4162 case 18:
return "msosptSeal";
4163 case 19:
return "msosptArc";
4164 case 20:
return "msosptLine";
4165 case 21:
return "msosptPlaque";
4166 case 22:
return "msosptCan =";
4167 case 23:
return "msosptDonut";
4168 case 24:
return "msosptTextSimple";
4169 case 25:
return "msosptTextOctagon";
4170 case 26:
return "msosptTextHexagon";
4171 case 27:
return "msosptTextCurve";
4172 case 28:
return "msosptTextOnRing";
4173 case 29:
return "msosptTextRing";
4174 case 30:
return "msosptTextOnCurve";
4175 case 31:
return "msosptTextOnRing";
4176 case 32:
return "msosptStraightConnector1";
4177 case 75:
return "msosptPictureFrame";
4178 case 74:
return "msosptHeart";
4179 case 96:
return "msosptSmileyFace";
4180 case 202:
return "msosptTextBox";
4186unsigned long msofbtSpAtom::persistentFlag()
const
4188 return d->persistentFlag;
4191void msofbtSpAtom::setPersistentFlag(
unsigned long persistentFlag )
4193 d->persistentFlag = persistentFlag;
4196bool msofbtSpAtom::isBackground()
const
4198 return d->background;
4201void msofbtSpAtom::setBackground(
bool bg )
4206bool msofbtSpAtom::isVerFlip()
const
4211void msofbtSpAtom::setVerFlip(
bool vFlip )
4216bool msofbtSpAtom::isHorFlip()
const
4221void msofbtSpAtom::setHorFlip(
bool hFlip )
4226void msofbtSpAtom::setData(
unsigned size,
const unsigned char* data )
4228 if( size < 8 )
return;
4230 setShapeId( readU32( data + 0 ) );
4231 setPersistentFlag( readU32( data + 4 ) );
4233 unsigned flag = readU16( data + 4 );
4234 setBackground( flag & 0x800 );
4235 setVerFlip( flag & 0x80 );
4236 setHorFlip( flag & 0x40 );
4239void msofbtSpAtom ::dump( std::ostream& out )
const
4241 out <<
"msofbtSpAtom " << std::endl;
4246const unsigned int msofbtOPTAtom::id = 61451;
4248class msofbtOPTAtom::Private
4251 std::vector<unsigned> ids;
4252 std::vector<unsigned long> values;
4255msofbtOPTAtom ::msofbtOPTAtom ()
4260msofbtOPTAtom ::~msofbtOPTAtom ()
4265unsigned msofbtOPTAtom ::propertyCount()
const
4267 return d->ids.size();
4270unsigned msofbtOPTAtom ::propertyId(
unsigned index )
const
4272 return d->ids[index];
4275unsigned long msofbtOPTAtom ::propertyValue(
unsigned index )
const
4277 return d->values[index];
4280void msofbtOPTAtom::setProperty(
unsigned id,
unsigned long val )
4282 d->ids.push_back(
id );
4283 d->values.push_back( val );
4286void msofbtOPTAtom::setData(
unsigned size,
const unsigned char* data )
4289 unsigned comp_len = 0;
4296 unsigned x = readU16( data+i );
4297 unsigned int id = x & 0x3fff;
4298 bool comp = x & 0x8000;
4299 unsigned long val = readU32( data + i + 2 );
4303 setProperty(
id, val );
4307void msofbtOPTAtom ::dump( std::ostream& out )
const
4309 out <<
"msofbtOPTAtom " << std::endl;
4315const unsigned int msofbtChildAnchorAtom::id = 61455;
4317msofbtChildAnchorAtom ::msofbtChildAnchorAtom ()
4321msofbtChildAnchorAtom ::~msofbtChildAnchorAtom ()
4325void msofbtChildAnchorAtom ::dump( std::ostream& out )
const
4327 out <<
"msofbtChildAnchorAtom " << std::endl;
4332const unsigned int msofbtClientAnchorAtom::id = 61456;
4334class msofbtClientAnchorAtom::Private
4343msofbtClientAnchorAtom::msofbtClientAnchorAtom ()
4352msofbtClientAnchorAtom ::~msofbtClientAnchorAtom ()
4357int msofbtClientAnchorAtom ::left()
const
4362void msofbtClientAnchorAtom ::setLeft(
int left )
4367int msofbtClientAnchorAtom ::top()
const
4372void msofbtClientAnchorAtom ::setTop(
int top )
4377int msofbtClientAnchorAtom ::right()
const
4382void msofbtClientAnchorAtom ::setRight(
int right )
4387int msofbtClientAnchorAtom ::bottom()
const
4392void msofbtClientAnchorAtom ::setBottom(
int bottom )
4397void msofbtClientAnchorAtom ::setData(
unsigned ,
const unsigned char* data )
4399 setTop( readU16( data + 0 ) );
4400 setLeft( readU16( data + 2 ) );
4401 setRight( readU16( data + 4 ) );
4402 setBottom( readU16( data + 6 ) );
4405void msofbtClientAnchorAtom ::dump( std::ostream& out )
const
4407 out <<
"msofbtClientAnchorAtom " << std::endl;
4408 out <<
"left " << left() << std::endl;
4409 out <<
"top " << top() << std::endl;
4410 out <<
"right " << right() << std::endl;
4411 out <<
"bottom " << bottom() << std::endl;
4417const unsigned int msofbtClientDataAtom::id = 61457;
4419class msofbtClientDataAtom::Private
4422 unsigned placementId;
4423 unsigned placeholderId;
4426msofbtClientDataAtom::msofbtClientDataAtom ()
4430 d->placeholderId = 0;
4433msofbtClientDataAtom::~msofbtClientDataAtom ()
4438unsigned msofbtClientDataAtom::placementId()
const
4440 return d->placementId;
4443void msofbtClientDataAtom::setPlacementId(
unsigned id )
4445 d->placementId = id;
4448unsigned msofbtClientDataAtom::placeholderId()
const
4450 return d->placeholderId;
4453void msofbtClientDataAtom::setPlaceholderId(
unsigned id )
4455 d->placeholderId = id;
4458const char* msofbtClientDataAtom::placeholderIdAsString()
const
4460 switch( d->placeholderId )
4462 case 0:
return "None";
4463 case 1:
return "Master title";
4464 case 2:
return "Master body";
4465 case 3:
return "Master centered title";
4466 case 4:
return "Master notes slide image";
4467 case 5:
return "Master notes body image";
4468 case 6:
return "Master date";
4469 case 7:
return "Master slide number";
4470 case 8:
return "Master footer";
4471 case 9:
return "Master header";
4472 case 10:
return "Master subtitle";
4473 case 11:
return "Generic text object";
4474 case 12:
return "Title";
4475 case 13:
return "Body";
4476 case 14:
return "Notes body";
4477 case 15:
return "Centered title";
4478 case 16:
return "Subtitle";
4479 case 17:
return "Vertical text title";
4480 case 18:
return "Vertical text body";
4481 case 19:
return "Notes slide image";
4482 case 20:
return "Object";
4483 case 21:
return "Graph";
4484 case 22:
return "Table";
4485 case 23:
return "Clip Art";
4486 case 24:
return "Organization Chart";
4487 case 25:
return "Media Clip";
4502void msofbtClientDataAtom::setData(
unsigned size,
const unsigned char* data )
4504 if( size < 12 )
return;
4505 setPlacementId( readU16( data+8 ) );
4506 setPlaceholderId( data[12]-1 );
4509void msofbtClientDataAtom ::dump( std::ostream& out )
const
4511 out <<
"msofbtClientDataAtom " << std::endl;
4516const unsigned int msofbtDggAtom::id = 61446;
4518msofbtDggAtom ::msofbtDggAtom ()
4522msofbtDggAtom ::~msofbtDggAtom ()
4526void msofbtDggAtom ::dump( std::ostream& out )
const
4528 out <<
"msofbtDggAtom " << std::endl;
4533const unsigned int msofbtClientTextboxAtom::id = 61453;
4535class msofbtClientTextboxAtom::Private
4541msofbtClientTextboxAtom::msofbtClientTextboxAtom()
4546msofbtClientTextboxAtom::~msofbtClientTextboxAtom()
4551UString msofbtClientTextboxAtom::ustring()
const
4556void msofbtClientTextboxAtom::setUString(
const UString& ustr )
4561void msofbtClientTextboxAtom::setData(
unsigned size,
const unsigned char* data )
4564 for(
unsigned k=0; k<size/2; k++ )
4566 unsigned uchar = readU16( data + k*2 );
4567 str.
append( UString(uchar) );
4572void msofbtClientTextboxAtom::dump( std::ostream& out )
const
4574 out <<
"msofbtClientTextboxAtom" << std::endl;
4575 out <<
"String : [" << ustring() <<
"]" << std::endl;
4595const unsigned int msofbtDeletedPsplAtom::id = 61725;
4597msofbtDeletedPsplAtom ::msofbtDeletedPsplAtom ()
4601msofbtDeletedPsplAtom ::~msofbtDeletedPsplAtom ()
4605void msofbtDeletedPsplAtom ::dump( std::ostream& out )
const
4607 out <<
"msofbtDeletedPsplAtom " << std::endl;
4612const unsigned int msofbtAnchorAtom::id = 61454;
4614msofbtAnchorAtom ::msofbtAnchorAtom ()
4618msofbtAnchorAtom ::~msofbtAnchorAtom ()
4622void msofbtAnchorAtom ::dump( std::ostream& out )
const
4624 out <<
"msofbtAnchorAtom " << std::endl;
4629const unsigned int msofbtColorMRUAtom::id = 61722;
4631msofbtColorMRUAtom ::msofbtColorMRUAtom ()
4635msofbtColorMRUAtom ::~msofbtColorMRUAtom ()
4639void msofbtColorMRUAtom ::dump( std::ostream& out )
const
4641 out <<
"msofbtColorMRUAtom " << std::endl;
4646const unsigned int msofbtOleObjectAtom::id = 61727;
4648msofbtOleObjectAtom ::msofbtOleObjectAtom ()
4652msofbtOleObjectAtom ::~msofbtOleObjectAtom ()
4656void msofbtOleObjectAtom ::dump( std::ostream& out )
const
4658 out <<
"msofbtOleObjectAtom " << std::endl;
4663const unsigned int msofbtSplitMenuColorsAtom::id = 61726;
4665class msofbtSplitMenuColorsAtom::Private
4670 unsigned shadowColor;
4671 unsigned threeDColor;
4674msofbtSplitMenuColorsAtom ::msofbtSplitMenuColorsAtom ()
4683msofbtSplitMenuColorsAtom ::~msofbtSplitMenuColorsAtom ()
4688unsigned msofbtSplitMenuColorsAtom::fillColor()
const
4690 return d->fillColor;
4693void msofbtSplitMenuColorsAtom::setFillColor(
unsigned fillColor )
4695 d->fillColor = fillColor;
4698unsigned msofbtSplitMenuColorsAtom::lineColor()
const
4700 return d->lineColor;
4703void msofbtSplitMenuColorsAtom::setLineColor(
unsigned lineColor )
4705 d->lineColor = lineColor;
4708unsigned msofbtSplitMenuColorsAtom::shadowColor()
const
4710 return d->shadowColor;
4713void msofbtSplitMenuColorsAtom::setShadowColor(
unsigned shadowColor )
4715 d->shadowColor = shadowColor;
4718unsigned msofbtSplitMenuColorsAtom::threeDColor()
const
4720 return d->threeDColor;
4723void msofbtSplitMenuColorsAtom::setThreeDColor(
unsigned threeDColor )
4725 d->threeDColor = threeDColor;
4728void msofbtSplitMenuColorsAtom::setData(
unsigned ,
const unsigned char* data )
4730 setFillColor( readU32( data+0 ) );
4731 setLineColor( readU32( data+4 ) );
4732 setShadowColor( readU32( data+8 ) );
4733 setThreeDColor( readU32( data+12 ) );
4736void msofbtSplitMenuColorsAtom ::dump( std::ostream& out )
const
4738 out <<
"msofbtSplitMenuColorsAtom " << std::endl;
4739 out <<
"fillColor" << fillColor() << std::endl;
4740 out <<
"lineColor" << lineColor() << std::endl;
4741 out <<
"shadowColor" << shadowColor() << std::endl;
4742 out <<
"threeDColor" << threeDColor() << std::endl;
4747const unsigned int msofbtBSEAtom::id = 61447;
4749msofbtBSEAtom ::msofbtBSEAtom ()
4753msofbtBSEAtom ::~msofbtBSEAtom ()
4757void msofbtBSEAtom ::dump( std::ostream& out )
const
4759 out <<
"msofbtBSEAtom " << std::endl;
4764const unsigned int msofbtCLSIDAtom::id = 61462;
4766msofbtCLSIDAtom ::msofbtCLSIDAtom ()
4770msofbtCLSIDAtom ::~msofbtCLSIDAtom ()
4774void msofbtCLSIDAtom ::dump( std::ostream& out )
const
4776 out <<
"msofbtCLSIDAtom " << std::endl;
4781const unsigned int msofbtRegroupItemsAtom::id = 61720;
4783msofbtRegroupItemsAtom ::msofbtRegroupItemsAtom ()
4787msofbtRegroupItemsAtom ::~msofbtRegroupItemsAtom ()
4791void msofbtRegroupItemsAtom ::dump( std::ostream& out )
const
4793 out <<
"msofbtRegroupItemsAtom " << std::endl;
4798const unsigned int msofbtColorSchemeAtom::id = 61728;
4800msofbtColorSchemeAtom ::msofbtColorSchemeAtom ()
4804msofbtColorSchemeAtom ::~msofbtColorSchemeAtom ()
4808void msofbtColorSchemeAtom ::dump( std::ostream& out )
const
4810 out <<
"msofbtColorSchemeAtom " << std::endl;
4815const unsigned int msofbtConnectorRuleAtom::id = 61458;
4817msofbtConnectorRuleAtom ::msofbtConnectorRuleAtom ()
4821msofbtConnectorRuleAtom ::~msofbtConnectorRuleAtom ()
4825void msofbtConnectorRuleAtom ::dump( std::ostream& out )
const
4827 out <<
"msofbtConnectorRuleAtom " << std::endl;
4832const unsigned int msofbtAlignRuleAtom::id = 61459;
4834class msofbtAlignRuleAtom ::Private
4843msofbtAlignRuleAtom ::msofbtAlignRuleAtom ()
4850msofbtAlignRuleAtom ::~msofbtAlignRuleAtom ()
4855int msofbtAlignRuleAtom::ruid()
const
4860void msofbtAlignRuleAtom::setRuid(
int ruid )
4865int msofbtAlignRuleAtom::align()
const
4870void msofbtAlignRuleAtom::setAlign(
int ruid )
4875int msofbtAlignRuleAtom::cProxies()
const
4880void msofbtAlignRuleAtom::setCProxies(
int cProxies )
4882 d->cProxies = cProxies;
4885void msofbtAlignRuleAtom::setData(
unsigned ,
const unsigned char* data )
4887 setRuid( readU32( data+0 ) );
4888 setAlign( readU32( data+4 ) );
4889 setCProxies( readU32( data+8 ) );
4892void msofbtAlignRuleAtom ::dump( std::ostream& out )
const
4894 out <<
"msofbtAlignRuleAtom " << std::endl;
4895 out <<
"ruid" << ruid() << std::endl;
4896 out <<
"align " << align() << std::endl;
4897 out <<
"cProxies " << cProxies() << std::endl;
4903const unsigned int msofbtArcRuleAtom::id = 61460;
4905msofbtArcRuleAtom ::msofbtArcRuleAtom ()
4909msofbtArcRuleAtom ::~msofbtArcRuleAtom ()
4913void msofbtArcRuleAtom ::dump( std::ostream& out )
const
4915 out <<
"msofbtArcRuleAtom " << std::endl;
4920const unsigned int msofbtClientRuleAtom::id = 61461;
4922msofbtClientRuleAtom ::msofbtClientRuleAtom ()
4926msofbtClientRuleAtom ::~msofbtClientRuleAtom ()
4930void msofbtClientRuleAtom ::dump( std::ostream& out )
const
4932 out <<
"msofbtClientRuleAtom " << std::endl;
4937const unsigned int msofbtCalloutRuleAtom::id = 61463;
4939msofbtCalloutRuleAtom ::msofbtCalloutRuleAtom ()
4943msofbtCalloutRuleAtom ::~msofbtCalloutRuleAtom ()
4947void msofbtCalloutRuleAtom ::dump( std::ostream& out )
const
4949 out <<
"msofbtCalloutRuleAtom " << std::endl;
4954const unsigned int msofbtSelectionAtom::id = 61465;
4956msofbtSelectionAtom ::msofbtSelectionAtom ()
4960msofbtSelectionAtom ::~msofbtSelectionAtom ()
4964void msofbtSelectionAtom ::dump( std::ostream& out )
const
4966 out <<
"msofbtSelectionAtom " << std::endl;
4971class PPTReader::Private
4974 Libppt::Presentation* presentation;
4976 POLE::Stream* userStream;
4977 POLE::Stream* docStream;
4979 std::vector<long> persistenceList;
4980 std::map<int,Libppt::Slide*> slideMap;
4981 Libppt::Slide* currentSlide;
4982 unsigned currentTextType;
4983 unsigned currentTextId;
4985 GroupObject* currentGroup;
4986 Object* currentObject;
4991PPTReader::PPTReader()
4994 d->presentation = 0;
4999 d->persistenceList.clear();
5000 d->slideMap.clear();
5001 d->currentSlide = 0;
5002 d->currentTextType = 0;
5003 d->currentTextId = 0;
5004 d->isShapeGroup =
false;
5007PPTReader::~PPTReader()
5012bool PPTReader::load( Presentation* pr,
const char* filename )
5014 bool result =
false;
5017 d->presentation = pr;
5020 d->persistenceList.clear();
5021 d->slideMap.clear();
5022 d->currentSlide = 0;
5023 d->currentTextType = 0;
5024 d->currentTextId = 0;
5025 d->currentGroup = 0;
5026 d->currentObject = 0;
5027 d->isShapeGroup =
false;
5029 POLE::Storage storage( filename );
5030 if( !storage.open() )
5032 std::cerr <<
"Cannot open " << filename << std::endl;
5038 std::cout <<
"Loading file " << filename << std::endl;
5039 d->docStream =
new POLE::Stream( &storage,
"/PowerPoint Document" );
5040 d->userStream =
new POLE::Stream( &storage,
"/Current User" );
5042 if( d->docStream->fail() || d->userStream->fail() )
5046 std::cerr << filename <<
" is not PowerPoint presentation" << std::endl;
5047 delete d->docStream;
5056 d->presentation->clear();
5062 std::cout << std::endl << filename <<
" loaded. Done." << std::endl;
5067 delete d->docStream;
5068 delete d->userStream;
5069 d->presentation = 0;
5072 d->persistenceList.clear();
5073 d->slideMap.clear();
5074 d->currentSlide = 0;
5075 d->currentTextType = 0;
5076 d->currentTextId = 0;
5077 d->currentGroup = 0;
5078 d->currentObject = 0;
5079 d->isShapeGroup =
false;
5085void PPTReader::loadUserEdit()
5087 unsigned char buffer[128];
5088 unsigned long currentUserEditAtom = 0;
5089 std::vector<unsigned long> userEditList;
5090 std::vector<unsigned long> lastEditList;
5091 std::vector<unsigned long> persistDirList;
5092 std::vector<unsigned long> usefulPersistDirList;
5093 std::map<int,unsigned long> persistenceMap;
5096 std::cout << std::endl;
5097 std::cout <<
"Parsing Current User information" << std::endl;
5098 std::cout <<
"================================================" << std::endl;
5102 d->userStream->seek( 0 );
5103 unsigned bytes_read = d->userStream->read( buffer, 8 );
5104 if( bytes_read != 8 )
return;
5105 unsigned long type = readU16( buffer + 2 );
5106 unsigned long size = readU32( buffer + 4 );
5109 if( ( size < 20 ) || ( size >
sizeof(buffer) ) )
5111 std::cerr <<
"ERROR: CurrentUserAtom is not recognized" << std::endl;
5116 if( type != CurrentUserAtom::id )
5118 std::cerr <<
"ERROR: First in /Current User is not CurrentUserAtom" << std::endl;
5123 d->userStream->read( buffer, size );
5124 CurrentUserAtom* atom =
new CurrentUserAtom;
5125 atom->setData( size, buffer );
5126 currentUserEditAtom = atom->offsetToCurrentEdit();
5129 d->userStream->read( buffer, atom->lenUserName()*2 );
5130 std::cout <<
"Found username: ";
5131 for(
unsigned b=0; b<atom->lenUserName()*2; b+=2 )
5132 std::cout << (
char)buffer[b];
5133 std::cout << std::endl;
5135 atom->dump( std::cout );
5142 std::cout << std::endl;
5143 std::cout <<
"Scanning for all UserEdit atoms" << std::endl;
5144 std::cout <<
"================================================" << std::endl;
5147 d->docStream->seek( 0 );
5148 unsigned long stream_size = d->docStream->size();
5149 while( d->docStream->tell() < stream_size )
5152 unsigned long pos = d->docStream->tell();
5153 unsigned bytes_read = d->docStream->read( buffer, 8 );
5154 if( bytes_read != 8 )
break;
5156 unsigned long type = readU16( buffer + 2 );
5157 unsigned long size = readU32( buffer + 4 );
5158 unsigned long nextpos = d->docStream->tell() + size;
5161 if( type == UserEditAtom::id )
5162 if( size <
sizeof(buffer) )
5164 d->docStream->read( buffer, size );
5165 UserEditAtom* atom =
new UserEditAtom;
5166 atom->setData( size, buffer );
5167 userEditList.push_back( pos );
5168 lastEditList.push_back( atom->offsetLastEdit() );
5169 persistDirList.push_back( atom->offsetPersistDir() );
5171 std::cout <<
"Found at pos " << pos <<
" size is " << size << std::endl;
5173 atom->dump( std::cout );
5177 d->docStream->seek( nextpos );
5181 std::cout <<
"Found: " << userEditList.size() <<
" UserEdit atom(s) " << std::endl;
5185 std::cout << std::endl;
5186 std::cout <<
"Constructing UserEdit list" << std::endl;
5187 std::cout <<
"================================================" << std::endl;
5196 std::cout <<
"Searching for UserEdit at offset " << currentUserEditAtom << std::endl;
5199 for(
unsigned k=0; k < userEditList.size(); k++ )
5200 if( (userEditList[k] = currentUserEditAtom) )
5203 usefulPersistDirList.push_back( persistDirList[k] );
5204 currentUserEditAtom = lastEditList[k];
5206 std::cout <<
" found... ";
5207 std::cout <<
" persistence at offset " << persistDirList[k];
5208 if( lastEditList[k] != 0 )
5209 std::cout <<
" previous is " << lastEditList[k];
5210 std::cout << std::endl;
5215 while( !stop && (currentUserEditAtom!=0) );
5218 if( usefulPersistDirList.size() == 0 )
5220 std::cerr <<
"ERROR: No useful UserEdit information !" << std::endl;
5225 std::cout << std::endl;
5226 std::cout <<
"Searching for persistence information" << std::endl;
5227 std::cout <<
"================================================" << std::endl;
5232 for(
unsigned j = 0; j < usefulPersistDirList.size(); j++ )
5234 unsigned long offset = usefulPersistDirList[j];
5236 d->docStream->seek( 0 );
5237 while( d->docStream->tell() < stream_size )
5239 unsigned long pos = d->docStream->tell();
5240 unsigned bytes_read = d->docStream->read( buffer, 8 );
5241 if( bytes_read != 8 )
break;
5243 unsigned long type = readU16( buffer + 2 );
5244 unsigned long size = readU32( buffer + 4 );
5245 unsigned long nextpos = d->docStream->tell() + size;
5249 if( type == PersistIncrementalBlockAtom::id )
5251 unsigned char* buf =
new unsigned char[ size ];
5252 d->docStream->read( buf, size );
5253 PersistIncrementalBlockAtom* atom =
new PersistIncrementalBlockAtom;
5254 atom->setData( size, buf );
5259 std::cout <<
"Found at pos " << pos <<
" size is " << size << std::endl;
5260 atom->dump( std::cout );
5263 for(
unsigned m = 0; m < atom->entryCount(); m++ )
5265 unsigned long ref = atom->reference(m);
5266 unsigned long ofs = atom->offset(m);
5268 if( !persistenceMap.count( ref ) )
5269 persistenceMap[ref] = ofs;
5270 max = (ref > max) ? ref : max;
5275 d->docStream->seek( nextpos );
5280 for(
unsigned n = 0; n <= max; n++ )
5282 unsigned long ofs = -1;
5283 if( persistenceMap.count( n ) )
5284 ofs = persistenceMap[n];
5285 d->persistenceList.push_back( ofs );
5289 std::cout << std::endl;
5290 std::cout <<
"Final persistence list" << std::endl;
5291 for(
unsigned nn = 1; nn < d->persistenceList.size(); nn++ )
5292 std::cout <<
" #" << nn <<
": " << d->persistenceList[nn] << std::endl;
5293 std::cout << std::endl;
5298void PPTReader::loadMaster()
5301 std::cout << std::endl;
5302 std::cout <<
"Loading master" << std::endl;
5303 std::cout <<
"================================================" << std::endl;
5306 d->docStream->seek( 0 );
5307 unsigned long stream_size = d->docStream->size();
5308 while( d->docStream->tell() < stream_size )
5310 unsigned char buffer[8];
5311 unsigned long pos = d->docStream->tell();
5312 unsigned bytes_read = d->docStream->read( buffer, 8 );
5313 if( bytes_read != 8 )
break;
5315 unsigned long type = readU16( buffer + 2 );
5316 unsigned long size = readU32( buffer + 4 );
5317 unsigned long nextpos = d->docStream->tell() + size;
5320 if( type == MainMasterContainer::id )
5321 if( indexPersistence( pos ) )
5324 std::cout <<
"Found at pos " << pos <<
" size is " << size << std::endl;
5325 std::cout << std::endl;
5327 Slide* master =
new Slide( d->presentation );
5328 d->presentation->setMasterSlide( master );
5329 d->currentSlide = master;
5330 MainMasterContainer* container =
new MainMasterContainer;
5331 handleContainer( container, type, size );
5335 d->docStream->seek( nextpos );
5337 d->currentSlide = 0;
5340void PPTReader::loadSlides()
5343 std::cout << std::endl;
5344 std::cout <<
"Loading all slide containers" << std::endl;
5345 std::cout <<
"================================================" << std::endl;
5348 int totalSlides = 0;
5350 d->docStream->seek( 0 );
5351 unsigned long stream_size = d->docStream->size();
5352 while( d->docStream->tell() < stream_size )
5354 unsigned char buffer[8];
5355 unsigned long pos = d->docStream->tell();
5356 unsigned bytes_read = d->docStream->read( buffer, 8 );
5357 if( bytes_read != 8 )
break;
5359 unsigned long type = readU16( buffer + 2 );
5360 unsigned long size = readU32( buffer + 4 );
5361 unsigned long nextpos = d->docStream->tell() + size;
5366 if( type == SlideContainer::id )
5367 if( (k = indexPersistence( pos )) )
5370 Slide* s =
new Slide( d->presentation );
5371 d->slideMap[ k ] = s;
5372 d->presentation->appendSlide( s );
5373 d->currentSlide = s;
5374 d->currentTextId = 0;
5375 d->currentTextType = TextObject::Body;
5378 std::cout <<
"SLIDE #" << totalSlides+1 << std::endl;
5379 std::cout <<
"Found at pos " << pos <<
" size is " << size << std::endl;
5380 std::cout <<
"Reference #" << k << std::endl;
5381 std::cout << std::endl;
5385 SlideContainer* container =
new SlideContainer;
5386 handleContainer( container, type, size );
5392 d->docStream->seek( nextpos );
5397 std::cout << std::endl;
5398 std::cout <<
"Total: " << totalSlides <<
" slides" << std::endl;
5402void PPTReader::loadDocument()
5405 std::cout << std::endl;
5406 std::cout <<
"Loading document content" << std::endl;
5407 std::cout <<
"================================================" << std::endl;
5410 d->currentSlide = 0;
5411 d->currentGroup = 0;
5412 d->currentObject = 0;
5413 d->isShapeGroup =
false;
5415 d->docStream->seek( 0 );
5416 unsigned long stream_size = d->docStream->size();
5417 while( d->docStream->tell() < stream_size )
5419 unsigned char buffer[8];
5420 unsigned long pos = d->docStream->tell();
5421 unsigned bytes_read = d->docStream->read( buffer, 8 );
5422 if( bytes_read != 8 )
break;
5424 unsigned long type = readU16( buffer + 2 );
5425 unsigned long size = readU32( buffer + 4 );
5426 unsigned long nextpos = d->docStream->tell() + size;
5429 if( type == DocumentContainer::id )
5430 if( indexPersistence( pos ) )
5433 std::cout <<
"Found at pos " << pos <<
" size is " << size << std::endl;
5434 std::cout << std::endl;
5436 DocumentContainer* container =
new DocumentContainer;
5437 container->setPosition( pos );
5438 handleContainer( container, type, size );
5442 d->docStream->seek( nextpos );
5447int PPTReader::indexPersistence(
unsigned long ofs )
5449 for(
unsigned k=1; k < d->persistenceList.size(); k++ )
5450 if( (d->persistenceList[k] == ofs) )
5456void PPTReader::loadRecord( Record* parent )
5459 unsigned char buffer[65536];
5462 unsigned long pos = d->docStream->tell();
5463 unsigned bytes_read = d->docStream->read( buffer, 8 );
5464 if( bytes_read != 8 )
return;
5466 unsigned instance = readU16( buffer ) >> 4;
5467 unsigned long type = readU16( buffer + 2 );
5468 unsigned long size = readU32( buffer + 4 );
5469 unsigned long nextpos = d->docStream->tell() + size;
5472 Record* record = Record::create( type );
5475 record->setParent( parent );
5476 record->setPosition( pos );
5477 record->setInstance( instance );
5479 if( !record->isContainer() )
5481 d->docStream->read( buffer, size );
5483 if ( type == StyleTextPropAtom::id )
5484 record->setData(size, buffer, lastSize);
5486 record->setData( size, buffer );
5487 handleRecord( record, type );
5490 handleContainer(
static_cast<Container*
>( record ), type, size );
5495 d->docStream->seek( nextpos );
5498void PPTReader::handleRecord( Record* record,
int type )
5500 if( !record )
return;
5504 case DocumentAtom::id:
5505 handleDocumentAtom(
static_cast<DocumentAtom*
>(record) );
break;
5506 case SlidePersistAtom::id:
5507 handleSlidePersistAtom(
static_cast<SlidePersistAtom*
>(record) );
break;
5508 case TextHeaderAtom::id:
5509 handleTextHeaderAtom(
static_cast<TextHeaderAtom*
>(record) );
break;
5510 case TextCharsAtom::id:
5511 handleTextCharsAtom(
static_cast<TextCharsAtom*
>(record) );
break;
5512 case TextBytesAtom::id:
5513 handleTextBytesAtom(
static_cast<TextBytesAtom*
>(record) );
break;
5514 case StyleTextPropAtom::id:
5515 handleStyleTextPropAtom(
static_cast<StyleTextPropAtom*
>(record) );
break;
5516 case ColorSchemeAtom::id:
5517 handleColorSchemeAtom(
static_cast<ColorSchemeAtom*
>(record) );
break;
5519 case msofbtSpgrAtom::id:
5520 handleEscherGroupAtom(
static_cast<msofbtSpgrAtom*
>(record) );
break;
5521 case msofbtSpAtom::id:
5522 handleEscherSpAtom(
static_cast<msofbtSpAtom*
>(record) );
break;
5523 case msofbtOPTAtom::id:
5524 handleEscherPropertiesAtom(
static_cast<msofbtOPTAtom*
>(record) );
break;
5525 case msofbtClientDataAtom::id:
5526 handleEscherClientDataAtom(
static_cast<msofbtClientDataAtom*
>(record) );
break;
5527 case msofbtClientAnchorAtom::id:
5528 handleEscherClientAnchorAtom(
static_cast<msofbtClientAnchorAtom*
>(record) );
break;
5529 case msofbtClientTextboxAtom::id:
5530 handleEscherTextBoxAtom(
static_cast<msofbtClientTextboxAtom*
>(record) );
break;
5536void PPTReader::handleContainer( Container* container,
int type,
unsigned size )
5538 if( !container || !container->isContainer() )
return;
5540 unsigned long nextpos = d->docStream->tell() + size - 6;
5544 case msofbtDgContainer::id:
5545 handleDrawingContainer(
static_cast<msofbtDgContainer*
>(container), size );
break;
5546 case msofbtSpgrContainer::id:
5547 handleEscherGroupContainer(
static_cast<msofbtSpgrContainer*
>(container), size );
break;
5548 case msofbtSpContainer::id:
5549 handleSPContainer(
static_cast<msofbtSpContainer*
>(container), size );
break;
5551 while( d->docStream->tell() < nextpos )
5552 loadRecord( container );
5556void PPTReader::handleDocumentAtom( DocumentAtom* atom )
5559 if( !d->presentation )
return;
5561 double pageWidth = atom->slideWidth() * 0.125;
5562 double pageHeight = atom->slideHeight() * 0.125;
5564 d->presentation->masterSlide()->setPageWidth( pageWidth );
5565 d->presentation->masterSlide()->setPageHeight ( pageHeight );
5568 std::cout << std::endl<<
"page width = " << pageWidth << std::endl;
5569 std::cout << std::endl<<
"page height = " << pageHeight << std::endl;
5573void PPTReader::handleSlidePersistAtom( SlidePersistAtom* atom )
5576 if( !d->presentation )
return;
5579 unsigned ref = atom->psrReference();
5581 d->currentSlide = d->slideMap[ ref ];
5582 d->currentTextId = 0;
5583 d->currentTextType = TextObject::Body;
5586 std::cout << std::endl<<
"Slide id = " <<
id << std::endl;
5590void PPTReader::handleTextHeaderAtom( TextHeaderAtom* atom )
5593 if( !d->presentation )
return;
5594 if( !d->currentSlide )
return;
5597 d->currentTextType = atom->textType();
5600void PPTReader::handleTextCharsAtom( TextCharsAtom* atom )
5603 if( !d->presentation )
return;
5604 if( !d->currentSlide )
return;
5605 if( !d->currentTextId )
return;
5607 int placeId = d->currentTextId-1;
5608 TextObject* text = d->currentSlide->textObject( placeId );
5611 std::cerr <<
"No place for text object! " << placeId << std::endl;
5615 text->setType( d->currentTextType );
5617 for (uint i=0; i<atom->listSize(); i++)
5619 text->setText(atom->strValue(i));
5623 if( (d->currentTextType == TextObject::Title) | (d->currentTextType == TextObject::CenterTitle) )
5624 for (
unsigned i=0; i<atom->listSize(); i++)
5625 d->currentSlide->setTitle( atom->strValue(i) );
5630 std::cout <<
" Text Object " << atom->ustring().ascii();
5631 std::cout <<
" placed at " << placeId << std::endl;
5636void PPTReader::handleTextBytesAtom( TextBytesAtom* atom )
5639 if( !d->presentation )
return;
5640 if( !d->currentSlide )
return;
5641 if( !d->currentTextId )
return;
5643 int placeId = d->currentTextId-1;
5644 TextObject* text = d->currentSlide->textObject( placeId );
5647 std::cerr <<
"No place for text object! " << placeId << std::endl;
5651 text->setType( d->currentTextType );
5653 for (uint i=0; i<atom->listSize(); i++)
5655 text->setText(atom->strValue(i));
5659 if( (d->currentTextType == TextObject::Title) | (d->currentTextType == TextObject::CenterTitle) )
5660 for (
unsigned i=0; i<atom->listSize(); i++)
5661 d->currentSlide->setTitle( atom->strValue(i) );
5666 std::cout <<
" Text Object " << atom->ustring().ascii();
5667 std::cout <<
" placed at " << placeId << std::endl;
5671void PPTReader::handleStyleTextPropAtom ( StyleTextPropAtom* atom )
5674 if( !d->presentation )
return;
5675 if( !d->currentSlide )
return;
5676 if( !d->currentTextId )
return;
5678 int placeId = d->currentTextId-1;
5679 TextObject* text = d->currentSlide->textObject( placeId );
5681 for (uint i=0; i<atom->listSize(); i++)
5683 if (atom->bulletOn(i) == 1)
5684 text->setBulletFlag(
true);
5686 text->setBulletFlag(
false);
5691void PPTReader::handleColorSchemeAtom( ColorSchemeAtom* atom )
5694 if( !d->presentation )
return;
5698std::string spaces(
int x )
5701 for(
int i=0; i<x; i++ )
5706void dumpGroup( GroupObject* obj,
unsigned indent );
5708void dumpObject( Object* obj,
unsigned indent )
5710 std::cout << spaces(indent) <<
"Top: " << obj->top() << std::endl;
5711 std::cout << spaces(indent) <<
"Left: " << obj->left() << std::endl;
5713 if( obj->isGroup() )
5715 std::cout << spaces(indent) <<
"This is a group" << std::endl;
5716 GroupObject* gr =
static_cast<GroupObject*
>(obj);
5717 dumpGroup( gr, indent+2 );
5721void dumpGroup( GroupObject* obj,
unsigned indent )
5723 for(
unsigned i=0; i <obj->objectCount(); i++ )
5725 std::cout << spaces(indent) <<
"Object #" << i+1 << std::endl;
5726 Object* o = obj->object(i);
5727 dumpObject( o, indent+2 );
5731void dumpSlide( Slide* slide )
5733 std::cout <<
"Slide: " << slide->title().
ascii() << std::endl;
5734 GroupObject* root = slide->rootObject();
5735 dumpGroup( root, 0 );
5736 std::cout << std::endl;
5740void PPTReader::handleDrawingContainer( msofbtDgContainer* container,
unsigned size )
5742 if( !container )
return;
5743 if( !d->presentation )
return;
5744 if( !d->currentSlide )
return;
5746 d->currentGroup =
new GroupObject();
5747 d->currentObject = 0;
5748 d->isShapeGroup =
false;
5750 unsigned long nextpos = d->docStream->tell() + size - 6;
5751 while( d->docStream->tell() < nextpos )
5752 loadRecord( container );
5754 for(
unsigned i=0; i<d->currentGroup->objectCount(); i++ )
5756 Object* obj = d->currentGroup->object(i);
5757 if( ( i == 0 ) && ( obj->isGroup() ) )
5759 d->currentGroup->takeObject( obj );
5760 d->currentSlide->setRootObject( (GroupObject*)obj );
5765 delete d->currentGroup;
5766 d->currentGroup = 0;
5767 d->currentObject = 0;
5768 d->isShapeGroup =
false;
5771void PPTReader::handleEscherGroupContainer( msofbtSpgrContainer* container,
unsigned size )
5773 if( !container )
return;
5774 if( !d->presentation )
return;
5775 if( !d->currentSlide )
return;
5776 if( !d->currentGroup )
return;
5778 GroupObject* lastGroup = d->currentGroup;
5780 d->currentGroup =
new GroupObject();
5781 d->currentObject = 0;
5782 d->isShapeGroup =
false;
5784 unsigned long nextpos = d->docStream->tell() + size - 6;
5785 while( d->docStream->tell() < nextpos )
5786 loadRecord( container );
5788 lastGroup->addObject( d->currentGroup );
5789 d->currentGroup = lastGroup;
5790 d->currentObject = 0;
5791 d->isShapeGroup =
false;
5794void PPTReader::handleSPContainer( msofbtSpContainer* container,
unsigned size )
5796 if( !container )
return;
5797 if( !d->presentation )
return;
5798 if( !d->currentSlide )
return;
5799 if( !d->currentGroup )
return;
5801 d->isShapeGroup =
false;
5803 unsigned long nextpos = d->docStream->tell() + size - 6;
5804 while( d->docStream->tell() < nextpos )
5805 loadRecord( container );
5807 if( d->currentObject )
5808 if( !d->isShapeGroup )
5809 d->currentGroup->addObject( d->currentObject );
5811 d->currentObject = 0;
5812 d->isShapeGroup =
false;
5815void PPTReader::handleEscherGroupAtom( msofbtSpgrAtom* atom )
5818 if( !d->presentation )
return;
5819 if( !d->currentSlide )
return;
5820 if( !d->currentGroup )
return;
5825 d->isShapeGroup =
true;
5828void PPTReader::handleEscherSpAtom( msofbtSpAtom* atom )
5831 if( !d->presentation )
return;
5832 if( !d->currentSlide )
return;
5833 if( !d->currentGroup )
return;
5835 DrawObject* drawObject =
new DrawObject;
5837 drawObject->setBackground( atom->isBackground() );
5839 unsigned sh = DrawObject::None;
5840 switch( atom->instance() )
5842 case msofbtSpAtom::msosptRectangle: sh = DrawObject::Rectangle;
break;
5843 case msofbtSpAtom::msosptRoundRectangle: sh = DrawObject::RoundRectangle;
break;
5844 case msofbtSpAtom::msosptEllipse: sh = DrawObject::Ellipse;
break;
5845 case msofbtSpAtom::msosptDiamond: sh = DrawObject::Diamond;
break;
5846 case msofbtSpAtom::msosptIsoscelesTriangle: sh = DrawObject::IsoscelesTriangle;
break;
5847 case msofbtSpAtom::msosptRightTriangle: sh = DrawObject::RightTriangle;
break;
5848 case msofbtSpAtom::msosptParallelogram: sh = DrawObject::Parallelogram;
break;
5849 case msofbtSpAtom::msosptTrapezoid: sh = DrawObject::Trapezoid;
break;
5850 case msofbtSpAtom::msosptHexagon: sh = DrawObject::Hexagon;
break;
5851 case msofbtSpAtom::msosptOctagon: sh = DrawObject::Octagon;
break;
5853 case msofbtSpAtom::msosptArrow: sh = DrawObject::LeftArrow;
break;
5854 case msofbtSpAtom::msosptDownArrow: sh = DrawObject::DownArrow;
break;
5855 case msofbtSpAtom::msosptUpArrow: sh = DrawObject::UpArrow;
break;
5856 case msofbtSpAtom::msosptLeftArrow: sh = DrawObject::LeftArrow;
break;
5858 case msofbtSpAtom::msosptLine: sh = DrawObject::Line;
break;
5859 case msofbtSpAtom::msosptSmileyFace: sh = DrawObject::Smiley;
break;
5860 case msofbtSpAtom::msosptHeart: sh = DrawObject::Heart;
break;
5861 case msofbtSpAtom::msosptMin: sh = DrawObject::FreeLine;
break;
5866 drawObject->setShape( sh );
5874 d->currentObject = drawObject;
5876 if (atom->isVerFlip() ==
true)
5877 d->currentObject->setProperty(
"draw:mirror-vertical",
"true");
5879 if (atom->isHorFlip() ==
true)
5880 d->currentObject->setProperty(
"draw:mirror-horizontal",
"true");
5885void PPTReader::handleEscherClientDataAtom( msofbtClientDataAtom* atom )
5888 if( !d->presentation )
return;
5889 if( !d->currentSlide )
return;
5890 if( !d->currentGroup )
return;
5891 if( !d->currentObject )
return;
5893 TextObject* textObject = 0;
5894 if( !d->currentObject->isText() )
5896 textObject =
new TextObject();
5897 textObject->convertFrom( d->currentObject );
5898 delete d->currentObject;
5899 d->currentObject = textObject;
5902 textObject =
static_cast<TextObject*
>( d->currentObject );
5904 switch( atom->placeholderId() )
5906 case msofbtClientDataAtom::MasterTitle:
5907 case msofbtClientDataAtom::Title:
5908 textObject->setType( TextObject::Title );
break;
5910 case msofbtClientDataAtom::MasterBody:
5911 case msofbtClientDataAtom::MasterSubtitle:
5912 case msofbtClientDataAtom::Body:
5913 case msofbtClientDataAtom::Subtitle:
5914 textObject->setType( TextObject::Body );
break;
5916 case msofbtClientDataAtom::MasterCenteredTitle:
5917 case msofbtClientDataAtom::CenteredTitle:
5918 textObject->setType( TextObject::CenterTitle );
break;
5921 textObject->setType( TextObject::Other );
break;
5925 textObject->setId( atom->placementId() );
5928void PPTReader::handleEscherClientAnchorAtom( msofbtClientAnchorAtom* atom )
5931 if( !d->presentation )
return;
5932 if( !d->currentSlide )
return;
5933 if( !d->currentGroup )
return;
5934 if( !d->currentObject )
return;
5936 d->currentObject->setLeft( atom->left()*25.4/576 );
5937 d->currentObject->setTop( atom->top()*25.4/576 );
5938 d->currentObject->setWidth( (atom->right()-atom->left())*25.4/576 );
5939 d->currentObject->setHeight( (atom->bottom()-atom->top())*25.4/576 );
5942void PPTReader::handleEscherTextBoxAtom( msofbtClientTextboxAtom* atom )
5945 if( !d->presentation )
return;
5946 if( !d->currentGroup )
return;
5947 if( !d->currentObject )
return;
5949 TextObject* textObject = 0;
5950 if( !d->currentObject->isText() )
5952 textObject =
new TextObject();
5953 textObject->convertFrom( d->currentObject );
5954 delete d->currentObject;
5955 d->currentObject = textObject;
5958 textObject =
static_cast<TextObject*
>( d->currentObject );
5960 textObject->setType( TextObject::Other );
5961 textObject->setText( atom->ustring() );
5962 textObject->setBulletFlag(
false );
5965Color convertFromLong(
unsigned long i )
5967 unsigned r = (i & 0xff);
5968 unsigned g = (i>>8) & 0xff;
5969 unsigned b = (i>>16) & 0xff;
5971 return Color( r, g, b );
5974void PPTReader::handleEscherPropertiesAtom( msofbtOPTAtom* atom )
5977 if( !d->presentation )
return;
5978 if( !d->currentSlide )
return;
5979 if( !d->currentGroup )
return;
5980 if( !d->currentObject )
return;
5982 for(
unsigned c=0; c<atom->propertyCount(); c++ )
5984 unsigned pid = atom->propertyId(c);
5985 signed long pvalue = atom->propertyValue(c);
5989 case msofbtOPTAtom::FillColor:
5990 d->currentObject->setProperty(
"draw:fill-color", convertFromLong(pvalue) );
5992 case msofbtOPTAtom::LineColor:
5993 d->currentObject->setProperty(
"svg:stroke-color", convertFromLong(pvalue) );
5995 case msofbtOPTAtom::LineWidth:
5996 d->currentObject->setProperty(
"svg:stroke-width", pvalue*(25.4/(12700*72) ));
5998 case msofbtOPTAtom::Rotation:
5999 {
double deg = pvalue/65536.00 ;
6000 if (deg > 180.00) deg = 360.00 - deg;
6001 d->currentObject->setProperty(
"libppt:rotation", (deg*0.0174533) ) ;
6003 case msofbtOPTAtom::FillType:
6006 case msofbtOPTAtom::FillSolid:
6007 d->currentObject->setProperty(
"draw:fill",
"solid");
break;
6008 case msofbtOPTAtom::FillPattern:
6009 d->currentObject->setProperty(
"draw:fill",
"solid");
break;
6011 d->currentObject->setProperty(
"draw:fill",
"solid");
break;
6014 case msofbtOPTAtom::LineDashing:
6017 case msofbtOPTAtom::LineSolid :
6018 {d->currentObject->setProperty(
"draw:stroke",
"solid");
6021 case msofbtOPTAtom::LineDashSys :
6023 d->currentObject->setProperty(
"draw:stroke",
"dash");
6024 d->currentObject->setProperty(
"draw:stroke-dash",
"Dash_20_2");
6027 case msofbtOPTAtom::LineDotSys :
6029 d->currentObject->setProperty(
"draw:stroke",
"dash");
6030 d->currentObject->setProperty(
"draw:stroke-dash",
"Dash_20_3");
6033 case msofbtOPTAtom::LineDashDotSys :
6035 d->currentObject->setProperty(
"draw:stroke",
"dash");
6036 d->currentObject->setProperty(
"draw:stroke-dash",
"Dash_20_2");
6039 case msofbtOPTAtom::LineDashDotDotSys :
6040 { d->currentObject->setProperty(
"draw:stroke",
"dash");
6041 d->currentObject->setProperty(
"draw:stroke-dash",
"Dash_20_2");
6044 case msofbtOPTAtom::LineDotGEL :
6045 { d->currentObject->setProperty(
"draw:stroke",
"dash");
6046 d->currentObject->setProperty(
"draw:stroke-dash",
"Dash_20_2");
6049 case msofbtOPTAtom::LineDashGEL :
6050 { d->currentObject->setProperty(
"draw:stroke",
"dash");
6051 d->currentObject->setProperty(
"draw:stroke-dash",
"Dash_20_4");
6054 case msofbtOPTAtom::LineLongDashGEL :
6055 { d->currentObject->setProperty(
"draw:stroke",
"dash");
6056 d->currentObject->setProperty(
"draw:stroke-dash",
"Dash_20_6");
6059 case msofbtOPTAtom::LineDashDotGEL :
6060 { d->currentObject->setProperty(
"draw:stroke",
"dash");
6061 d->currentObject->setProperty(
"draw:stroke-dash",
"Dash_20_5");
6064 case msofbtOPTAtom::LineLongDashDotGEL :
6065 { d->currentObject->setProperty(
"draw:stroke",
"dash");
6066 d->currentObject->setProperty(
"draw:stroke-dash",
"Dash_20_7");
6069 case msofbtOPTAtom::LineLongDashDotDotGEL :
6070 { d->currentObject->setProperty(
"draw:stroke",
"dash");
6071 d->currentObject->setProperty(
"draw:stroke-dash",
"Dash_20_8");
6075 d->currentObject->setProperty(
"draw:stroke",
"solid");
break;
6078 case msofbtOPTAtom::FlagNoLineDrawDash:
6079 {
if (pvalue == 589824 )
6080 d->currentObject->setProperty(
"libppt:invisibleLine",
true );
6083 case msofbtOPTAtom::LineStartArrowhead:
6087 case msofbtOPTAtom::LineNoEnd :
break;
6088 case msofbtOPTAtom::LineArrowEnd :
6089 d->currentObject->setProperty(
"draw:marker-start",
"msArrowEnd_20_5" );
break;
6090 case msofbtOPTAtom::LineArrowStealthEnd :
6091 d->currentObject->setProperty(
"draw:marker-start",
"msArrowStealthEnd_20_5" );
break;
6092 case msofbtOPTAtom::LineArrowDiamondEnd :
6093 d->currentObject->setProperty(
"draw:marker-start",
"msArrowDiamondEnd_20_5" );
break;
6094 case msofbtOPTAtom::LineArrowOvalEnd :
6095 d->currentObject->setProperty(
"draw:marker-start",
"msArrowOvalEnd_20_5" );
break;
6096 case msofbtOPTAtom::LineArrowOpenEnd :
6097 d->currentObject->setProperty(
"draw:marker-start",
"msArrowOpenEnd_20_5" );
break;
6102 case msofbtOPTAtom::LineStartArrowWidth:
6106 case msofbtOPTAtom::LineNarrowArrow :
6107 d->currentObject->setProperty(
"draw:marker-start-width", 0.2 );
break;
6108 case msofbtOPTAtom::LineMediumWidthArrow :
6109 d->currentObject->setProperty(
"draw:marker-start-width", 0.3 );
break;
6110 case msofbtOPTAtom::LineWideArrow :
6111 d->currentObject->setProperty(
"draw:marker-start-width", 0.4 );
break;
6116 case msofbtOPTAtom::LineEndArrowhead:
6120 case msofbtOPTAtom::LineNoEnd :
break;
6121 case msofbtOPTAtom::LineArrowEnd :
6122 d->currentObject->setProperty(
"draw:marker-end",
"msArrowEnd_20_5" );
break;
6123 case msofbtOPTAtom::LineArrowStealthEnd :
6124 d->currentObject->setProperty(
"draw:marker-end",
"msArrowStealthEnd_20_5" );
break;
6125 case msofbtOPTAtom::LineArrowDiamondEnd :
6126 d->currentObject->setProperty(
"draw:marker-end",
"msArrowDiamondEnd_20_5" );
break;
6127 case msofbtOPTAtom::LineArrowOvalEnd :
6128 d->currentObject->setProperty(
"draw:marker-end",
"msArrowOvalEnd_20_5" );
break;
6129 case msofbtOPTAtom::LineArrowOpenEnd :
6130 d->currentObject->setProperty(
"draw:marker-end",
"msArrowOpenEnd_20_5" );
break;
6151 case msofbtOPTAtom::LineEndArrowWidth:
6155 case msofbtOPTAtom::LineNarrowArrow :
6156 d->currentObject->setProperty(
"draw:marker-end-width", 0.2 );
break;
6157 case msofbtOPTAtom::LineMediumWidthArrow :
6158 d->currentObject->setProperty(
"draw:marker-end-width", 0.3 );
break;
6159 case msofbtOPTAtom::LineWideArrow :
6160 d->currentObject->setProperty(
"draw:marker-end-width", 0.4 );
break;
6180 case msofbtOPTAtom::ShadowColor:
6182 d->currentObject->setProperty(
"draw:shadow-color", convertFromLong(pvalue) );
6184 case msofbtOPTAtom::ShadowOpacity:
6186 d->currentObject->setProperty(
"draw:shadow-opacity", 100.0-(pvalue/(65536.0)) );
6188 case msofbtOPTAtom::ShadowOffsetX:
6190 d->currentObject->setProperty(
"draw:shadow-offset-x",(pvalue*2.54/(12700*72)));
6192 case msofbtOPTAtom::ShadowOffsetY:
6194 d->currentObject->setProperty(
"draw:shadow-offset-y",(pvalue*2.54/(12700*72)));
char * ascii() const
Convert the Unicode string to plain ASCII chars chopping of any higher bytes.
UString & append(const UString &)
Append another string.