filters

pptSlide.h
1/*
2 Copyright (C) 2002, M.Marcucio <michaelmarcucio@hotmail.com>.
3 This file is part of the KDE project
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19
20DESCRIPTION
21
22*/
23
24#ifndef PPTSLIDE_H
25#define PPTSLIDE_H
26
27#include <kdebug.h>
28#include <tqstring.h>
29#include <tqstringlist.h>
30#include <tqptrlist.h>
31
32//--text types
33#define TITLE_TEXT 0 //title
34#define BODY_TEXT 1 //body
35#define NOTES_TEXT 2 //notes
36#define NOTUSED_TEXT 3 //not used
37#define OTHER_TEXT 4 //other(test in shape)
38#define CENTER_BODY_TEXT 5 //center body(subtitle in title slide)
39#define CENTER_TITLE_TEXT 6 //center title(title in title slide)
40#define HALF_BODY_TEXT 7 //half body(body in two-column slide)
41#define QUARTER_BODY_TEXT 8 //quarter body(body in four-body slide)
42//--
43
44//--char style types
45enum
46{
47 BOLD_STYLE = 1,
48 ITALIC_STYLE = 2,
49 UNDERLINE_STYLE = 3
50};
51//--
52
53class PptSlide
54{
55public:
56 typedef struct
57 {
58 TQ_UINT16 style; //the style of the text run
59 TQ_UINT16 length; //length of the style run
60 }styleRunType;
61
62 typedef TQPtrList<styleRunType> styleRun;
63
64 PptSlide();
65 TQStringList getPlaceholderText(void); //gets the list of paragraphs from the placeholder
66 //styleRun getPlaceholderStyleRun(void); //gets the list of placeholder style runs
67 TQ_UINT16 getPlaceholderType(void); //gets the type of the placeholder
68 TQ_UINT16 gotoPlaceholder(TQ_UINT16 pholderNumber); //goto the n'th placeholder
69 TQ_UINT16 getNumberOfPholders(); //gets the number of placeholders on slide
70
71 TQ_INT32 getPsrReference(void);
72 void setPsrReference(TQ_INT32 psr);
73
74 void addText(TQString text, TQ_UINT16 type); //adds text of the given type
75 void addToStyleRun(TQ_UINT16 style, TQ_UINT16 length); //adds to the current style run
76
77private:
78 typedef struct
79 {
80 TQStringList paragraphs; //text of the placeholder
81 TQ_UINT16 type; //what is the text type
82 styleRun style; //char style info
83 }placeholder;
84
85 TQ_INT16 m_slideLayout; //type of slide
86 TQ_INT16 m_numberOfPholders; //number of placeholder on the slide
87 TQ_INT32 m_psrReference; //logical reference
88 TQPtrList<placeholder> m_placeholderList; //list of all the placeholders on the slide
89 placeholder* m_currentPholder; //pointer to current placeholder
90
91};
92
93#endif