pptSlide.cpp
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#include <pptSlide.h>
25
26static const int s_area = 30512;
27
28PptSlide::PptSlide()
29{
30 m_slideLayout = 0; //type of slide
31 m_numberOfPholders = 0; //number of placeholder on the slide
32 m_psrReference = 0; //logical reference
33}
34
35//PptSlide::~PptSlide()
36//{
37//}
38
39TQStringList PptSlide::getPlaceholderText(void)
40{
41 return m_currentPholder->paragraphs;
42}
43
44//styleRun PptSlide::getPlaceholderStyleRun(void)
45//{
46// return m_currentPholder->styleRun;
47//}
48
49TQ_UINT16 PptSlide::getPlaceholderType(void)
50{
51 return m_currentPholder->type;
52}
53
54TQ_UINT16 PptSlide::gotoPlaceholder(TQ_UINT16 pholderNumber)
55{
56 m_currentPholder = m_placeholderList.at(pholderNumber);
57 return 0;
58}
59
60TQ_INT32 PptSlide::getPsrReference(void)
61{
62 return m_psrReference;
63}
64
65void PptSlide::setPsrReference(TQ_INT32 psr)
66{
67 m_psrReference = psr;
68}
69
70TQ_UINT16 PptSlide::getNumberOfPholders()
71{
72 return m_numberOfPholders;
73}
74
75void PptSlide::addText(TQString text, TQ_UINT16 type)
76{
77 unsigned j;
78 m_currentPholder = new placeholder;
79 m_placeholderList.append(m_currentPholder);
80 m_numberOfPholders++;
81 m_currentPholder->type = type;
82 kdError(s_area) << "adding to slide now!!!!!!!!!!!! m_numberOfPholders: " << m_numberOfPholders << endl;
83
84 switch (type)
85 {
86 case TITLE_TEXT:
87 case CENTER_TITLE_TEXT:
88 m_currentPholder->paragraphs.append(text);
89 //m_titleText.append("\n");
90 break;
91 case NOTES_TEXT:
92 m_currentPholder->paragraphs.append(text);
93 m_currentPholder->paragraphs.append("\n");
94 //m_notesText.append("\n");
95 break;
96 case BODY_TEXT:
97 case OTHER_TEXT:
98 case CENTER_BODY_TEXT:
99 case HALF_BODY_TEXT:
100 case QUARTER_BODY_TEXT:
101 TQStringList data(TQStringList::split(TQChar('\r'), text, true));
102 for (j = 0; j < data.count(); j++)
103 {
104 m_currentPholder->paragraphs.append(data[j]);
105 //m_body.paragraphs.append(data[j]);
106 }
107 //m_body.type = type;
108 break;
109 }
110}//addtext
111