sysstatemgmt/systemstateplugins/gsapolicy/inc/gsastatepolicyfail.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 __GSASTATEPOLICYFAIL_H__
       
    17 #define __GSASTATEPOLICYFAIL_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <ssm/ssmstatepolicy.h>
       
    21 #include <ssm/ssmconditionalcallback.h>
       
    22 
       
    23 class CSsmCommandListResourceReader;
       
    24 
       
    25 /**
       
    26 Fail state policy plug-in for GSA. This is a polymorphic dll.
       
    27 Implements MSsmStatePolicy to initialize, prepare and return command list using CSsmCommandListResourceReader.
       
    28 Implements MSsmConditionalCallback to decide whether to include a command in a command list or not.
       
    29 
       
    30 @internalComponent
       
    31 @released
       
    32 @see MSsmStatePolicy
       
    33 @see MSsmConditionalCallback
       
    34 */
       
    35 NONSHARABLE_CLASS(CGsaStatePolicyFail) : public CBase, public MSsmStatePolicy, public MSsmConditionalCallback
       
    36 	{
       
    37 public:
       
    38 	IMPORT_C static MSsmStatePolicy* NewL();
       
    39 
       
    40 	//from MSsmStatePolicy
       
    41 	TResponse TransitionAllowed(const TSsmStateTransition& aRequest, TSsmStateTransition const* aCurrent, TSsmStateTransition const* aQueued, 
       
    42 							const RMessagePtr2& aMessage);
       
    43 	void Initialize(TRequestStatus& aStatus);
       
    44 	void InitializeCancel();
       
    45 	void PrepareCommandList(TSsmState aState, TInt aReason, TRequestStatus& aStatus);
       
    46 	void PrepareCommandListCancel();
       
    47 	CSsmCommandList* CommandList();
       
    48 	TBool GetNextState(TSsmState aCurrentTransition, TInt aReason, TInt aError, TInt aSeverity, TSsmState& aNextState);
       
    49 	void Release();
       
    50 
       
    51 	// from MSsmConditionalCallback
       
    52 	TBool ConditionalCommandAllowedL(CResourceFile& aResourceFile, TInt aResourceId);
       
    53 
       
    54 private:
       
    55 	~CGsaStatePolicyFail();
       
    56 
       
    57 	CGsaStatePolicyFail();
       
    58 	void ConstructL();
       
    59 
       
    60 private:
       
    61 	CSsmCommandListResourceReader* iCommandListResourceReader;
       
    62 	RFs iFs;
       
    63 
       
    64 	// Possible panic codes within Fail policy
       
    65 	enum TFailPanicCodes
       
    66 		{
       
    67 		/**
       
    68 		 Panic when command list resource reader is NULL
       
    69 		*/
       
    70 		EInvalidResourceReader = 1,
       
    71 		/**
       
    72 		 Panic when Main state supplied is not 'ESsmFail'
       
    73 		*/
       
    74 		EInvalidFailState,
       
    75 		/**
       
    76 		 Panic when CLE returns an error executing Fail command list
       
    77 		*/
       
    78 		ERestartDevice,
       
    79 		/**
       
    80 		 Panic when ConditionalCommandAllowedL is called for a command which hasn't implemented conditional_information
       
    81 		*/
       
    82 		EConditionalInfoNotImplemented
       
    83 		};
       
    84 	};
       
    85 
       
    86 #endif	//__GSASTATEPOLICYFAIL_H__