filters

pptSlide.h

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 //#ifndef PPTSLIDE_H
00025 //#define PPTSLIDE_H
00026 
00027 #include <kdebug.h>
00028 #include <qstring.h>
00029 #include <qstringlist.h>
00030 #include <qptrlist.h>
00031 
00032 //--text types
00033 #define TITLE_TEXT          0   //title
00034 #define BODY_TEXT           1   //body
00035 #define NOTES_TEXT      2   //notes
00036 #define NOTUSED_TEXT        3   //not used
00037 #define OTHER_TEXT      4   //other(test in shape)
00038 #define CENTER_BODY_TEXT    5   //center body(subtitle in title slide)
00039 #define CENTER_TITLE_TEXT   6   //center title(title in title slide)
00040 #define HALF_BODY_TEXT  7   //half body(body in two-column slide)
00041 #define QUARTER_BODY_TEXT   8   //quarter body(body in four-body slide)
00042 //--
00043 
00044 //--char style types
00045 enum
00046 {
00047     BOLD_STYLE      = 1,
00048     ITALIC_STYLE        = 2,
00049     UNDERLINE_STYLE     = 3
00050 };
00051 //--
00052 
00053 class PptSlide
00054 {
00055 public:
00056     typedef struct
00057     {
00058         Q_UINT16        style;              //the style of the text run
00059         Q_UINT16        length;         //length of the style run
00060     }styleRunType;
00061     
00062     typedef QPtrList<styleRunType>  styleRun;
00063     
00064                 PptSlide();
00065     QStringList     getPlaceholderText(void);                   //gets the list of paragraphs from the placeholder
00066     //styleRun      getPlaceholderStyleRun(void);               //gets the list of placeholder style runs
00067     Q_UINT16        getPlaceholderType(void);                   //gets the type of the placeholder
00068     Q_UINT16        gotoPlaceholder(Q_UINT16 pholderNumber);        //goto the n'th placeholder
00069     Q_UINT16        getNumberOfPholders();                  //gets the number of placeholders on slide
00070     
00071     Q_INT32     getPsrReference(void);
00072     void            setPsrReference(Q_INT32 psr);
00073     
00074     void            addText(QString text, Q_UINT16 type);               //adds text of the given type
00075     void            addToStyleRun(Q_UINT16 style, Q_UINT16 length); //adds to the current style run
00076 
00077 private:
00078     typedef struct
00079     {
00080         QStringList         paragraphs;     //text of the placeholder
00081         Q_UINT16            type;               //what is the text type
00082         styleRun            style;              //char style info
00083     }placeholder;
00084 
00085     Q_INT16             m_slideLayout;      //type of slide
00086     Q_INT16             m_numberOfPholders; //number of placeholder on the slide
00087     Q_INT32         m_psrReference;     //logical reference
00088         QPtrList<placeholder>   m_placeholderList;  //list of all the placeholders on the slide
00089         placeholder*        m_currentPholder;   //pointer to current placeholder
00090 
00091 };
00092 
00093 //#endif
KDE Home | KDE Accessibility Home | Description of Access Keys