harvester/client/inc/harvestersessionwatcher.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 11 May 2010 16:36:55 +0300
branchRCL_3
changeset 12 9f21bab39f42
permissions -rw-r--r--
Revision: 201017 Kit: 201019

/*
* Copyright (c) 2007-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 HARVESTERSESSIONWATCHER_H
#define HARVESTERSESSIONWATCHER_H

#include <e32base.h>
#include <harvesterclient.h>

NONSHARABLE_CLASS( CHarvesterSessionWatcher ) : public CActive
	{
public:

    enum THarvesterWatcherState
        {
        EIdle,
        ERunning,
        ESCancelled
        };

	// Cancel and destroy
	~CHarvesterSessionWatcher();

	// Two-phased constructor.
	static CHarvesterSessionWatcher* NewL( MHarvesterSessionObserver& aObserver );

public:

    // from base class CActive
    void RunL();
    TInt RunError( TInt aError );
    void DoCancel();

private:	

    CHarvesterSessionWatcher( MHarvesterSessionObserver& aObserver );
    
    void ConstructL();
    
    void Start();

private:	
	
    RProcess iProcess;
    
    THarvesterWatcherState iState;
    
    MHarvesterSessionObserver* iObserver;   
	};

#endif // HARVESTERSESSIONWATCHER_H