filemanager/src/filemanager/src/operationservice/fmoperationcopy.h
changeset 37 15bc28c9dd51
parent 16 ada7962b4308
child 46 d58987eac7e8
equal deleted inserted replaced
16:ada7962b4308 37:15bc28c9dd51
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef FMOPERATIONCOPY_H
       
    19 #define FMOPERATIONCOPY_H
       
    20 #include <QObject>
       
    21 #include <QString>
       
    22 
       
    23 #include "fmoperationbase.h"
       
    24 
       
    25 class FmOperationCopy : public FmOperationBase
       
    26 {
       
    27 Q_OBJECT
       
    28 public:
       
    29     explicit FmOperationCopy( QObject *parent, QStringList sourceList, QString targetPath );
       
    30     virtual ~FmOperationCopy();
       
    31     int start( volatile bool *isStopped, QString *errString );
       
    32 
       
    33     QStringList sourceList();
       
    34     QString     targetPath();
       
    35 
       
    36 signals:
       
    37     void askForRename( const QString &srcFile, QString *destFile );
       
    38     void askForReplace( const QString &srcFile, const QString &destFile, bool *isAccepted );
       
    39     void notifyPreparing( bool cancelable );
       
    40     void notifyStart( bool cancelable, int maxSteps );
       
    41     void notifyProgress( int currentStep );
       
    42 
       
    43 private:
       
    44     int copy( const QString &source, const QString &targetPath, const QString &newTargetName = QString() );
       
    45     int copyDirInsideContent( const QString &srcPath, const QString &destPath );
       
    46     void IncreaseProgress( quint64 size );
       
    47 
       
    48 private:
       
    49     QStringList mSourceList;
       
    50     QString     mTargetPath;
       
    51     
       
    52 private:
       
    53     volatile bool *mStop;
       
    54     quint64 mTotalSize;
       
    55     
       
    56     QString       *mErrString;
       
    57 
       
    58     quint64 mCopiedSize;
       
    59     int     mTotalSteps;
       
    60     int     mCurrentStep;
       
    61 };
       
    62 #endif