1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
5 * KWorship is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
10 * KWorship 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 *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with KWorship. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
22 * @brief OpenOffice.org presentation slide.
23 * @author James Hogan <james@albanarts.com>
26 #include "UpOoSlide.h"
28 #include <com/sun/star/drawing/XShapes.hpp>
29 #include <com/sun/star/text/XText.hpp>
31 using namespace com::sun::star::drawing
;
32 using namespace com::sun::star::text
;
33 using namespace com::sun::star::uno
;
36 * Constructors + destructor
39 /// Primary constructor.
40 UpOoSlide::UpOoSlide(uno::XInterface
* interface
, QObject
* parent
)
42 , m_interface(interface
)
47 UpOoSlide::~UpOoSlide()
55 QString
UpOoSlide::title()
57 // see presentation::DrawPage::HeaderText
61 QString
UpOoSlide::outline()
63 // see presentation::OutlinerShape
65 // Go through the shapes
66 Reference
<XShapes
> shapes(m_interface
, UNO_QUERY
);
67 int numShapes
= shapes
->getCount();
68 for (int i
= 0; i
< numShapes
; ++i
)
70 Reference
<XText
> shape
;
71 shapes
->getByIndex(i
) >>= shape
;
74 QString text
= QString::fromUtf16((const sal_Unicode
*)shape
->getString());
78 return result
.join("\n");
81 QPixmap
UpOoSlide::preview()
83 // see drawing::XSlidePreviewCache:getSlidePreview
84 // see http://www.oooforum.org/forum/viewtopic.phtml?t=14697 about event
85 // listeners for when slide preview not immediately available
86 // would have to return empty pixmap and have signal to say its changed