Basic openoffice.org control, and listening for new presentation documents, still...
[kworship.git] / unipresent / common / UpSlideNode.cpp
blobae98dc3af2c38e4eb5fc19db12611046d1730ab9
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 UpSlideNode.cpp
22 * @brief A presentations node for a slide.
23 * @author James Hogan <james@albanarts.com>
26 #include "UpSlideNode.h"
27 #include "UpSlide.h"
29 #include <KMimeType>
30 #include <KIcon>
32 #include <QFileInfo>
34 #include <cassert>
37 * Constructors + destructor.
40 /// Primary constructor.
41 UpSlideNode::UpSlideNode(DefaultModelNode* parent, UpSlide* item)
42 : DefaultModelNode(parent)
43 , m_item(item)
47 /// Destructor.
48 UpSlideNode::~UpSlideNode()
53 * Accessors
56 UpSlide* UpSlideNode::getItem()
58 return m_item;
62 * Main interface
65 QVariant UpSlideNode::getData(int role, int column)
67 if (role == Qt::DisplayRole)
69 if (column == 0)
71 return m_item->title();
74 else if (role == Qt::DecorationRole)
76 if (column == 0)
78 QPixmap pixmap = m_item->preview();
79 if (!pixmap.isNull())
81 return pixmap;
85 return QVariant();