CMsvOperation Class Reference

class CMsvOperation : public CActive

Defines an interface for use by objects which control asynchronous commands in the messaging system.

Such objects are returned by CMsvEntry and User Interface MTM functions that complete asynchronously. The interface allows clients to:

1. get progress information about the operation

2. cancel the operation

3. be signalled asynchronously when the operation completes; a client passes in a TRequestStatus of a suitable active object for this purpose

The client only needs to understand the CMsvOperation interface, not the concrete implementation used.

Writing derived classes:

As the base class interface for User Interface MTMs, CBaseUiMtm, defines functions that return CMsvOperation objects for control of asynchronous operations, implementers of these MTM components are required to provide suitable derived classes. For example, if CBaseUiMtm::EditL() is implemented to provide message editing, a CMsvOperation -derived class would be provided that completes when the editing operation is complete.

Concrete derived classes must provide implementations of the pure virtual DoCancel() and RunL() functions defined by CActive. DoCancel() should be provided in the normal way to cancel the operation. RunL() should, in addition to any other required functionality, always end by signalling the client that the operation is complete with a suitable completion code.

Inherits from

Constructor & Destructor Documentation

CMsvOperation(CMsvSession &, TInt, TRequestStatus &)

IMPORT_CCMsvOperation(CMsvSession &aMsvSession,
TIntaPriority,
TRequestStatus &aObserverRequestStatus
)

Parameters

CMsvSession & aMsvSession
TInt aPriority
TRequestStatus & aObserverRequestStatus

~CMsvOperation()

IMPORT_C~CMsvOperation()

Member Functions Documentation

Extension_(TUint, TAny *&, TAny *)

IMPORT_C TIntExtension_(TUintaExtensionId,
TAny *&a0,
TAny *a1
)[protected, virtual]

Parameters

TUint aExtensionId
TAny *& a0
TAny * a1

FinalProgress()

IMPORT_C const TDesC8 &FinalProgress()[virtual]

Id()

TMsvOp Id()const [inline]

Gets the operation ID.

This ID is unique within a Message Server session. The ID allows the client to keep track of different operations.

The ID of the operation

Mtm()

IMPORT_C TUidMtm()const [virtual]

ProgressL()

const TDesC8 &ProgressL()[pure virtual]

Gets information on the progress of the operation.

All operations on local entries share the same progress information format, which defined by TMsvLocalOperationProgress.

For MTM-specific operations, progress information can be extracted by calling CBaseUiMtm::GetProgress() or displayed by CBaseUiMtm::DisplayProgressSummary() on the appropriate User Interface MTM.

Requirements:

Derived classes should implement this function so that the client can check on the progress of the operation. The function should share an understanding of the format of the buffer with the implementations of CBaseUiMtm::GetProgress() and CBaseUiMtm::DisplayProgressSummary() in the User Interface MTM. The arguments of CBaseUiMtm::GetProgress() show some information that should be included where appropriate.

leave

KErrNotReady The operation has not yet been started: it has been queued for execution in the Message Server

Descriptor holding progress information. The maximum buffer size should be KMsvProgressBufferLength (defined in msvipc.h).

Service()

TMsvId Service()const [inline]

Gets the ID of the service that is associated with this operation.

If the operation is not associated with a service, the function returns KMsvLocalServiceIndexEntryId.

ID of the service associated with the operation

SystemProgress(TMsvSystemProgress &)

IMPORT_C TIntSystemProgress(TMsvSystemProgress &aOutSysProg)

Parameters

TMsvSystemProgress & aOutSysProg

Member Data Documentation

TMsvOp iId

TMsvOp iId[private]

CMsvSession & iMsvSession

CMsvSession &iMsvSession[protected]

Message Server session used by object. This is set by the constructor.

TUid iMtm

TUid iMtm[protected]

The UID of the MTM associated with the operation.

The appropriate value should be set by the derived class constructor.

Mtm()

TRequestStatus & iObserverRequestStatus

TRequestStatus &iObserverRequestStatus[protected]

Request status of the operation observer.

This is the aObserverRequestStatus passed in the constructor.

TMsvId iService

TMsvId iService[protected]

The ID of the service that is associated with this operation.

Usually, the derived class constructor will contain a suitable argument to allow the caller to set this.

Service()