add showControls and playMode properties

svn path=/trunk/KDE/kdegraphics/okular/; revision=851902
This commit is contained in:
Pino Toscano 2008-08-24 21:33:23 +00:00
parent 723aa28f91
commit 335a091ebc
2 changed files with 56 additions and 1 deletions

View file

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

View file

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