2012-11-23 11:20:35 +00:00
|
|
|
#ifndef CSV_DOC_OPERATION_H
|
|
|
|
#define CSV_DOC_OPERATION_H
|
|
|
|
|
2013-02-23 03:53:32 +00:00
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
class QHBoxLayout;
|
|
|
|
class QPushButton;
|
|
|
|
class QProgressBar;
|
2022-10-19 17:02:00 +00:00
|
|
|
class QWidget;
|
2012-11-23 11:20:35 +00:00
|
|
|
|
|
|
|
namespace CSVDoc
|
|
|
|
{
|
2013-02-23 03:53:32 +00:00
|
|
|
class Operation : public QObject
|
2012-11-23 11:20:35 +00:00
|
|
|
{
|
2022-09-22 18:26:05 +00:00
|
|
|
Q_OBJECT
|
2012-11-23 11:20:35 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
int mType;
|
|
|
|
bool mStalling;
|
|
|
|
QProgressBar* mProgressBar;
|
|
|
|
QPushButton* mAbortButton;
|
|
|
|
QHBoxLayout* mLayout;
|
2012-11-23 11:20:35 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
// not implemented
|
|
|
|
Operation(const Operation&);
|
|
|
|
Operation& operator=(const Operation&);
|
2012-11-23 11:20:35 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
void updateLabel(int threads = -1);
|
2012-11-23 11:20:35 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
public:
|
|
|
|
Operation(int type, QWidget* parent);
|
|
|
|
~Operation() override;
|
2012-11-23 11:20:35 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
void setProgress(int current, int max, int threads);
|
2012-11-23 11:20:35 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
int getType() const;
|
|
|
|
QHBoxLayout* getLayout() const;
|
2012-11-23 11:20:35 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
private:
|
|
|
|
void setBarColor(int type);
|
|
|
|
void initWidgets();
|
2013-02-11 10:30:16 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
signals:
|
2013-02-11 10:30:16 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
void abortOperation(int type);
|
2013-02-23 03:53:32 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
private slots:
|
2013-02-23 03:53:32 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
void abortOperation();
|
2012-11-23 11:20:35 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-02-11 10:30:16 +00:00
|
|
|
#endif
|