PageRenderTime 51ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/FOSS_S1/stlinux24-target-qt-embedded-4.6.0-27.src/qt-everywhere-opensource-src-4.6.0/src/gui/image/qmovie.h

https://gitlab.com/cybok/BMW-OpenSource
C Header | 177 lines | 105 code | 32 blank | 40 comment | 3 complexity | 0aec07383b85bd66855ddb4c735cf565 MD5 | raw file
  1. /****************************************************************************
  2. **
  3. ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
  4. ** All rights reserved.
  5. ** Contact: Nokia Corporation (qt-info@nokia.com)
  6. **
  7. ** This file is part of the QtGui module of the Qt Toolkit.
  8. **
  9. ** $QT_BEGIN_LICENSE:LGPL$
  10. ** Commercial Usage
  11. ** Licensees holding valid Qt Commercial licenses may use this file in
  12. ** accordance with the Qt Commercial License Agreement provided with the
  13. ** Software or, alternatively, in accordance with the terms contained in
  14. ** a written agreement between you and Nokia.
  15. **
  16. ** GNU Lesser General Public License Usage
  17. ** Alternatively, this file may be used under the terms of the GNU Lesser
  18. ** General Public License version 2.1 as published by the Free Software
  19. ** Foundation and appearing in the file LICENSE.LGPL included in the
  20. ** packaging of this file. Please review the following information to
  21. ** ensure the GNU Lesser General Public License version 2.1 requirements
  22. ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
  23. **
  24. ** In addition, as a special exception, Nokia gives you certain additional
  25. ** rights. These rights are described in the Nokia Qt LGPL Exception
  26. ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
  27. **
  28. ** GNU General Public License Usage
  29. ** Alternatively, this file may be used under the terms of the GNU
  30. ** General Public License version 3.0 as published by the Free Software
  31. ** Foundation and appearing in the file LICENSE.GPL included in the
  32. ** packaging of this file. Please review the following information to
  33. ** ensure the GNU General Public License version 3.0 requirements will be
  34. ** met: http://www.gnu.org/copyleft/gpl.html.
  35. **
  36. ** If you have questions regarding the use of this file, please contact
  37. ** Nokia at qt-info@nokia.com.
  38. ** $QT_END_LICENSE$
  39. **
  40. ****************************************************************************/
  41. #ifndef QMOVIE_H
  42. #define QMOVIE_H
  43. #include <QtCore/qobject.h>
  44. #ifndef QT_NO_MOVIE
  45. #include <QtCore/qbytearray.h>
  46. #include <QtCore/qlist.h>
  47. #include <QtCore/qobject.h>
  48. #include <QtGui/qimagereader.h>
  49. #ifdef QT3_SUPPORT
  50. #include <QtGui/qimage.h>
  51. #include <QtGui/qpixmap.h>
  52. #endif
  53. QT_BEGIN_HEADER
  54. QT_BEGIN_NAMESPACE
  55. QT_MODULE(Gui)
  56. class QByteArray;
  57. class QColor;
  58. class QIODevice;
  59. class QImage;
  60. class QPixmap;
  61. class QRect;
  62. class QSize;
  63. class QMoviePrivate;
  64. class Q_GUI_EXPORT QMovie : public QObject
  65. {
  66. Q_OBJECT
  67. Q_DECLARE_PRIVATE(QMovie)
  68. Q_ENUMS(MovieState CacheMode)
  69. Q_PROPERTY(int speed READ speed WRITE setSpeed)
  70. Q_PROPERTY(CacheMode cacheMode READ cacheMode WRITE setCacheMode)
  71. public:
  72. enum MovieState {
  73. NotRunning,
  74. Paused,
  75. Running
  76. };
  77. enum CacheMode {
  78. CacheNone,
  79. CacheAll
  80. };
  81. QMovie(QObject *parent = 0);
  82. explicit QMovie(QIODevice *device, const QByteArray &format = QByteArray(), QObject *parent = 0);
  83. explicit QMovie(const QString &fileName, const QByteArray &format = QByteArray(), QObject *parent = 0);
  84. ~QMovie();
  85. static QList<QByteArray> supportedFormats();
  86. void setDevice(QIODevice *device);
  87. QIODevice *device() const;
  88. void setFileName(const QString &fileName);
  89. QString fileName() const;
  90. void setFormat(const QByteArray &format);
  91. QByteArray format() const;
  92. void setBackgroundColor(const QColor &color);
  93. QColor backgroundColor() const;
  94. MovieState state() const;
  95. QRect frameRect() const;
  96. QImage currentImage() const;
  97. QPixmap currentPixmap() const;
  98. bool isValid() const;
  99. bool jumpToFrame(int frameNumber);
  100. int loopCount() const;
  101. int frameCount() const;
  102. int nextFrameDelay() const;
  103. int currentFrameNumber() const;
  104. int speed() const;
  105. QSize scaledSize();
  106. void setScaledSize(const QSize &size);
  107. CacheMode cacheMode() const;
  108. void setCacheMode(CacheMode mode);
  109. CacheMode cacheMode(); // ### Qt 5: remove me
  110. Q_SIGNALS:
  111. void started();
  112. void resized(const QSize &size);
  113. void updated(const QRect &rect);
  114. void stateChanged(QMovie::MovieState state);
  115. void error(QImageReader::ImageReaderError error);
  116. void finished();
  117. void frameChanged(int frameNumber);
  118. public Q_SLOTS:
  119. void start();
  120. bool jumpToNextFrame();
  121. void setPaused(bool paused);
  122. void stop();
  123. void setSpeed(int percentSpeed);
  124. private:
  125. Q_DISABLE_COPY(QMovie)
  126. Q_PRIVATE_SLOT(d_func(), void _q_loadNextFrame())
  127. #ifdef QT3_SUPPORT
  128. public:
  129. inline QT3_SUPPORT bool isNull() const { return isValid(); }
  130. inline QT3_SUPPORT int frameNumber() const { return currentFrameNumber(); }
  131. inline QT3_SUPPORT bool running() const { return state() == Running; }
  132. inline QT3_SUPPORT bool paused() const { return state() == Paused; }
  133. inline QT3_SUPPORT bool finished() const { return state() == NotRunning; }
  134. inline QT3_SUPPORT void restart() { stop(); start(); }
  135. inline QT3_SUPPORT QImage frameImage() const { return currentImage(); }
  136. inline QT3_SUPPORT QPixmap framePixmap() const { return currentPixmap(); }
  137. inline QT3_SUPPORT void step() { jumpToNextFrame(); }
  138. inline QT3_SUPPORT void pause() { setPaused(true); }
  139. inline QT3_SUPPORT void unpause() { setPaused(false); }
  140. #endif
  141. };
  142. QT_END_NAMESPACE
  143. QT_END_HEADER
  144. #endif // QT_NO_MOVIE
  145. #endif // QMOVIE_H