OpenMW
apps/opencs/view/doc/operation.hpp
Go to the documentation of this file.
00001 #ifndef CSV_DOC_OPERATION_H
00002 #define CSV_DOC_OPERATION_H
00003 
00004 #include <QObject>
00005 
00006 class QHBoxLayout;
00007 class QPushButton;
00008 class QProgressBar;
00009 
00010 namespace CSVDoc
00011 {
00012     class Operation : public QObject
00013     {
00014             Q_OBJECT
00015 
00016             int mType;
00017             bool mStalling;
00018             QProgressBar *mProgressBar;
00019             QPushButton *mAbortButton;
00020             QHBoxLayout *mLayout;
00021 
00022             // not implemented
00023             Operation (const Operation&);
00024             Operation& operator= (const Operation&);
00025 
00026             void updateLabel (int threads = -1);
00027 
00028         public:
00029 
00030             Operation (int type, QWidget *parent);
00031             ~Operation();
00032 
00033             void setProgress (int current, int max, int threads);
00034 
00035             int getType() const;
00036             QHBoxLayout *getLayout() const;
00037 
00038         private:
00039 
00040             void setBarColor (int type);
00041             void initWidgets();
00042 
00043         signals:
00044 
00045             void abortOperation (int type);
00046 
00047         private slots:
00048 
00049             void abortOperation();
00050     };
00051 }
00052 
00053 #endif