filemanager/src/filemanager/src/operationservice/fmoperationmove.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 03 May 2010 12:24:39 +0300
changeset 16 ada7962b4308
parent 14 1957042d8c7e
child 21 15299bc55001
permissions -rw-r--r--
Revision: 201015 Kit: 201018

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: 
*
*/

#ifndef FMOPERATIONMOVE_H
#define FMOPERATIONMOVE_H
#include <QObject>
#include <QString>

#include "fmoperationbase.h"

class FmOperationMove : public FmOperationBase
{
Q_OBJECT
public:
    explicit FmOperationMove( QObject *parent, QStringList sourceList, QString targetPath );
    virtual ~FmOperationMove();
    QStringList sourceList();
    QString     targetPath();
    int start( volatile bool *isStopped, QString *errString );

signals:
    void askForRename( const QString &srcFile, QString *destFile );
    void askForReplace( const QString &srcFile, const QString &destFile, bool *isAccepted );
    void notifyPreparing( bool cancelable );
    void notifyStart( bool cancelable, int maxSteps );
    void notifyProgress( int currentStep );

private:
    int move( const QString &source, const QString &targetPath, const QString &newTargetName = QString() );
    int moveDirInsideContent( const QString &srcPath, const QString &destPath );
    void IncreaseProgress( quint64 size );
     
private:
    QStringList mSourceList;
    QString     mTargetPath;
    
private:
    volatile bool  *mStop;
    quint64   mTotalSize;
    QString   *mErrString;

    quint64 mMovedSize;
    int     mTotalSteps;
    int     mCurrentStep;
};

#endif