diff --git a/core/movie.cpp b/core/movie.cpp index 185e75005..8c7ffa5ad 100644 --- a/core/movie.cpp +++ b/core/movie.cpp @@ -19,13 +19,17 @@ class Movie::Private public: Private( const QString &url ) : m_url( url ), - m_rotation( Rotation0 ) + m_rotation( Rotation0 ), + m_playMode( PlayOnce ), + m_showControls( false ) { } QString m_url; QSize m_aspect; Rotation m_rotation; + PlayMode m_playMode; + bool m_showControls : 1; }; Movie::Movie( const QString& fileName ) @@ -62,3 +66,23 @@ Rotation Movie::rotation() const { return d->m_rotation; } + +void Movie::setShowControls( bool show ) +{ + d->m_showControls = show; +} + +bool Movie::showControls() const +{ + return d->m_showControls; +} + +void Movie::setPlayMode( Movie::PlayMode mode ) +{ + d->m_playMode = mode; +} + +Movie::PlayMode Movie::playMode() const +{ + return d->m_playMode; +} diff --git a/core/movie.h b/core/movie.h index ca633fcb2..42b42166d 100644 --- a/core/movie.h +++ b/core/movie.h @@ -25,6 +25,17 @@ namespace Okular { class OKULAR_EXPORT Movie { public: + /** + * The play mode for playing the movie + */ + enum PlayMode + { + PlayOnce, ///< Play the movie once, closing the movie controls at the end + PlayOpen, ///< Like PlayOnce, but leaving the controls open + PlayRepeat, ///< Play continuously until stopped + PlayPalindrome ///< Play forward, then backward, then again foward and so on until stopped + }; + /** * Creates a new movie object with the given external @p fileName. */ @@ -60,6 +71,26 @@ class OKULAR_EXPORT Movie */ Rotation rotation() const; + /** + * Sets whether show a bar with movie controls + */ + void setShowControls( bool show ); + + /** + * Whether show a bar with movie controls + */ + bool showControls() const; + + /** + * Sets the way the movie should be played + */ + void setPlayMode( PlayMode mode ); + + /** + * How to play the movie + */ + PlayMode playMode() const; + private: class Private; Private* const d;