File indexing completed on 2024-05-12 15:58:11

0001 /*
0002  *  SPDX-FileCopyrightText: 2015 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef __KIS_BUSY_PROGRESS_INDICATOR_H
0008 #define __KIS_BUSY_PROGRESS_INDICATOR_H
0009 
0010 #include <QObject>
0011 #include <QScopedPointer>
0012 
0013 class KoProgressProxy;
0014 
0015 class KisBusyProgressIndicator : public QObject
0016 {
0017     Q_OBJECT
0018 public:
0019     explicit KisBusyProgressIndicator(KoProgressProxy *progressProxy);
0020     ~KisBusyProgressIndicator() override;
0021 
0022 public:
0023     /**
0024      * To be called when progressProxy is and will be no longer available
0025      * and this object is going to be deleted as well.
0026      */
0027     void prepareDestroying();
0028 
0029 public Q_SLOTS:
0030     /**
0031      * Trigger update of progress state.
0032      */
0033     void update();
0034 
0035 private Q_SLOTS:
0036     /**
0037      * Call only via emitting sigStartTimer, to ensure it is called in
0038      * the context of the QObject's thread.
0039      */
0040     void slotStartTimer();
0041     void timerFinished();
0042 
0043 Q_SIGNALS:
0044     void sigStartTimer();
0045 
0046 private:
0047     struct Private;
0048     const QScopedPointer<Private> m_d;
0049 };
0050 
0051 #endif /* __KIS_BUSY_PROGRESS_INDICATOR_H */