File indexing completed on 2025-01-05 03:56:39

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2012-01-26
0007  * Description : a progress bar with information dispatched to progress manager
0008  *
0009  * SPDX-FileCopyrightText: 2012-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_DPROGRESS_WDG_H
0016 #define DIGIKAM_DPROGRESS_WDG_H
0017 
0018 // Qt includes
0019 
0020 #include <QProgressBar>
0021 
0022 // Local includes
0023 
0024 #include "digikam_export.h"
0025 
0026 namespace Digikam
0027 {
0028 
0029 class DIGIKAM_EXPORT DProgressWdg : public QProgressBar
0030 {
0031     Q_OBJECT
0032 
0033 public:
0034 
0035     explicit DProgressWdg(QWidget* const parent);
0036     ~DProgressWdg() override;
0037 
0038     /**
0039      * Call this method to start a new instance of progress notification into progress manager
0040      * You can pass title string to name progress item, and set it as cancelable. In this case,
0041      * signalProgressCanceled() is fired when user press cancel button from progress manager.
0042      * This item can also accept a thumbnail that you can change through progresssThumbnailChanged().
0043      */
0044     void progressScheduled(const QString& title, bool canBeCanceled, bool hasThumb);
0045 
0046     /**
0047      * Change thumbnail in progress manager
0048      */
0049     void progressThumbnailChanged(const QPixmap& thumb);
0050 
0051     /**
0052      * Change status string in progress manager
0053      */
0054     void progressStatusChanged(const QString& status);
0055 
0056     /**
0057      * Call this method to query progress manager that process is done.
0058      */
0059     void progressCompleted();
0060 
0061 Q_SIGNALS:
0062 
0063     /**
0064      * Fired when user press cancel button from progress manager.
0065      */
0066     void signalProgressCanceled();
0067 
0068 private Q_SLOTS:
0069 
0070     void slotValueChanged(int);
0071     void slotProgressCanceled(const QString& id);
0072 
0073 private:
0074 
0075     class Private;
0076     Private* const d;
0077 };
0078 
0079 } // namespace Digikam
0080 
0081 #endif // DIGIKAM_DPROGRESS_WDG_H