emailuis/nmailuiengine/inc/nmoperation.h
branchRCL_3
changeset 63 d189ee25cf9d
equal deleted inserted replaced
61:dcf0eedfc1a3 63:d189ee25cf9d
       
     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 NMOPERATION_H_
       
    19 #define NMOPERATION_H_
       
    20 
       
    21 #include <QObject>
       
    22 #include "nmuienginedef.h"
       
    23 
       
    24 
       
    25 class NMUIENGINE_EXPORT NmOperation: public QObject
       
    26 {
       
    27     Q_OBJECT
       
    28 
       
    29 public:
       
    30     NmOperation();  
       
    31     bool isRunning() const;
       
    32     void addPreliminaryOperation(NmOperation *operation);
       
    33     
       
    34 signals:
       
    35     void operationProgressChanged(int progress);
       
    36     void operationCompleted(int result = 0);
       
    37     void operationCancelled();
       
    38 
       
    39 public slots:
       
    40     void completeOperation(int result);
       
    41     void cancelOperation();
       
    42     void updateOperationProgress(int progress);
       
    43 
       
    44 protected slots:
       
    45     virtual void runAsyncOperation();
       
    46     virtual void handlePreliminaryOperationFinished();
       
    47 
       
    48 private slots:
       
    49     void deleteOperation();
       
    50     
       
    51 protected:
       
    52     virtual ~NmOperation();  
       
    53     virtual void doCompleteOperation();
       
    54     virtual void doCancelOperation();
       
    55     virtual void doUpdateOperationProgress();
       
    56     virtual void doRunAsyncOperation() = 0;
       
    57 
       
    58     
       
    59 private:
       
    60     int mProgress;
       
    61     bool mIsRunning;
       
    62     QList<NmOperation *> mPreliminaryOperations;
       
    63 };
       
    64 
       
    65 #endif /* NMOPERATION_H_ */