sysstatemgmt/systemstatereferenceplugins/clayer/inc/adaptationbase.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __ADAPTATIONBASE_H__
       
    17 #define __ADAPTATIONBASE_H__
       
    18 
       
    19 #include <ssm/ssmadaptation.h>
       
    20 
       
    21 #include <ssm/startupadaptationcommands.h>
       
    22 
       
    23 class CStartupAdaptationAdapter;
       
    24 
       
    25 /*
       
    26  * Provides an abstract class for the various adaptation classes
       
    27  * 
       
    28  * @internalComponent
       
    29  */
       
    30 NONSHARABLE_CLASS(CAdaptationBase) : public CBase
       
    31 {
       
    32 public:
       
    33 	
       
    34 	~CAdaptationBase();
       
    35 	
       
    36 public:
       
    37 
       
    38 	void SetDispatched(TBool aDispatched);
       
    39 	TBool Dispatched();
       
    40 
       
    41 	void SetCommandId(StartupAdaptation::TCommand aCommandId);
       
    42 	StartupAdaptation::TCommand CommandId();
       
    43 	
       
    44 	/**
       
    45 	 * Callback function called by the adaptation adapter when the command from this adaptation has been completed 
       
    46 	 * 
       
    47 	 * @internalComponent
       
    48 	 */
       
    49 	virtual void RequestComplete(const StartupAdaptation::TCommand aCommandId, TDesC8& aRetPckg) = 0; 
       
    50 	
       
    51 	/**
       
    52 	 * Returns a pointer to the package descriptor to pass as the parameters
       
    53 	 * to the startup adaptation for this command
       
    54 	 * 
       
    55 	 * @internalComponent
       
    56 	 */ 
       
    57 	virtual TDesC8* ParameterPckg() = 0;
       
    58 		
       
    59 	void CompleteRequestStatus(TInt aValue);
       
    60 
       
    61 protected:
       
    62 	CAdaptationBase(CStartupAdaptationAdapter* aAdapter);
       
    63 	
       
    64 	TBool Busy();
       
    65 		
       
    66 	void SetRequestStatus(TRequestStatus* aStatus);
       
    67 	
       
    68 	void CancelRequest();
       
    69 
       
    70 protected:
       
    71 	CStartupAdaptationAdapter* iAdapter;
       
    72 private:
       
    73 	TRequestStatus* iRequestStatus;
       
    74 	TBool iDispatched;
       
    75 	StartupAdaptation::TCommand iCommandId;
       
    76 };
       
    77 
       
    78 #endif // __ADAPTATIONBASE_H__