MSsmStatePolicy Class Reference

class MSsmStatePolicy

The protocol for System State Policy DLLs. These are not ECOM DLLs because they need to work before the ECOM server is started.

The first function in System State Policy DLLs must have an exported function with following signature that returns an instance of the MSsmStatePolicy implementation:

IMPORT_C static MSsmStatePolicy* NewL();

Member Functions Documentation

CommandList()

CSsmCommandList *CommandList()[pure virtual]

Used to retrieve the command list once the PrepareCommandList has completed. Ownership of the returned command list is transferred to the caller.

GetNextState(TSsmState, TInt, TInt, TInt, TSsmState &)

TBool GetNextState(TSsmStateaCurrentTransition,
TIntaReason,
TIntaError,
TIntaSeverity,
TSsmState &aNextState
)[pure virtual]

Used to determine the next sub state transition.

Parameters

TSsmState aCurrentTransitionContains the last executed state transition.
TInt aReasonContains the reason as given by the request
TInt aErrorContains the completion code from the last executed sub-state transition
TInt aSeverityContains the severity of the failed command in case the sub-state transition ended with an error
TSsmState & aNextStateThe next System State to head for, if there is one

Initialize(TRequestStatus &)

voidInitialize(TRequestStatus &aStatus)[pure virtual]
This function is guaranteed to be called before this System State Policy is used. It is intended for e.g. opening resource files or if you need to initialize hardware or talk to a domestic OS.
	//minimal implemementation of this function would be
	TRequestStatus* status = &aStatus;
	User::RequestComplete(status, KErrNone);

Parameters

TRequestStatus & aStatusto complete when the initialization operation has finished

InitializeCancel()

voidInitializeCancel()[pure virtual]

Used to inform the policy DLL to Cancel an asynchronous Initialize operation.

MSsmStatePolicy_Reserved_1()

voidMSsmStatePolicy_Reserved_1()[private, inline, virtual]

MSsmStatePolicy_Reserved_2()

voidMSsmStatePolicy_Reserved_2()[private, inline, virtual]

MSsmStatePolicy_Reserved_3()

voidMSsmStatePolicy_Reserved_3()[private, inline, virtual]

PrepareCommandList(TSsmState, TInt, TRequestStatus &)

voidPrepareCommandList(TSsmStateaState,
TIntaReason,
TRequestStatus &aStatus
)[pure virtual]

Used to create the command list associated with a sub state transition.

Parameters

TSsmState aStateContains the state that identifies the command list to create
TInt aReasonContains the reason as given by the request
TRequestStatus & aStatusto complete when the operation has finished

PrepareCommandListCancel()

voidPrepareCommandListCancel()[pure virtual]

Used to inform the policy DLL that the pending asynchronous PrepareCommandList operation needs to be cancelled.

Release()

voidRelease()[pure virtual]

It is expected that Release will usually just call "delete this" on the object, but this will depend on the implementation of each policy.

TransitionAllowed(const TSsmStateTransition &, TSsmStateTransition const *, TSsmStateTransition const *, const RMessagePtr2 &)

TResponse TransitionAllowed(const TSsmStateTransition &aRequest,
TSsmStateTransition const *aCurrent,
TSsmStateTransition const *aQueued,
const RMessagePtr2 &aMessage
)[pure virtual]

Used to determine if an incoming request should be accepted or rejected.

Parameters

const TSsmStateTransition & aRequestContains information about the new request
TSsmStateTransition const * aCurrentContains NULL or the first accepted but not yet completed transition request
TSsmStateTransition const * aQueuedContains NULL or a second accepted but not yet started transition request
const RMessagePtr2 & aMessageContains information about the requesting client process. DLLs should not call RMessagePtr2::Complete.

Member Enumerations Documentation

Enum TResponse

Enumerators

ENotAllowed
EDefinitelyAllowed
ECurrentRemainReplaceQueued
EReplaceCurrentClearQueue