File indexing completed on 2024-04-21 05:48:32

0001 /*
0002     SPDX-FileCopyrightText: 2016 ROSA
0003     SPDX-License-Identifier: GPL-3.0-or-later
0004 */
0005 
0006 #ifndef EXTERNALPROGRESSBAR_H
0007 #define EXTERNALPROGRESSBAR_H
0008 
0009 ////////////////////////////////////////////////////////////////////////////////
0010 // Class for exporting progressbar state to some external component
0011 // At the moment implemented only for the Windows taskbar
0012 
0013 
0014 #include "common.h"
0015 
0016 class ExternalProgressBarPrivate;
0017 class ExternalProgressBar
0018 {
0019 protected:
0020     ExternalProgressBarPrivate* const d_ptr;
0021 
0022 public:
0023     explicit ExternalProgressBar(QWidget* mainWindow);
0024     ~ExternalProgressBar();
0025 
0026     // Initializes the external progress bar and sets its limits
0027     bool InitProgressBar(quint64 maxSteps);
0028 
0029     // Deinitializes the external progress bar and returns into the normal state
0030     bool DestroyProgressBar();
0031 
0032     // Updates the current progress bar position
0033     bool SetProgressValue(quint64 currentSteps);
0034 
0035     // Sets the progress bar to indicate pause
0036     bool ProgressSetPause();
0037 
0038     // Sets the progress bar to indicate an error
0039     bool ProgressSetError();
0040 
0041 protected:
0042     // Maximum counter value for the progress bar
0043     quint64 m_MaxValue;
0044 };
0045 
0046 #endif // EXTERNALPROGRESSBAR_H