filters
pptdoc.cc
00001 /* 00002 Copyright (C) 2000, S.R.Haque <shaheedhaque@hotmail.com>. 00003 This file is part of the KDE project 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 Boston, MA 02111-1307, USA. 00019 00020 DESCRIPTION 00021 00022 This file implements a simplified abstraction of Microsoft Powerpoint documents. 00023 */ 00024 00025 #include <kdebug.h> 00026 #include <pptdoc.h> 00027 #include <qptrlist.h> 00028 00029 const int PptDoc::s_area = 30512; 00030 00031 PptDoc::PptDoc( 00032 const myFile &mainStream, 00033 const myFile ¤tUser, 00034 const myFile &pictures) : 00035 Powerpoint() 00036 { 00037 m_mainStream = mainStream; 00038 m_currentUser = currentUser; 00039 m_pictures = pictures; 00040 } 00041 00042 PptDoc::~PptDoc() 00043 { 00044 } 00045 /* 00046 void PptDoc::gotSlide( 00047 PptSlide &slide) 00048 { 00049 Slide ourSlide; 00050 unsigned i; 00051 00052 for (i = 0; i < slide.text.count(); i++) 00053 { 00054 SlideText *text = slide.text.at(i); 00055 QStringList data(QStringList::split(QChar('\r'), text->data, true)); 00056 unsigned j; 00057 00058 switch (text->type) 00059 { 00060 case TITLE_TEXT: 00061 case CENTER_TITLE_TEXT: 00062 ourSlide.title = data.join("\n"); 00063 break; 00064 case NOTES_TEXT: 00065 ourSlide.notes = data.join("\n"); 00066 break; 00067 case BODY_TEXT: 00068 case OTHER_TEXT: 00069 case CENTER_BODY_TEXT: 00070 case HALF_BODY_TEXT: 00071 case QUARTER_BODY_TEXT: 00072 for (j = 0; j < data.count(); j++) 00073 { 00074 ourSlide.body.append(data[j]); 00075 } 00076 break; 00077 } 00078 } 00079 00080 gotSlide(slide); 00081 } 00082 */ 00083 00084 bool PptDoc::parse() 00085 { 00086 return Powerpoint::parse(m_mainStream, m_currentUser, m_pictures); 00087 }