filters

pptSlide.cpp

00001 /*
00002     Copyright (C) 2002, M.Marcucio <michaelmarcucio@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 */
00023 
00024 #include <pptSlide.h>
00025 
00026 static const int s_area = 30512;
00027 
00028 PptSlide::PptSlide()
00029 {
00030     m_slideLayout = 0;      //type of slide
00031     m_numberOfPholders = 0; //number of placeholder on the slide
00032     m_psrReference = 0;     //logical reference
00033 }
00034 
00035 //PptSlide::~PptSlide()
00036 //{
00037 //}
00038 
00039 QStringList PptSlide::getPlaceholderText(void)
00040 {
00041     return m_currentPholder->paragraphs;
00042 }
00043 
00044 //styleRun PptSlide::getPlaceholderStyleRun(void)
00045 //{
00046 //  return m_currentPholder->styleRun;
00047 //}
00048 
00049 Q_UINT16 PptSlide::getPlaceholderType(void)
00050 {
00051     return m_currentPholder->type;
00052 }
00053 
00054 Q_UINT16 PptSlide::gotoPlaceholder(Q_UINT16 pholderNumber)
00055 {
00056     m_currentPholder = m_placeholderList.at(pholderNumber);
00057         return 0;
00058 }
00059 
00060 Q_INT32 PptSlide::getPsrReference(void)
00061 {
00062     return m_psrReference;
00063 }
00064 
00065 void PptSlide::setPsrReference(Q_INT32 psr)
00066 {
00067     m_psrReference = psr;
00068 }
00069 
00070 Q_UINT16 PptSlide::getNumberOfPholders()
00071 {
00072     return m_numberOfPholders;
00073 }
00074 
00075 void PptSlide::addText(QString text, Q_UINT16 type)
00076 {
00077     unsigned j;
00078     m_currentPholder = new placeholder;
00079     m_placeholderList.append(m_currentPholder);
00080     m_numberOfPholders++;
00081     m_currentPholder->type = type;
00082     kdError(s_area) << "adding to slide now!!!!!!!!!!!! m_numberOfPholders: " << m_numberOfPholders << endl;
00083 
00084     switch (type)
00085     {
00086     case TITLE_TEXT:
00087     case CENTER_TITLE_TEXT:
00088         m_currentPholder->paragraphs.append(text);
00089         //m_titleText.append("\n");
00090         break;
00091     case NOTES_TEXT:
00092         m_currentPholder->paragraphs.append(text);
00093         m_currentPholder->paragraphs.append("\n");
00094         //m_notesText.append("\n");
00095         break;
00096     case BODY_TEXT:
00097     case OTHER_TEXT:
00098     case CENTER_BODY_TEXT:
00099     case HALF_BODY_TEXT:
00100     case QUARTER_BODY_TEXT:
00101             QStringList data(QStringList::split(QChar('\r'), text, true));
00102         for (j = 0; j < data.count(); j++)
00103         {
00104             m_currentPholder->paragraphs.append(data[j]);
00105             //m_body.paragraphs.append(data[j]);
00106         }
00107         //m_body.type = type;
00108         break;
00109     }
00110 }//addtext
00111 
KDE Home | KDE Accessibility Home | Description of Access Keys