Extend GuiUtils with helper function for ScreenAnnotations

REVIEW: 106607
remotes/origin/KDE/4.10
Tobias Koenig 14 years ago
parent 563ad0458e
commit a41a727e21
  1. 15
      ui/guiutils.cpp
  2. 9
      ui/guiutils.h

@ -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;
}
}

@ -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 );
}

Loading…
Cancel
Save