landmarks/locationlandmarks/converter/inc/EPos_CPosLmConverterOperation.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 19 Aug 2010 10:20:18 +0300
branchRCL_3
changeset 42 02ba3f1733c6
parent 0 667063e416a2
permissions -rw-r--r--
Revision: 201030 Kit: 201033

/*
* Copyright (c) 2005 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: A converter representation of the operation class. It provides an interface
*  for operations that are performed in small synchronous steps.
*
*/


#ifndef CPOSLMCONVERTEROPERATION_H
#define CPOSLMCONVERTEROPERATION_H

//  INCLUDES
#include <EPos_CPosLmOperation.h>
#include "EPos_TPosLmConvOperationStatus.h"

// FORWARD DECLARATION

// CLASS DECLARATION

/**
*  A converter representation of the operation class. It provides an interface
*  for operations that are performed in small synchronous steps.
*/
class CPosLmConverterOperation : public CPosLmOperation
    {

    public:  // Constructors and destructor

        /**
        * Destructor.
        */
        virtual ~CPosLmConverterOperation();

    public: // From base classes

        /**
        * From CPosLmOperation.
        *
        * Performs one step of the operation asynchronously.
        *
        * @param aStatus The request status. Will be completed when the step
        *   has been performed. The request status will be @p KRequestPending
        *   if the step has not completed. It will be
        *   @p KPosLmOperationNotComplete if the step has completed but more
        *   steps are needed before the operation has finished. The request
        *   status will be @p KErrNone if the operation has finished
        *   successfully. The status will be set to an error code if the
        *   operation has failed.
        * @param aProgress Will be set to the progress of the operation when the
        *   step has finished.
        */
        void NextStep(
        /* OUT */   TRequestStatus& aStatus,
        /* OUT */   TReal32& aProgress
        );

        /**
        * From CPosLmOperation.
        *
        * Synchronous execution of the operation. Performs calls to NextStepL
        * until the operation is completed.
        *
        * When this function returns, the operation has finished.
        */
        void ExecuteL();

        /**
        * Synchronous incremental execution of the operation. Performs a single
        * step of the operation synchronously.
        *
        * Leaves with an error code if something goes wrong.
        *
        * @param aProgress Will be set to the progress of the operation when
        * the step has finished.
        * @return @p KPosLmOperationNotComplete if the step has completed but
        *   more steps are needed before the operation has finished,
        *   @p KErrNone if the operation has finished successfully.
        */
        virtual TInt NextStepL(
        /* OUT */       TReal32& aProgress
        ) = 0;

        /**
        * Handles any error generated by NextStepL. Will be called when
        * NextStepL leaves. The error code is allowed to be changed, if
        * necessary.
        *
        * @param aError An error code generated by NextStepL.
        */
        virtual void HandleError(
        /* IN/OUT */    TInt& aError
        ) = 0;

        /**
        * Handles a completed operation that has been successfully completed.
        * Will be called when NextStepL returns with KErrNone.
        *
        * For CPosLmConverterOperation this function is empty.
        */
        virtual void HandleOperationCompleted();

    protected:

        /**
        * C++ default constructor.
        */
        CPosLmConverterOperation();

        /**
        * Symbian 2nd phase constructor.
        */
        void BaseConstructL();

        /**
        * Retrieves the current progress of the operation.
        * Note: if called from the @p NextStepL function, this function returns
        * the progress of the previous step.
        * @return The progress of the operation.
        */
        TReal32 Progress();

    private:

        // By default, prohibit copy constructor
        CPosLmConverterOperation( const CPosLmConverterOperation& );
        // Prohibit assigment operator
        CPosLmConverterOperation& operator= ( const CPosLmConverterOperation& );

    private:

        TPosLmConvOperationStatus iOperationStatus;

        TReal32 iProgress;

    };

#endif      // CPOSLMCONVERTEROPERATION_H

// End of File