/** * @RDE_HEADER@ * The FileContentPreviewPlaybackWidget offers an UI to preview a FileContent * $Id$ * $HeadURL$ * $Author$ * Created by Iuliana Ojog, SLSE, 2017-06-02 */ #pragma once #include "flm_get_content.h" #include #include #include #include // TODO: in a config ? #define ZOOM_MIN 0.5 #define ZOOM_MAX 2.0 #define ZOOM_DEFAULT 1.0 namespace Ui { class FileContentPreviewPlaybackWidget; } namespace NGL { class PDFWidget; } namespace FileManagement { class FileContentPreviewPlaybackWidget : public QWidget { Q_OBJECT public: explicit FileContentPreviewPlaybackWidget(const std::shared_ptr &ftc, QWidget *parent = nullptr); ~FileContentPreviewPlaybackWidget(); bool init(const FileContent &data, int pageNo = -1, double zoomFactor = ZOOM_DEFAULT, int rotation = 0, int duration = 0, const QString &userText = QString()); bool pauseTimer(); bool startTimer(); int getNumPages() const; int getCurPage() const; void setPage(int pageNo); void setZoomFactor(double zoomFactor); void setRotation(int rotation); void ensureDataIsSet(); void showEvent(QShowEvent *e) override; Q_SIGNALS: void currentPageChanged(int curPage); void rotationChanged(int rotation); private: Ui::FileContentPreviewPlaybackWidget *m_ui{nullptr}; std::shared_ptr m_ftc; GetFileContent *m_getContent{nullptr}; FileContent m_data; std::vector m_content; int m_duration{0}; int m_pageNo{-1}; double m_zoomFactor{ZOOM_DEFAULT}; int m_rotation; // degree QTimer m_closeTimer; NGL::PDFWidget *m_pdfWidget{nullptr}; QString m_userText; LOGGER_T m_logger; }; }