Okular

movie.h
1 /***************************************************************************
2  * Copyright (C) 2008 by Pino Toscano <[email protected]> *
3  * Copyright (C) 2012 by Guillermo A. Amaral B. <[email protected]> *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  ***************************************************************************/
10 
11 #ifndef _OKULAR_MOVIE_H_
12 #define _OKULAR_MOVIE_H_
13 
14 #include "global.h"
15 #include "okularcore_export.h"
16 
17 #include <QSize>
18 
19 class QImage;
20 
21 namespace Okular
22 {
23 /**
24  * @short Contains information about a movie object.
25  *
26  * @since 0.8 (KDE 4.2)
27  */
28 class OKULARCORE_EXPORT Movie
29 {
30 public:
31  /**
32  * The play mode for playing the movie
33  */
34  enum PlayMode {
35  PlayLimited, ///< Play a fixed amount of times, closing the movie controls at the end @since 0.24
36  PlayOpen, ///< Like PlayLimited, but leaving the controls open
37  PlayRepeat, ///< Play continuously until stopped
38  PlayPalindrome ///< Play forward, then backward, then again forward and so on until stopped
39  };
40 
41  /**
42  * Creates a new movie object with the given external @p fileName.
43  */
44  explicit Movie(const QString &fileName);
45 
46  /**
47  * Creates a new movie object with the given movie data.
48  */
49  explicit Movie(const QString &fileName, const QByteArray &data);
50 
51  /**
52  * Destroys the movie object.
53  */
54  ~Movie();
55 
56  /**
57  * Returns the url of the movie.
58  */
59  QString url() const;
60 
61  /**
62  * Sets the size for the movie.
63  */
64  void setSize(const QSize &aspect); // TODO remove the & when we do a BIC change elsewhere
65 
66  /**
67  * Returns the size of the movie.
68  */
69  QSize size() const;
70 
71  /**
72  * Sets the @p rotation of the movie.
73  */
74  void setRotation(Rotation rotation);
75 
76  /**
77  * Returns the rotation of the movie.
78  */
79  Rotation rotation() const;
80 
81  /**
82  * Sets whether show a bar with movie controls
83  */
84  void setShowControls(bool show);
85 
86  /**
87  * Whether show a bar with movie controls
88  */
89  bool showControls() const;
90 
91  /**
92  * Sets the way the movie should be played
93  */
94  void setPlayMode(PlayMode mode);
95 
96  /**
97  * How to play the movie
98  */
99  PlayMode playMode() const;
100 
101  /**
102  * Sets how many times the movie should be played
103  * @since 0.24
104  */
105  void setPlayRepetitions(double repetitions);
106 
107  /**
108  * How many times to play the movie
109  * @since 0.24
110  */
111  double playRepetitions() const;
112 
113  /**
114  * Sets whether to play the movie automatically
115  */
116  void setAutoPlay(bool autoPlay);
117 
118  /**
119  * Whether to play the movie automatically
120  */
121  bool autoPlay() const;
122 
123  /**
124  * Sets whether to show a poster image.
125  *
126  * @since 4.10
127  */
128  void setShowPosterImage(bool show);
129 
130  /**
131  * Whether to show a poster image.
132  *
133  * @since 4.10
134  */
135  bool showPosterImage() const;
136 
137  /**
138  * Sets the poster image.
139  *
140  * @since 4.10
141  */
142  void setPosterImage(const QImage &image);
143 
144  /**
145  * Returns the poster image.
146  *
147  * @since 4.10
148  */
149  QImage posterImage() const;
150 
151 private:
152  class Private;
153  Private *const d;
154 
155  Q_DISABLE_COPY(Movie)
156 };
157 
158 }
159 
160 #endif
Rotation
A rotation.
Definition: global.h:48
global.h
Definition: action.h:19
Play a fixed amount of times, closing the movie controls at the end.
Definition: movie.h:35
PlayMode
The play mode for playing the movie.
Definition: movie.h:34
Like PlayLimited, but leaving the controls open.
Definition: movie.h:36
Play continuously until stopped.
Definition: movie.h:37
Contains information about a movie object.
Definition: movie.h:28
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu May 13 2021 22:35:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.