sysstatemgmt/systemstatereferenceplugins/clayer/inc/startupadaptationadapter.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2007-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 __STARTUPADAPTATIONADAPTER_H__
       
    17 #define __STARTUPADAPTATIONADAPTER_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 
       
    21 #include <ssm/startupadaptationobserver.h>
       
    22 
       
    23 class MStateAdaptation;
       
    24 class MSimAdaptation;
       
    25 class MRtcAdaptation;
       
    26 class MEmergencyCallRfAdaptation;
       
    27 class MMiscAdaptation;
       
    28 
       
    29 class CAdaptationBase;
       
    30 
       
    31 class CSaaStateAdaptation;
       
    32 class CSaaSimAdaptation;
       
    33 class CSaaRtcAdaptation;
       
    34 class CSaaEmergencyCallRfAdaptation;
       
    35 class CSaaMiscAdaptation;
       
    36 
       
    37 class CStartupAdaptation;
       
    38 
       
    39 /**
       
    40  * Defines the maximum number of adaptation classes that there are
       
    41  * 
       
    42  * @internalComponent
       
    43  */
       
    44 const TInt KMaxAdaptationClasses = 5;
       
    45 
       
    46 /**
       
    47  * Provides a class for managing the adaptation of the 5 adaptation interfaces
       
    48  * used by the adaptation server to the Core OS single interface adaptation
       
    49  * 
       
    50  * @internalComponent
       
    51  */
       
    52 NONSHARABLE_CLASS(CStartupAdaptationAdapter) : public CActive, MStartupAdaptationObserver
       
    53 {
       
    54 public:
       
    55 	~CStartupAdaptationAdapter();
       
    56 
       
    57 	static CStartupAdaptationAdapter* GetL();
       
    58 	static void Destroy();
       
    59 	
       
    60 	IMPORT_C static MStateAdaptation* NewStateAdaptationL();
       
    61 	IMPORT_C static MSimAdaptation* NewSimAdaptationL();
       
    62 	IMPORT_C static MRtcAdaptation* NewRtcAdaptationL();
       
    63 	IMPORT_C static MEmergencyCallRfAdaptation* NewEmergencyCallRfAdaptationL();
       
    64 	IMPORT_C static MMiscAdaptation* NewMiscAdaptationL();
       
    65 	
       
    66 	void QueueDispatchL(CAdaptationBase* aAdaptation);
       
    67 	void CancelDispatchedL(CAdaptationBase* aAdaptation);
       
    68 	void RemoveFromDispatchQueue(CAdaptationBase* aAdaptation);
       
    69 
       
    70 	// From MStartupAdaptationObserver
       
    71 	virtual void ResponseL(const StartupAdaptation::TCommand aCommandId, TDesC8& aData);
       
    72 	virtual void EventL(const StartupAdaptation::TEvent aEventId, TDesC8& aData);
       
    73 	
       
    74 protected:
       
    75 	// From CActive
       
    76 	void RunL();
       
    77 	TInt RunError(TInt aError);
       
    78 	void DoCancel();
       
    79 	
       
    80 private:
       
    81 	static CStartupAdaptationAdapter* NewLC();
       
    82 	CStartupAdaptationAdapter();
       
    83 	void ConstructL();
       
    84 	
       
    85 	CStartupAdaptation* GetAdaptationL();
       
    86 	
       
    87 	void DispatchQueued();
       
    88 	
       
    89 	void SelfComplete(TInt aError);
       
    90 	
       
    91 private:
       
    92 	CSaaStateAdaptation* iStateAdaptation;
       
    93 	CSaaSimAdaptation* iSimAdaptation;
       
    94 	CSaaRtcAdaptation* iRtcAdaptation;
       
    95 	CSaaEmergencyCallRfAdaptation* iEmergencyCallRfAdaptation;
       
    96 	CSaaMiscAdaptation* iMiscAdaptation;
       
    97 	
       
    98 	CStartupAdaptation* iStartupAdaptation;
       
    99 	
       
   100 	CAdaptationBase* iDispatchedAdaptation;
       
   101 	CAdaptationBase* iDispatchQueue[5];
       
   102 	TInt iDispatchQueueSize;
       
   103 };
       
   104 
       
   105 #endif // __STARTUPADAPTATIONADAPTER_H__