Database: sqlite default to appdata kworship.db
[kworship.git] / unipresent / openoffice.org / UpOoSlide.cpp
blobf357454f7b575c675ea87b468ef670b808238f9b
1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
4 * *
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. *
9 * *
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. *
14 * *
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 ***************************************************************************/
20 /**
21 * @file UpOoSlide.cpp
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)
41 : UpSlide(parent)
42 , m_interface(interface)
46 /// Destructor.
47 UpOoSlide::~UpOoSlide()
52 * Main interface
55 QString UpOoSlide::title()
57 // see presentation::DrawPage::HeaderText
58 return outline();
61 QString UpOoSlide::outline()
63 // see presentation::OutlinerShape
64 QStringList result;
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;
72 if (0 != shape.get())
74 QString text = QString::fromUtf16((const sal_Unicode*)shape->getString());
75 result << text;
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
87 return QPixmap();