filemanager/src/filemanager/src/operationservice/fmoperationthread.h
changeset 33 328cf6fbe40c
parent 32 39cf9ced4cc4
equal deleted inserted replaced
32:39cf9ced4cc4 33:328cf6fbe40c
    17 */
    17 */
    18 
    18 
    19 #ifndef FMOPERATIONTHREAD_H
    19 #ifndef FMOPERATIONTHREAD_H
    20 #define FMOPERATIONTHREAD_H
    20 #define FMOPERATIONTHREAD_H
    21 
    21 
    22 #include "fmoperationservice.h"
    22 #include "fmoperationbase.h"
    23 #include "fmcommon.h"
    23 #include "fmcommon.h"
    24 
    24 
    25 #include <QString>
    25 #include <QString>
    26 #include <QStringList>
    26 #include <QStringList>
    27 
    27 
    28 #include <QThread>
    28 #include <QThread>
    29 
    29 
    30 class FmDriveDetailsSize;
       
    31 class FmOperationBase;
       
    32 
       
    33 class FmOperationCopy;
       
    34 class FmOperationMove;
       
    35 class FmOperationRemove;
       
    36 
       
    37 class FmOperationThread : public QThread
    30 class FmOperationThread : public QThread
    38 {
    31 {
    39     Q_OBJECT
    32     Q_OBJECT
    40 public:
    33 public:
    41     FmOperationThread( QObject *parent );
    34     FmOperationThread( QObject *parent );
    42     ~FmOperationThread();
    35     ~FmOperationThread();
    43 
    36     int prepareOperationAndStart( FmOperationBase* operationBase );    
    44     int asyncCopy( FmOperationBase* operationBase );
    37     void stop();    
    45     int asyncMove( FmOperationBase *operationBase );
       
    46     int asyncRemove( FmOperationBase *operationBase );
       
    47 
       
    48     int asyncFormat( FmOperationBase *operationBase );
       
    49     int asyncViewDriveDetails( FmOperationBase *operationBase );
       
    50     int asyncViewFolderDetails( FmOperationBase *operationBase );
       
    51     void stop();
       
    52 
       
    53 signals:
       
    54     void askForRename( const QString &srcFile, QString *destFile );
       
    55     void askForReplace( const QString &srcFile, const QString &destFile, bool *isAccepted );
       
    56     void driveSpaceChanged();
       
    57 
       
    58     void showNote(const char*);
       
    59     void notifyWaiting( bool cancelable );
       
    60     void notifyPreparing( bool cancelable );      // this step could not be used if not needed.
       
    61     void notifyStart( bool cancelable, int maxSteps );
       
    62     void notifyProgress( int currentStep );
       
    63 
       
    64     void notifyFinish(); 
       
    65     void notifyError(int error, QString errString ); 
       
    66     void notifyCanceled(); 
       
    67 
       
    68 private slots:
       
    69     void onAskForRename( const QString &srcFile, QString *destFile );
       
    70     void onAskForReplace( const QString &srcFile, const QString &destFile, bool *isAccepted );
       
    71     void onShowNote( const char *noteString );
       
    72     void on_operationElement_notifyPreparing( bool cancelable );
       
    73     void on_operationElement_notifyStart( bool cancelable, int maxSteps );
       
    74     void on_operationElement_notifyProgress( int currentStep );
       
    75 
    38 
    76 protected:
    39 protected:
    77     void run();
    40     void run();
    78 
    41 
    79 private:
    42 private: