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.
Public Member Functions | |
---|---|
~CServiceRequest() | |
IMPORT_C CServiceRequest * | NewL(MServiceRequestObserver &) |
IMPORT_C void | ShowCompletionNoteL(TBool, TInt, TSerqNoteType, const TDesC &) |
IMPORT_C void | StartL(const TDesC &) |
Protected Member Functions | |
---|---|
void | DialogDismissedL(TInt) |
void | DoCancel() |
TInt | RunError(TInt) |
void | RunL() |
Private Member Functions | |
---|---|
CServiceRequest(MServiceRequestObserver &) | |
void | ConstructL() |
void | GetDefaultNote(const TInt, TSerqNoteType &, TInt &) |
void | LaunchNoteL(const TSerqNoteType) |
void | Reset() |
Public Member Enumerations | |
---|---|
enum | TSerqNoteType { ESerqDefault, ESerqLocalInformationNote, ESerqLocalConfirmationNote, ESerqGlobalInformationNote, ESerqGlobalErrorNote, ESerqGlobalConfirmationNote } |
Inherited Enumerations | |
---|---|
CActive:TPriority |
Private Attributes | |
---|---|
TBool * | iDestroyed |
HBufC * | iNoteText |
MServiceRequestObserver & | iObserver |
CAknWaitDialog * | iRequestingNote |
TAny * | iReserved |
RConeResourceLoader * | iResourceLoader |
Inherited Attributes | |
---|---|
CActive::iStatus |
CServiceRequest | ( | MServiceRequestObserver & | aObserver | ) | [private] |
C++ default constructor.
MServiceRequestObserver & aObserver |
void | DoCancel | ( | ) | [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().
void | GetDefaultNote | ( | const TInt | aError, |
TSerqNoteType & | aNoteType, | |||
TInt & | aResourceId | |||
) | [private, static] |
Gets default note implementation for give error value.
const TInt aError | |
TSerqNoteType & aNoteType | |
TInt & aResourceId |
void | LaunchNoteL | ( | const TSerqNoteType | aNoteType | ) | [private] |
Launches given note. Text is fetched from iNoteText.
const TSerqNoteType aNoteType |
IMPORT_C CServiceRequest * | NewL | ( | MServiceRequestObserver & | aObserver | ) | [static] |
Two-phased constructor.
MServiceRequestObserver & aObserver | Oberver to inform cancelling. |
void | RunL | ( | ) | [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
IMPORT_C void | ShowCompletionNoteL | ( | TBool | aShowNote = ETrue, |
TInt | aError = KErrNone , | |||
TSerqNoteType | aNoteType = ESerqDefault, | |||
const TDesC & | aText = KNullDesC() | |||
) |
TBool aShowNote = ETrue | ETrue: 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 = ESerqDefault | Type 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. |
IMPORT_C void | StartL | ( | const TDesC & | aText = KNullDesC() | ) |
ESerqDefault | |
ESerqLocalInformationNote | |
ESerqLocalConfirmationNote | |
ESerqGlobalInformationNote | |
ESerqGlobalErrorNote | |
ESerqGlobalConfirmationNote |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.