File indexing completed on 2024-06-09 04:52:59

0001 /*
0002     SPDX-FileCopyrightText: 2007-2009 Sergio Pistone <sergio_pistone@yahoo.com.ar>
0003     SPDX-FileCopyrightText: 2010-2022 Mladen Milinkovic <max@smoothware.net>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef PROGRESSDIALOG_H
0009 #define PROGRESSDIALOG_H
0010 
0011 #include <QDialog>
0012 
0013 QT_FORWARD_DECLARE_CLASS(QLabel)
0014 QT_FORWARD_DECLARE_CLASS(QProgressBar)
0015 QT_FORWARD_DECLARE_CLASS(QCloseEvent)
0016 QT_FORWARD_DECLARE_CLASS(QDialogButtonBox)
0017 
0018 namespace SubtitleComposer {
0019 class ProgressDialog : public QDialog
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     ProgressDialog(const QString &caption, const QString &description, bool allowCancel, QWidget *parent = 0);
0025 
0026     int value() const;
0027     int minimum() const;
0028     int maximum() const;
0029     QString description() const;
0030     bool isCancellable() const;
0031 
0032 protected:
0033     void closeEvent(QCloseEvent *event) override;
0034 
0035 public slots:
0036     void setMinimum(int minimum);
0037     void incrementMinimum(int delta);
0038     void setMaximum(int maximum);
0039     void incrementMaximum(int delta);
0040     void setValue(int value);
0041     void setDescription(const QString &description);
0042     void setCancellable(bool cancellable);
0043 
0044 private:
0045     QLabel *m_label;
0046     QProgressBar *m_progressBar;
0047     QDialogButtonBox *m_buttonBox;
0048 };
0049 }
0050 #endif