[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [okular] ui: Extend GuiUtils with helper function for ScreenAnnotations
From: Tobias Koenig <tokoe () kde ! org>
Date: 2012-10-22 11:05:51
Message-ID: 20121022110551.7587AA60CE () git ! kde ! org
[Download RAW message or body]
Git commit a41a727e214eef60054b1b264fad6eb5c3c76598 by Tobias Koenig.
Committed on 27/09/2012 at 14:14.
Pushed by tokoe into branch 'master'.
Extend GuiUtils with helper function for ScreenAnnotations
REVIEW: 106607
M +15 -0 ui/guiutils.cpp
M +9 -0 ui/guiutils.h
http://commits.kde.org/okular/a41a727e214eef60054b1b264fad6eb5c3c76598
diff --git a/ui/guiutils.cpp b/ui/guiutils.cpp
index 30be525..1d67d3a 100644
--- a/ui/guiutils.cpp
+++ b/ui/guiutils.cpp
@@ -21,6 +21,7 @@
#include <kstandarddirs.h>
// local includes
+#include "core/action.h"
#include "core/annotations.h"
#include "core/document.h"
@@ -225,4 +226,18 @@ void saveEmbeddedFile( Okular::EmbeddedFile *ef, QWidget *parent \
) f.close();
}
+Okular::Movie* renditionMovieFromScreenAnnotation( const Okular::ScreenAnnotation \
*annotation ) +{
+ if ( !annotation )
+ return 0;
+
+ if ( annotation->action() && annotation->action()->actionType() == \
Okular::Action::Rendition ) + {
+ Okular::RenditionAction *renditionAction = static_cast< \
Okular::RenditionAction * >( annotation->action() ); + return \
renditionAction->movie(); + }
+
+ return 0;
+}
+
}
diff --git a/ui/guiutils.h b/ui/guiutils.h
index b68e211..2ae4ab3 100644
--- a/ui/guiutils.h
+++ b/ui/guiutils.h
@@ -20,6 +20,8 @@ class KIconLoader;
namespace Okular {
class Annotation;
class EmbeddedFile;
+class Movie;
+class ScreenAnnotation;
}
namespace GuiUtils
@@ -42,6 +44,13 @@ namespace GuiUtils
KIconLoader* iconLoader();
void saveEmbeddedFile( Okular::EmbeddedFile *ef, QWidget *parent );
+
+ /**
+ * Returns the movie object that is referenced by a rendition action of the \
passed screen @p annotation + * or @c 0 if the screen annotation has no rendition \
action set or the rendition action does not contain + * a media rendition.
+ */
+ Okular::Movie* renditionMovieFromScreenAnnotation( const \
Okular::ScreenAnnotation * annotation ); }
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic