File indexing completed on 2024-04-28 04:32:44
0001 /* 0002 SPDX-FileCopyrightText: 2008 Pino Toscano <pino@kde.org> 0003 SPDX-FileCopyrightText: 2012 Guillermo A. Amaral B. <gamaral@kde.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef _OKULAR_MOVIE_H_ 0009 #define _OKULAR_MOVIE_H_ 0010 0011 #include "global.h" 0012 #include "okularcore_export.h" 0013 0014 #include <QSize> 0015 0016 class QImage; 0017 0018 namespace Okular 0019 { 0020 /** 0021 * @short Contains information about a movie object. 0022 * 0023 * @since 0.8 (KDE 4.2) 0024 */ 0025 class OKULARCORE_EXPORT Movie 0026 { 0027 public: 0028 /** 0029 * The play mode for playing the movie 0030 */ 0031 enum PlayMode { 0032 PlayLimited, ///< Play a fixed amount of times, closing the movie controls at the end @since 0.24 0033 PlayOpen, ///< Like PlayLimited, but leaving the controls open 0034 PlayRepeat, ///< Play continuously until stopped 0035 PlayPalindrome ///< Play forward, then backward, then again forward and so on until stopped 0036 }; 0037 0038 /** 0039 * Creates a new movie object with the given external @p fileName. 0040 */ 0041 explicit Movie(const QString &fileName); 0042 0043 /** 0044 * Creates a new movie object with the given movie data. 0045 */ 0046 explicit Movie(const QString &fileName, const QByteArray &data); 0047 0048 /** 0049 * Destroys the movie object. 0050 */ 0051 ~Movie(); 0052 0053 /** 0054 * Returns the url of the movie. 0055 */ 0056 QString url() const; 0057 0058 /** 0059 * Sets the size for the movie. 0060 */ 0061 void setSize(const QSize aspect); 0062 0063 /** 0064 * Returns the size of the movie. 0065 */ 0066 QSize size() const; 0067 0068 /** 0069 * Sets the @p rotation of the movie. 0070 */ 0071 void setRotation(Rotation rotation); 0072 0073 /** 0074 * Returns the rotation of the movie. 0075 */ 0076 Rotation rotation() const; 0077 0078 /** 0079 * Sets whether show a bar with movie controls 0080 */ 0081 void setShowControls(bool show); 0082 0083 /** 0084 * Whether show a bar with movie controls 0085 */ 0086 bool showControls() const; 0087 0088 /** 0089 * Sets the way the movie should be played 0090 */ 0091 void setPlayMode(PlayMode mode); 0092 0093 /** 0094 * How to play the movie 0095 */ 0096 PlayMode playMode() const; 0097 0098 /** 0099 * Sets how many times the movie should be played 0100 * @since 0.24 0101 */ 0102 void setPlayRepetitions(double repetitions); 0103 0104 /** 0105 * How many times to play the movie 0106 * @since 0.24 0107 */ 0108 double playRepetitions() const; 0109 0110 /** 0111 * Sets whether to play the movie automatically 0112 */ 0113 void setAutoPlay(bool autoPlay); 0114 0115 /** 0116 * Whether to play the movie automatically 0117 */ 0118 bool autoPlay() const; 0119 0120 /** 0121 * Sets whether to start the movie in paused mode 0122 */ 0123 void setStartPaused(bool startPaused); 0124 0125 /** 0126 * Whether to start the movie in paused mode 0127 */ 0128 bool startPaused() const; 0129 0130 /** 0131 * Sets whether to show a poster image. 0132 * 0133 * @since 4.10 0134 */ 0135 void setShowPosterImage(bool show); 0136 0137 /** 0138 * Whether to show a poster image. 0139 * 0140 * @since 4.10 0141 */ 0142 bool showPosterImage() const; 0143 0144 /** 0145 * Sets the poster image. 0146 * 0147 * @since 4.10 0148 */ 0149 void setPosterImage(const QImage &image); 0150 0151 /** 0152 * Returns the poster image. 0153 * 0154 * @since 4.10 0155 */ 0156 QImage posterImage() const; 0157 0158 private: 0159 class Private; 0160 Private *const d; 0161 0162 Q_DISABLE_COPY(Movie) 0163 }; 0164 0165 } 0166 0167 #endif