2021-05-24 07:25:56 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2008 Pino Toscano <pino@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2012 Guillermo A. Amaral B. <gamaral@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2008-08-23 00:07:59 +00:00
|
|
|
|
|
|
|
#ifndef _OKULAR_MOVIE_H_
|
|
|
|
#define _OKULAR_MOVIE_H_
|
|
|
|
|
2011-06-01 08:31:44 +00:00
|
|
|
#include "global.h"
|
2014-10-27 21:35:06 +00:00
|
|
|
#include "okularcore_export.h"
|
2008-08-23 00:07:59 +00:00
|
|
|
|
2018-08-31 09:23:45 +00:00
|
|
|
#include <QSize>
|
2008-08-23 00:07:59 +00:00
|
|
|
|
2012-06-29 09:16:28 +00:00
|
|
|
class QImage;
|
|
|
|
|
2008-08-23 00:07:59 +00:00
|
|
|
namespace Okular
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @short Contains information about a movie object.
|
|
|
|
*
|
|
|
|
* @since 0.8 (KDE 4.2)
|
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT Movie
|
2008-08-23 00:07:59 +00:00
|
|
|
{
|
|
|
|
public:
|
2008-08-24 21:33:23 +00:00
|
|
|
/**
|
|
|
|
* The play mode for playing the movie
|
|
|
|
*/
|
|
|
|
enum PlayMode {
|
2015-09-26 15:29:11 +00:00
|
|
|
PlayLimited, ///< Play a fixed amount of times, closing the movie controls at the end @since 0.24
|
|
|
|
PlayOpen, ///< Like PlayLimited, but leaving the controls open
|
2008-08-24 21:33:23 +00:00
|
|
|
PlayRepeat, ///< Play continuously until stopped
|
2008-10-24 07:10:18 +00:00
|
|
|
PlayPalindrome ///< Play forward, then backward, then again forward and so on until stopped
|
2008-08-24 21:33:23 +00:00
|
|
|
};
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-08-23 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Creates a new movie object with the given external @p fileName.
|
|
|
|
*/
|
|
|
|
explicit Movie(const QString &fileName);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-03-22 17:35:33 +00:00
|
|
|
/**
|
|
|
|
* Creates a new movie object with the given movie data.
|
|
|
|
*/
|
|
|
|
explicit Movie(const QString &fileName, const QByteArray &data);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-08-23 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Destroys the movie object.
|
|
|
|
*/
|
|
|
|
~Movie();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-08-23 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Returns the url of the movie.
|
|
|
|
*/
|
|
|
|
QString url() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-08-23 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Sets the size for the movie.
|
|
|
|
*/
|
2021-12-14 22:52:30 +00:00
|
|
|
void setSize(const QSize aspect);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-08-23 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Returns the size of the movie.
|
|
|
|
*/
|
|
|
|
QSize size() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-08-23 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Sets the @p rotation of the movie.
|
|
|
|
*/
|
|
|
|
void setRotation(Rotation rotation);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-08-23 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Returns the rotation of the movie.
|
|
|
|
*/
|
|
|
|
Rotation rotation() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-08-24 21:33:23 +00:00
|
|
|
/**
|
|
|
|
* Sets whether show a bar with movie controls
|
|
|
|
*/
|
|
|
|
void setShowControls(bool show);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-08-24 21:33:23 +00:00
|
|
|
/**
|
|
|
|
* Whether show a bar with movie controls
|
|
|
|
*/
|
|
|
|
bool showControls() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-08-24 21:33:23 +00:00
|
|
|
/**
|
|
|
|
* Sets the way the movie should be played
|
|
|
|
*/
|
|
|
|
void setPlayMode(PlayMode mode);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-08-24 21:33:23 +00:00
|
|
|
/**
|
|
|
|
* How to play the movie
|
|
|
|
*/
|
|
|
|
PlayMode playMode() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2015-09-26 15:29:11 +00:00
|
|
|
/**
|
|
|
|
* Sets how many times the movie should be played
|
|
|
|
* @since 0.24
|
|
|
|
*/
|
|
|
|
void setPlayRepetitions(double repetitions);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2015-09-26 15:29:11 +00:00
|
|
|
/**
|
|
|
|
* How many times to play the movie
|
|
|
|
* @since 0.24
|
|
|
|
*/
|
|
|
|
double playRepetitions() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-03-22 17:35:33 +00:00
|
|
|
/**
|
|
|
|
* Sets whether to play the movie automatically
|
|
|
|
*/
|
|
|
|
void setAutoPlay(bool autoPlay);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-03-22 17:35:33 +00:00
|
|
|
/**
|
|
|
|
* Whether to play the movie automatically
|
|
|
|
*/
|
|
|
|
bool autoPlay() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2023-02-15 23:32:49 +00:00
|
|
|
/**
|
|
|
|
* Sets whether to start the movie in paused mode
|
|
|
|
*/
|
|
|
|
void setStartPaused(bool startPaused);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether to start the movie in paused mode
|
|
|
|
*/
|
|
|
|
bool startPaused() const;
|
|
|
|
|
2012-06-29 09:16:28 +00:00
|
|
|
/**
|
|
|
|
* Sets whether to show a poster image.
|
|
|
|
*
|
|
|
|
* @since 4.10
|
|
|
|
*/
|
|
|
|
void setShowPosterImage(bool show);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-06-29 09:16:28 +00:00
|
|
|
/**
|
|
|
|
* Whether to show a poster image.
|
|
|
|
*
|
|
|
|
* @since 4.10
|
|
|
|
*/
|
|
|
|
bool showPosterImage() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-06-29 09:16:28 +00:00
|
|
|
/**
|
|
|
|
* Sets the poster image.
|
|
|
|
*
|
|
|
|
* @since 4.10
|
|
|
|
*/
|
|
|
|
void setPosterImage(const QImage &image);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-06-29 09:16:28 +00:00
|
|
|
/**
|
|
|
|
* Returns the poster image.
|
|
|
|
*
|
|
|
|
* @since 4.10
|
|
|
|
*/
|
|
|
|
QImage posterImage() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-08-23 00:07:59 +00:00
|
|
|
private:
|
|
|
|
class Private;
|
|
|
|
Private *const d;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-08-23 00:07:59 +00:00
|
|
|
Q_DISABLE_COPY(Movie)
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|