|
||
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 CActive::DoCancel()
and CActive::RunL()
functions defined by CActive
. CActive::DoCancel()
should be provided in the normal way to cancel the operation. CActive::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.
CBase
-
Base class for all classes to be instantiated on the heap.
CActive
-
The core class of the active object abstraction.
CMsvOperation
- Defines an interface for use by objects which control asynchronous commands in t...
Defined in CMsvOperation
:
CMsvOperation(CMsvSession &,TInt,TRequestStatus &)
Constructor. This is called by MTM implementers from the derived class construct...Extension_(TUint,TAny *&,TAny *)
The extension method provides a polymorphic behaviour to call the correct System...FinalProgress()
Gets information about a completed operation.Id()const
Gets the operation ID.Mtm()const
Gets the UID of the MTM associated with the operation.ProgressL()
Gets information on the progress of the operation.Service()const
Gets the ID of the service that is associated with this operation.SystemProgress(TMsvSystemProgress &)
This call leads to calling CMsvOperation::SystemProgress(TMsvSystemProgress &...iMsvSession
Message Server session used by object. This is set by the constructor. iMtm
The UID of the MTM associated with the operation.iObserverRequestStatus
Request status of the operation observer.iService
The ID of the service that is associated with this operation.~CMsvOperation()
Destructor.Inherited from CActive
:
CActive(TInt)
Constructs the active object with the specified priority.Cancel()
Cancels the wait for completion of an outstanding request.Deque()
Removes the active object from the active scheduler's list of active objects.DoCancel()
Implements cancellation of an outstanding request.EPriorityHigh
A priority higher than EPriorityUserInput.EPriorityIdle
A low priority, useful for active objects representing background processing.EPriorityLow
A priority higher than EPriorityIdle but lower than EPriorityStandard.EPriorityStandard
Most active objects will have this priority.EPriorityUserInput
A priority higher than EPriorityStandard; useful for active objects handling use...IsActive()const
Determines whether the active object has a request outstanding.IsAdded()const
Determines whether the active object has been added to the active scheduler's li...Priority()const
Gets the priority of the active object.RunError(TInt)
Handles a leave occurring in the request completion event handler CActive::RunL(...RunL()
Handles an active object's request completion event.SetActive()
Indicates that the active object has issued a request and that it is now outstan...SetPriority(TInt)
Sets the priority of the active object.TPriority
Defines standard priorities for active objects. iStatus
The request status associated with an asynchronous request.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...IMPORT_C CMsvOperation(CMsvSession &aMsvSession, TInt aPriority, TRequestStatus &aObserverRequestStatus);
Constructor. This is called by MTM implementers from the derived class constructor.
CMsvOperation-derived objects are not created by message client applications. The constructor uses the CMsvSession
object to obtain a ID for the operation. This ID can be accessed by clients through CMsvOperation::Id()const
.
aPriority is the priority used by the active object. Typically, this is EPriorityStandard.
aObserverRequestStatus is the asynchronous status object of an active object provided by the caller. The derived class is required to signal the caller through this when the operation completes. It is stored by the constructor in the iObserverRequestStatus member.
|
IMPORT_C ~CMsvOperation();
Destructor.
This base class function takes no action. Derived classes should implement a destructor to do the clean up tasks that they
require. Minimally, they should call CActive::Cancel()
to cancel any outstanding request.
virtual const TDesC8& ProgressL()=0;
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.
|
|
IMPORT_C virtual const TDesC8& FinalProgress();
Gets information about a completed operation.
Unlike CMsvOperation::ProgressL()
, this is guaranteed to provide status information reflecting the outcome of a completed operation.
Requirements:
The default implementation of this function returns the result from CMsvOperation::ProgressL()
. If the operation is active or CMsvOperation::ProgressL()
leaves, a panic occurs.
A derived class should implement the function to meet the requirement to provide appropriate final status information. Typically, on active object completion, it will store progress information in a private member, and return that stored information from this function.
|
|
IMPORT_C TInt SystemProgress(TMsvSystemProgress &aOutSysProg);
This call leads to calling CMsvOperation::SystemProgress(TMsvSystemProgress &)
in the server to populate the TMsvSystemProgress
structure.
|
|
IMPORT_C virtual TUid Mtm() const;
Gets the UID of the MTM associated with the operation.
This UID can be used to determine the appropriate method of getting information from a progress descriptor.
The default implementation returns iMtm.
|
CMsvOperation::ProgressL()
Gets information on the progress of the operation.inline TMsvOp Id() const;
Gets the operation ID.
This ID is unique within a Message Server session. The ID allows the client to keep track of different operations.
|
inline TMsvId Service() const;
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.
|
protected: IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny *&a0, TAny *a1);
The extension method provides a polymorphic behaviour to call the correct SystemProgress function.
|
|
protected: TMsvId iService;
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.
CMsvOperation::Service()const
Gets the ID of the service that is associated with this operation.protected: TUid iMtm;
The UID of the MTM associated with the operation.
The appropriate value should be set by the derived class constructor.
CMsvOperation::Mtm()const
Gets the UID of the MTM associated with the operation.protected: TRequestStatus & iObserverRequestStatus;
Request status of the operation observer.
This is the aObserverRequestStatus passed in the constructor.
protected: CMsvSession & iMsvSession;
Message Server session used by object. This is set by the constructor.