harvester/server/inc/ondemandao.h
changeset 0 c53acadfccc6
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 2008-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 #ifndef __ONDEMANDAO_H__
       
    18 #define __ONDEMANDAO_H__
       
    19 
       
    20 #include <e32base.h>	// For CActive, link against: euser.lib
       
    21 #include <e32std.h>		// For RTimer, link against: euser.lib
       
    22 
       
    23 class CMdESession;
       
    24 class CMdEHarvesterSession;
       
    25 class MMonitorPluginObserver;
       
    26 class CHarvesterPluginFactory;
       
    27 class CHarvesterData;
       
    28 
       
    29 class COnDemandAO : public CActive
       
    30 {
       
    31 public:
       
    32 	// Cancel and destroy
       
    33 	~COnDemandAO();
       
    34 
       
    35 	// Two-phased constructor.
       
    36 	static COnDemandAO* NewL( CMdESession& aSession, MMonitorPluginObserver& aObserver,
       
    37 			CHarvesterPluginFactory& aPluginFactory, RPointerArray<CHarvesterData>* aPhArray);
       
    38 
       
    39 	// Two-phased constructor.
       
    40 	static COnDemandAO* NewLC( CMdESession& aSession, MMonitorPluginObserver& aObserver,
       
    41 			CHarvesterPluginFactory& aPluginFactory, RPointerArray<CHarvesterData>* aPhArray);
       
    42 
       
    43 public: // New functions
       
    44 	void StartL();
       
    45 
       
    46 private:
       
    47 	// C++ constructor
       
    48 	COnDemandAO();
       
    49 	
       
    50 	// Second-phase constructor
       
    51 	void ConstructL( CMdESession& aSession, MMonitorPluginObserver& aObserver,
       
    52 			CHarvesterPluginFactory& aPluginFactory, RPointerArray<CHarvesterData>* aPhArray);
       
    53 	void WaitHarvestingRequest();
       
    54 	
       
    55 private: // From CActive
       
    56 	// Handle completion
       
    57 	void RunL();
       
    58 	
       
    59 	// How to cancel me
       
    60 	void DoCancel();
       
    61 	
       
    62 	// Override to handle leaves from RunL(). Default implementation causes
       
    63 	// the active scheduler to panic.
       
    64 	TInt RunError( TInt aError );
       
    65 
       
    66 private:
       
    67 
       
    68 private:
       
    69 	CMdEHarvesterSession* iMdEHarvesterSession;
       
    70 	MMonitorPluginObserver* iObserver;
       
    71 	CHarvesterPluginFactory* iPluginFactory;
       
    72 	
       
    73 	RPointerArray<CHarvesterData> *iReadyPhArray;
       
    74 };
       
    75 
       
    76 #endif // __ONDEMANDAO_H__