summaryrefslogtreecommitdiff
path: root/qt4/src
diff options
context:
space:
mode:
authorTobias Koenig <tobias.koenig@kdab.com>2012-06-10 17:48:08 +0200
committerAlbert Astals Cid <aacid@kde.org>2012-06-10 17:48:08 +0200
commit8b3fa65f293804dab7ae2fd069132d0d6f44bbb2 (patch)
treeb61a555dac1e5431efdbc258c6d728c62437572f /qt4/src
parente8aa8266254bfd2189d5b5105e3d76caa4cc6713 (diff)
[qt4] Add accessor methods for poster information
Diffstat (limited to 'qt4/src')
-rw-r--r--qt4/src/poppler-movie.cc15
-rw-r--r--qt4/src/poppler-qt4.h15
2 files changed, 30 insertions, 0 deletions
diff --git a/qt4/src/poppler-movie.cc b/qt4/src/poppler-movie.cc
index 869e3811..a64847c0 100644
--- a/qt4/src/poppler-movie.cc
+++ b/qt4/src/poppler-movie.cc
@@ -2,6 +2,7 @@
* Copyright (C) 2008, 2010, Pino Toscano <pino@kde.org>
* Copyright (C) 2008, Albert Astals Cid <aacid@kde.org>
* Copyright (C) 2010, Carlos Garcia Campos <carlosgc@gnome.org>
+ * Copyright (C) 2012, Tobias Koenig <tobias.koenig@kdab.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,6 +25,8 @@
#include "Annot.h"
#include "Movie.h"
+#include <QtGui/QImage>
+
namespace Poppler
{
@@ -43,6 +46,7 @@ public:
Movie *m_movieObj;
QSize m_size;
int m_rotation;
+ QImage m_posterImage;
MovieObject::PlayMode m_playMode : 3;
bool m_showControls : 1;
};
@@ -51,6 +55,7 @@ MovieObject::MovieObject( AnnotMovie *ann )
{
m_movieData = new MovieData();
m_movieData->m_movieObj = ann->getMovie()->copy();
+ //TODO: copy poster image
MovieActivationParameters *mp = m_movieData->m_movieObj->getActivationParameters();
int width, height;
@@ -92,4 +97,14 @@ MovieObject::PlayMode MovieObject::playMode() const
return m_movieData->m_playMode;
}
+bool MovieObject::showPosterImage() const
+{
+ return (m_movieData->m_movieObj->getShowPoster() == gTrue);
+}
+
+QImage MovieObject::posterImage() const
+{
+ return m_movieData->m_posterImage;
+}
+
}
diff --git a/qt4/src/poppler-qt4.h b/qt4/src/poppler-qt4.h
index f314108c..827ea533 100644
--- a/qt4/src/poppler-qt4.h
+++ b/qt4/src/poppler-qt4.h
@@ -11,6 +11,7 @@
* Copyright (C) 2011 Glad Deschrijver <glad.deschrijver@gmail.com>
* Copyright (C) 2012, Guillermo A. Amaral B. <gamaral@kde.org>
* Copyright (C) 2012, Fabio D'Urso <fabiodurso@hotmail.it>
+ * Copyright (C) 2012, Tobias Koenig <tobias.koenig@kdab.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1733,6 +1734,20 @@ height = dummy.height();
*/
PlayMode playMode() const;
+ /**
+ Returns whether a poster image should be shown if the movie is not playing.
+ \since 0.22
+ */
+ bool showPosterImage() const;
+
+ /**
+ Returns the poster image that should be shown if the movie is not playing.
+ If the image is null but showImagePoster() returns @c true, the first frame of the movie
+ should be used as poster image.
+ \since 0.22
+ */
+ QImage posterImage() const;
+
private:
/// \cond PRIVATE
MovieObject( AnnotMovie *ann );