Chris@378: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
Chris@378: 
Chris@378: /*
Chris@378:     Sonic Visualiser
Chris@378:     An audio file viewer and annotation editor.
Chris@378:     Centre for Digital Music, Queen Mary, University of London.
Chris@378:     This file copyright 2007-2008 QMUL.
Chris@378:     
Chris@378:     This program is free software; you can redistribute it and/or
Chris@378:     modify it under the terms of the GNU General Public License as
Chris@378:     published by the Free Software Foundation; either version 2 of the
Chris@378:     License, or (at your option) any later version.  See the file
Chris@378:     COPYING included with this distribution for more information.
Chris@378: */
Chris@378: 
Chris@378: #ifndef _PROGRESS_DIALOG_H_
Chris@378: 
Chris@378: #include "base/ProgressReporter.h"
Chris@378: 
Chris@378: class QProgressDialog;
Chris@378: class QTimer;
Chris@378: 
Chris@378: class ProgressDialog : public ProgressReporter
Chris@378: {
Chris@378:     Q_OBJECT
Chris@378:     
Chris@378: public:
Chris@378:     ProgressDialog(QString message, bool cancellable,
Chris@378:                    int timeBeforeShow = 0, QWidget *parent = 0);
Chris@378:     virtual ~ProgressDialog();
Chris@378: 
Chris@410:     virtual bool isDefinite() const;
Chris@410:     virtual void setDefinite(bool definite);
Chris@410: 
Chris@410:     virtual bool wasCancelled() const;
Chris@410: 
Chris@378: signals:
Chris@410:     void showing();
Chris@378:     void cancelled();
Chris@378: 
Chris@378: public slots:
Chris@378:     virtual void setMessage(QString text);
Chris@378:     virtual void setProgress(int percentage);
Chris@378: 
Chris@378: protected slots:
Chris@378:     virtual void showTimerElapsed();
Chris@410:     void canceled();
Chris@378: 
Chris@378: protected:
Chris@378:     QProgressDialog *m_dialog;
Chris@378:     QTimer *m_showTimer;
Chris@378:     bool m_timerElapsed;
Chris@410:     bool m_cancelled;
Chris@378: };
Chris@378: 
Chris@378: #endif