ImagePlayer.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef IMAGEPLAYER_H
  2. #define IMAGEPLAYER_H
  3. #include "DeviceWatcher/DeviceWatcher.h"
  4. #include <QObject>
  5. #include <QImage>
  6. #include <QScopedPointer>
  7. class ImagePlayerPrivate;
  8. class ImagePlayer : public QObject
  9. {
  10. Q_OBJECT
  11. Q_DISABLE_COPY(ImagePlayer)
  12. #ifdef g_ImagePlayer
  13. #undef g_ImagePlayer
  14. #endif
  15. #define g_ImagePlayer (ImagePlayer::instance())
  16. public:
  17. inline static ImagePlayer* instance() {
  18. static ImagePlayer* imagePlayer(new ImagePlayer(qApp));
  19. return imagePlayer;
  20. }
  21. void imagePlayerRequestFileNames(const int type);
  22. void imagePlayerPlayListViewIndex(const int type, const int index);
  23. void imagePlayerPlayPreviousListViewIndex();
  24. void imagePlayerPlayNextListViewIndex();
  25. void imagePlayerRotateImage();
  26. void imagePlayerZoomInImage();
  27. void imagePlayerZoomOutImage();
  28. signals:
  29. void onImagePlayerFileNames(const int type, const QString &xml);
  30. // void onImagePlayerFilePath(const int type, const QString& path);
  31. void onImagePlayerChange(const int type, const QString &filePath, const int index, const int percent, const int rotate);
  32. protected slots:
  33. void onDeviceWatcherStatus(const int type, const int status);
  34. void onImageFilePath(const QString &path, const int type);
  35. private:
  36. explicit ImagePlayer(QObject* parent = NULL);
  37. ~ImagePlayer();
  38. friend class ImagePlayerPrivate;
  39. QScopedPointer<ImagePlayerPrivate> m_Private;
  40. };
  41. #endif // IMAGEPLAYER_H