CServiceRequest Class Reference

class CServiceRequest : public CActive

Interface for service request

-Create instance by calling the static NewL method. User must implement the observer interface MServiceRequestObserver. Cancelling the wait note is informed through this API.

iServiceRequest = CServiceRequest::NewL( *this );

-The instance can be deleted at any time and all notes are dismissed.

delete iServiceRequest;

-The wait note can be launched by calling StartL function:

iServiceRequest->StartL();

By default the text "Requesting" is used, but the user may give the text as a parameter:

iServiceRequest->StartL( _L("Please wait...") );

Call to the StartL function will delete own notes visible at the call time.

-Wait note can deleteted by calling the ShowCompletionNoteL function. This removes all own notes. If the user wants to show a completion note for the request, the parameter aShowNote must be set to ETrue. Creation of a new note may leave. By deafult the Supplementary Service UI specification texts and note types are used. The user may override some parameters, like note type and text. By default, the error code is converted into note, e.g.: KErrNone, Global confirmation note "Done" KErrCancel, Local information note "Request not confirmed" KErrAccessDenied, Global information note "Not allowed" and so on.

ServiceRequest.lib
Since
1.2

Inherits from

Constructor & Destructor Documentation

CServiceRequest(MServiceRequestObserver &)

CServiceRequest(MServiceRequestObserver &aObserver)[private]

C++ default constructor.

Parameters

MServiceRequestObserver & aObserver

~CServiceRequest()

IMPORT_C~CServiceRequest()[virtual]

Destructor.

Member Functions Documentation

ConstructL()

voidConstructL()[private]

By default Symbian 2nd phase constructor is private.

DialogDismissedL(TInt)

voidDialogDismissedL(TIntaButtonId)[protected]

Parameters

TInt aButtonId

DoCancel()

voidDoCancel()[protected, virtual]

Implements cancellation of an outstanding request.

This function is called as part of the active object's Cancel().

It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.

DoCancel() must not wait for event completion; this is handled by Cancel().

CActive::Cancel

GetDefaultNote(const TInt, TSerqNoteType &, TInt &)

voidGetDefaultNote(const TIntaError,
TSerqNoteType &aNoteType,
TInt &aResourceId
)[private, static]

Gets default note implementation for give error value.

Parameters

const TInt aError
TSerqNoteType & aNoteType
TInt & aResourceId

LaunchNoteL(const TSerqNoteType)

voidLaunchNoteL(const TSerqNoteTypeaNoteType)[private]

Launches given note. Text is fetched from iNoteText.

Parameters

const TSerqNoteType aNoteType

NewL(MServiceRequestObserver &)

IMPORT_C CServiceRequest *NewL(MServiceRequestObserver &aObserver)[static]

Two-phased constructor.

Parameters

MServiceRequestObserver & aObserverOberver to inform cancelling.

Reset()

voidReset()[private]

Zeroes data members

RunError(TInt)

TInt RunError(TIntaError)[protected, virtual]

From CActive

Parameters

TInt aError

RunL()

voidRunL()[protected, virtual]

Handles an active object's request completion event.

A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.

The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.

Before calling this active object's RunL() function, the active scheduler has:

1. decided that this is the highest priority active object with a completed request

2. marked this active object's request as complete (i.e. the request is no longer outstanding)

RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.

Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.

CActiveScheduler::Start CActiveScheduler::Error CActiveScheduler::WaitForAnyRequest TRAPD

ShowCompletionNoteL(TBool, TInt, TSerqNoteType, const TDesC &)

IMPORT_C voidShowCompletionNoteL(TBoolaShowNote = ETrue,
TIntaError =  KErrNone ,
TSerqNoteTypeaNoteType = ESerqDefault,
const TDesC &aText =  KNullDesC()
)
Removes wait note and shows new note if wanted. If aShowNote = EFalse, this function won't leave! Removal of the wait note is guaranteed in leave cases also.
Since
1.2

Parameters

TBool aShowNote = ETrueETrue: a note is shown EFalse: no additional note is shown
TInt aError =  KErrNone Used in default notes. The default note type and used text is decided based on this value. These vales are overridden if note type or used text is geven as a parameter.
TSerqNoteType aNoteType = ESerqDefaultType of the note. If EDefault is used, then the aError parameter is checked.
const TDesC & aText =  KNullDesC()Given text. If lenght is zero, aError parameter is checked.

StartL(const TDesC &)

IMPORT_C voidStartL(const TDesC &aText =  KNullDesC())
Starts a wait note.
Since
1.2

Parameters

const TDesC & aText =  KNullDesC()"Requesting" text is used, if this descriptor's lenght is zero.

Member Enumerations Documentation

Enum TSerqNoteType

Enumerators

ESerqDefault
ESerqLocalInformationNote
ESerqLocalConfirmationNote
ESerqGlobalInformationNote
ESerqGlobalErrorNote
ESerqGlobalConfirmationNote

Member Data Documentation

TBool * iDestroyed

TBool *iDestroyed[private]

HBufC * iNoteText

HBufC *iNoteText[private]

MServiceRequestObserver & iObserver

MServiceRequestObserver &iObserver[private]

CAknWaitDialog * iRequestingNote

CAknWaitDialog *iRequestingNote[private]

TAny * iReserved

TAny *iReserved[private]

RConeResourceLoader * iResourceLoader

RConeResourceLoader *iResourceLoader[private]