messagingappbase/mce/inc/MceUtilsIdleClass.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 14 Apr 2010 15:53:21 +0300
branchRCL_3
changeset 15 52d61119153d
parent 0 72b543305e3a
permissions -rw-r--r--
Revision: 201013 Kit: 201015

/*
* Copyright (c) 2002 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:  
*   Active object to count messages background for mainview.
*
*/



#ifndef MCEUTILSIDLECLASS_H
#define MCEUTILSIDLECLASS_H

//  INCLUDES
#include <e32base.h>

#include <bldvariant.hrh>


// FORWARD DECLARATIONS

// CLASS DECLARATION

class MMceUtilsIdleClassObserver
    {
    public:
    /**
    * return ETrue if wanted to be called again
    * EFalse if operation is ended.
    */
    virtual TBool MMceUtilsIdleClassStepL() = 0;
    };





/**
*  CMceUtilsIdleClass
*
*
*/
class CMceUtilsIdleClass : public CActive
    {
    public:  // Constructors and destructor
    
        /**
        *
        */
        static CMceUtilsIdleClass* NewL(
            MMceUtilsIdleClassObserver& aObserver );

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

    public: // New functions

        /**
        * Starts
        */
        void StartL();

        /**
        * Complete synchronously. 
        */
        void ForceFinishL();


    private:  // Functions from CActive
        /**
        * From CActive
        */
        virtual void DoCancel();

        /**
        * From CActive
        */
        virtual void RunL();

        /**
        * From CActive
        */
	    virtual TInt RunError(TInt aError);
	    
    private: // New functions
    
        /**
        * C++ constructor.
        */
        CMceUtilsIdleClass( MMceUtilsIdleClassObserver& aObserver );

        /**
        * Requests next operation.
        */
        void QueueNextL();

    private: //Data
        MMceUtilsIdleClassObserver& iObserver;
    };

#endif

// End of file