![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Section Contents
Applications that use this class will not work correctly on a version of EPOC earlier than ER5.
CBase |
Abstract: CBase behaviour |
mtmuibas.h
mtur.lib
CBaseMtmUi-derived classes provide MTM-specific user interaction, such as editing, viewing, deleting, and copying of message entries. For an overview of their functionality, User Interface MTMs.
Message client applications use the class to access such functionality polymorphically. MTM implementers implement a derived class to provide such functionality for their message protocol.
The base class is largely an interface definition: it implements little important functionality itself. For implementers, this documentation defines conditions that any implementation must fulfil, plus suggested semantics for behaviour. This still leaves many decisions in the hands of the implementer. A key design time activity is to define how the particular characteristics of the implemented protocol are best mapped to the interface. As this class is concerned with user interfaces, implementers should be sensitive to the look and feel of the target devices.
Many functions are required to return an instance of a CMsvOperation-derived class to provide asynchronous control and monitoring to the caller of the operation being performed.
protected: CBaseMtmUi(CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll);
Client applications do not use this function. It is relevant only to implementers of derived classes.
The base class constructor initialises member variables from the passed arguments. The value of aBaseMtm is stored in the protected data member iBaseMtm, so it can be accessed by derived classes.
Derived classes can implement a constructor to perform any additional MTM-specific setup that can be safely carried out in a constructor. Such constructors must call the base class constructor function.
CBaseMtm& aBaseMtm |
The CBaseMtm requesting the object |
CRegisteredMtmDll& aRegisteredMtmDll |
Registration data for the DLL |
protected: virtual void ConstructL();
Client applications do not use this function. It is relevant only to implementers of derived classes.
Derived classes implement two-phase construction functions (NewL(), ConstructL()) to create a new instance of the object, in which any dynamic allocation should be performed. ConstructL() should be called from the NewL() function of the derived class.
The default implementation of this function loads resources required by the base class. Derived classes can implement this function to perform any additional MTM-specific second stage construction tasks that they require. Implementations must call the base class ConstructL() function.
Concrete MTMs must also implement a factory function by which a MTM registry can request an instance of the class: for details, see MtmUiFactoryFunctionL typedef.
Dependent on the implementation, this function may leave with system error codes. See Error codes.
protected: virtual void GetResourceFileName(TFileName& aFileName) const = 0;
Client applications do not use this function. It is relevant only to implementers of derived classes.
Each User Interface MTM can have a resource file associated with it. Implementations should set aFilename to the full path and name of this resource file. The function is called by CBaseMtmUi::ConstructL(), which then loads the resource file.
TFileName& aFileName |
Filename buffer to be filled with the resource file path and name |
virtual ~CBaseMtmUi();
CBaseMtmUi-derived objects must be deleted by client applications when they are no longer required. This function cleans up the base class.
Derived classes can implement a destructor to do any additional clean up tasks that they require.
void SetPreferEmbeddedL(TBool aEmbedIfPossible);
Use this function to request that any message viewers or editors that are launched, for example when a message is created, are embedded in the calling application.
TBool aEmbedIfPossible |
ETrue: request embedding EFalse: do not request embedding |
This function does not leave.
TBool PreferEmbedded() const;
Use this function to obtain whether launching message viewers and editors embedded in the calling application has been requested (through SetPreferEmbeddedL()).
TBool |
ETrue: embedding requested EFalse: embedding not requested |
CBaseMtm& BaseMtm() const;
Use this function to get a reference to the Client-side MTM that requested this object.
CBaseMtm& |
Client-side MTM that requested this object |
CMsvSession& Session() const;
Use this function to get a reference to the session object used by the Client-side MTM that requested the User Interface MTM.
CMsvSession& |
Session object used by the Client-side MTM |
TUid Type() const;
Use this function to get the Type UID of the message type associated with the User Interface MTM.
TUid |
UID of the message type associated with the MTM |
virtual CMsvOperation* CreateL(const TMsvEntry& aEntry, CMsvEntry& aParent, TRequestStatus& aStatus);
Use this function to create a new entry, as specified in aEntry, as a child of the context given in aParent. Typically, after creating the entry, the function would launch a suitable interface, such as a message editor, for the user to edit the new entry.
The returned CMsvOperation object completes when creation is complete (for example, when the message editor application is closed).
The default implementation simply calls aParent.CreateL() to create the entry. If creating entries is not supported, implementations should leave with KErrNotSupported. Otherwise, implementations should:
const TMsvEntry& aEntry |
The data to be copied into the new entry |
CMsvEntry& aParent |
The parent of the new entry |
TRequestStatus& aStatus |
The request status to be completed when the operation has finished |
CMsvOperation* |
If successful, this is an asynchronously completing create operation. If failed, this is a completed operation, with status set to the relevant error code. |
KErrNotSupported |
The requested type of entry cannot be created |
Other leave codes |
Dependent on implementation |
The following functions are all available in two overloaded versions:
virtual CMsvOperation* OpenL(TRequestStatus& aStatus) = 0;
virtual CMsvOperation* OpenL(TRequestStatus& aStatus, const CMsvEntrySelection& aSelection) = 0;
Use this function to open an entry. The behaviour that this implies is dependent on the current context:
The returned CMsvOperation object completes when opening is complete.
If opening entries is not supported, implementations should leave with KErrNotSupported. Otherwise, implementations should:
TRequestStatus& aStatus |
The request status to be completed when the operation has finished |
const CMsvEntrySelection& aSelection |
Selection of message entries |
CMsvOperation* |
If successful, this is an asynchronously completing open operation. If failed, this is a completed operation, with status set to the relevant error code. |
KErrNotSupported |
The User Interface MTM does not support open operations, or opening is inappropriate to the current context |
Other leave codes |
Dependent on implementation |
virtual CMsvOperation* CloseL(TRequestStatus& aStatus) = 0;
virtual CMsvOperation* CloseL(TRequestStatus& aStatus, const CMsvEntrySelection& aSelection) = 0;
Use this function to close an entry. The behaviour that this implies is dependent on the current context:
The returned CMsvOperation object completes when closing is complete.
Implementations should:
TRequestStatus& aStatus |
The request status to be completed when the operation has finished |
const CMsvEntrySelection& aSelection |
Selection of message entries |
CMsvOperation* |
If successful, this is an asynchronously completing close operation. If failed, this is a completed operation, with status set to the relevant error code. |
KErrNotSupported |
The User Interface MTM does not support close operations, or closing is inappropriate to the current context |
Other leave codes |
Dependent on implementation |
virtual CMsvOperation* EditL(TRequestStatus& aStatus) = 0;
virtual CMsvOperation* EditL(TRequestStatus& aStatus, const CMsvEntrySelection& aSelection) = 0;
Use this function to edit an entry. The behaviour that this implies is dependent on the current context:
The returned CMsvOperation object completes when editing is complete.
Implementations should:
TRequestStatus& aStatus |
The request status to be completed when the operation has finished |
const CMsvEntrySelection& aSelection |
Selection of message entries |
CMsvOperation* |
If successful, this is an asynchronously completing edit operation. If failed, this is a completed operation, with status set to the relevant error code. |
KErrNotSupported |
The User Interface MTM does not support edit operations, or editing is inappropriate to the current context |
KErrReadOnly |
Context is read-only |
Other leave codes |
Dependent on implementation |
virtual CMsvOperation* ViewL(TRequestStatus& aStatus) = 0;
virtual CMsvOperation* ViewL(TRequestStatus& aStatus, const CMsvEntrySelection& aSelection) = 0;
Use this function to view an entry. For message contexts, this usually launches the appropriate message viewer. Other context types leave with KErrNotSupported. The returned CMsvOperation object completes when viewing is complete.
Implementations should:
TRequestStatus& aStatus |
The request status to be completed when the operation has finished |
const CMsvEntrySelection& aSelection |
Selection of message entries |
CMsvOperation* |
If successful, this is an asynchronously completing view operation. If failed, this is a completed operation, with status set to the relevant error code. |
KErrNotSupported |
The User Interface MTM does not support view operations, or viewing is inappropriate to the current context |
Other leave codes |
Dependent on implementation |
virtual CMsvOperation* DeleteFromL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus);
Use this function to delete a selection of entries owned by the current context. The current context must be a folder or service of the relevant MTM. The returned CMsvOperation object completes when deleting is complete.
The default implementation simply calls CMsvEntry::DeleteL() to delete the entries. Implementations can override this to provide any additional checking or user interaction. If deleting entries is not supported, implementations should leave with KErrNotSupported.
Where this function is implemented, it should return a CMsvOperation-derived object to provide asynchronous control and monitoring of the operation.
const CMsvEntrySelection& aSelection |
Selection of message entries |
TRequestStatus& aStatus |
The request status to be completed when the operation has finished |
CMsvOperation* |
If successful, this is an asynchronously completing delete operation. If failed, this is a completed operation, with status set to the relevant error code. |
KErrNotSupported |
The User Interface MTM does not support delete operations, or deleting is inappropriate to the current context |
Other leave codes |
Dependent on implementation |
virtual CMsvOperation* DeleteServiceL(const TMsvEntry& aService, TRequestStatus& aStatus);
Use this function to delete a service entry specified in aService. This entry does not have to be the current context. The usual behaviour is to remove the service settings, disabling further use of that service. The returned CMsvOperation object completes when deleting is complete.
The default implementation calls CMsvEntry::DeleteL() to delete the entry. Implementations can override this to provide any additional checking or user interaction. If deleting services is not supported, implementations should leave with KErrNotSupported.
Where this function is implemented, it should return a CMsvOperation-derived object to provide asynchronous control and monitoring of the operation.
const TMsvEntry& aService |
Service to delete |
TRequestStatus& aStatus |
The request status to be completed when the operation has finished |
CMsvOperation* |
If successful, this is an asynchronously completing delete operation. If failed, this is a completed operation, with status set to the relevant error code. |
KErrNotSupported |
This User Interface MTM does not support delete service operations |
Other leave codes |
Dependent on implementation |
virtual CMsvOperation* ReplyL(TMsvId aDestination, TMsvPartList aPartlist, TRequestStatus& aCompletionStatus) = 0;
Use this function to create a reply message to the current message context, and allow the user to edit it through a message-type specific editor. Some MTMs may support inclusion of elements, specified by aPartlist, from the original message in the reply. The parent for the new entry is specified in aDestination. The returned CMsvOperation object completes when editing the reply is complete. On completion, the context is set to the reply message.
A typical implementation for this function would include the following steps:
If message replies are not supported, implementations should leave with KErrNotSupported.
TMsvId aDestination |
The entry to which to assign the reply |
TMsvPartList aPartlist |
Defines the parts which are to be copied from the original message into the reply. See CBaseMtm::ReplyL() for details. |
TRequestStatus& aCompletionStatus |
The request status to be completed when the operation has finished |
CMsvOperation* |
If successful, this is an asynchronously completing reply operation. If failed, this is a completed operation, with status set to the relevant error code. |
KErrNotSupported |
The User Interface MTM does not support reply operations |
Other leave codes |
Dependent on implementation |
virtual CMsvOperation* ForwardL(TMsvId aDestination, TMsvPartList aPartList, TRequestStatus& aCompletionStatus) = 0;
Use this function to create a forwarded message from the current message context, and allow the user to edit it through a message-type specific editor. Some MTMs may support inclusion of elements, specified by aPartlist, from the original message in the forwarded message. The parent for the new entry is specified in aDestination. The returned CMsvOperation object completes when editing the forwarded message is complete. On completion, the context is set to the forwarded message.
A typical implementation for this function would include the following steps:
If forwarded messages are not supported, implementations should leave with KErrNotSupported.
TMsvId aDestination |
The entry to which to assign the forwarded message |
TMsvPartList aPartlist |
Defines the parts which are to be copied from the original message into the forwarded message |
TRequestStatus& aCompletionStatus |
The request status to be completed when the operation has finished |
CMsvOperation* |
If successful, this is an asynchronously completing forward message operation. If failed, this is a completed operation, with status set to the relevant error code. |
KErrNotSupported |
The User Interface MTM does not support forwarded messages |
Other leave codes |
Dependent on implementation |
The functions in this section are concerned with copying and moving entries to and from remote servers. MTMs can implement these functions to provide:
virtual CMsvOperation* CopyToL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus);
Use this function to copy an entry selection to a remote service. All entries in the selection must have the same parent. The current context must be the MTM folder or service to which to copy. The returned CMsvOperation object completes when copying the entries is complete.
The usual result of this function is to send messages. It is called by ER5 Email application when the user chooses to send the messages in the Outbox. The exact behaviour varies between MTMs: for example, a Fax MTM would transmit a fax when asked to copy a fax from a local folder to a fax service.
The default implementation calls CMsvEntry::CopyL() to do the copy. If message copying is not supported, implementations should leave with KErrNotSupported.
Where this function is implemented, it should return a CMsvOperation-derived object to provide asynchronous control and monitoring of the operation.
const CMsvEntrySelection& aSelection |
Selection of message entries |
TRequestStatus& aStatus |
The request status to be completed when the operation has finished |
CMsvOperation* |
If successful, this is an asynchronously completing copy operation. If failed, this is a completed operation, with status set to the relevant error code. |
KErrNotSupported |
The User Interface MTM does not support copy to operations |
Other leave codes |
Dependent on implementation |
virtual CMsvOperation* MoveToL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus);
Use this function to move an entry selection to a remote service. All entries in the selection must have the same parent. The current context must be the MTM folder or service to which to move the entries. The returned CMsvOperation object completes when moving the entries is complete.
The usual result of this function is to send messages, in a similar way to CopyToL(). The difference is that CopyToL() does not remove the original entries. The function is called by ER5 Email application when the user cuts a message and pastes it to a remote destination.
The exact behaviour varies between MTMs, as described for CopyToL().
The default implementation calls CMsvEntry::MoveL() to do the move. Implementations are likely to be similar to those for CopyToL(), and may indeed share code.
If an MTM does not support message moving, then it should leave with value KErrNotSupported.
Where this function is implemented, it should return a CMsvOperation-derived object to provide asynchronous control and monitoring of the operation.
const CMsvEntrySelection& aSelection |
Selection of message entries |
TRequestStatus& aStatus |
The request status to be completed when the operation has finished |
CMsvOperation* |
If successful, this is an asynchronously completing move operation. If failed, this is a completed operation, with status set to the relevant error code. |
KErrNotSupported |
The User Interface MTM does not support move to operations |
Other leave codes |
Dependent on implementation |
virtual CMsvOperation* CopyFromL(const CMsvEntrySelection& aSelection, TMsvId aTargetId, TRequestStatus& aStatus);
Use this function to copy an entry selection from a remote service. All entries in the selection must have the same parent. The current context must be the MTM folder or service from which to copy. The returned CMsvOperation object completes when copying the entries is complete.
The usual result of this function is to get messages. It is called by ER5 Email application when the user chooses the Copy to Inbox command or copies and pastes messages from a remote service. The exact behaviour varies between MTMs.
The default implementation calls CMsvEntry::CopyL() to do the copy. If message copying is not supported, implementations should leave with KErrNotSupported.
Where this function is implemented, it should return a CMsvOperation-derived object to provide asynchronous control and monitoring of the operation.
const CMsvEntrySelection& aSelection |
Selection of message entries |
TMsvId aTargetId |
The ID of the entry to own the copies |
TRequestStatus& aStatus |
The request status to be completed when the operation has finished |
CMsvOperation* |
If successful, this is an asynchronously completing copy operation. If failed, this is a completed operation, with status set to the relevant error code. |
KErrNotSupported |
The User Interface MTM does not support copy from operations |
Other leave codes |
Dependent on implementation |
virtual CMsvOperation* MoveFromL(const CMsvEntrySelection& aSelection, TMsvId aTargetId, TRequestStatus& aStatus);
Use this function to move an entry selection from a remote service. All entries in the selection must have the same parent. The current context must be the MTM folder or service from which to move. The returned CMsvOperation object completes when moving the entries is complete.
The usual result of this function is to get messages, in a similar way to CopyFromL(). The difference is that CopyFromL() does not remove the original entries. The function is called by ER5 Email application when the user chooses the Move to Inbox command.
The default implementation calls CMsvEntry::MoveL() to do the move. Implementations are likely to be similar to those for CopyToL(), and may indeed share code.
If an MTM does not support message moving, then it should leave with value KErrNotSupported.
Where this function is implemented, it should return a CMsvOperation-derived object to provide asynchronous control and monitoring of the operation.
const CMsvEntrySelection& aSelection |
Selection of message entries |
TMsvId aTargetId |
The entry ID of the remote service |
TRequestStatus& aStatus |
The request status to be completed when the operation has finished |
CMsvOperation* |
If successful, this is an asynchronously completing move operation. If failed, this is a completed operation, with status set to the relevant error code. |
KErrNotSupported |
The User Interface MTM does not support get operations |
Other leave codes |
Dependent on implementation |
The following functions convert MTM-specific progress information about some asynchronous operation, such as message sending, to a human-readable form. The progress information to pass into these functions is, in general, obtained from an on-going CMsvOperation by calling CMsvOperation::Progress(). The nature of any information provided is MTM-specific.
virtual TInt DisplayProgressSummary(const TDesC8& aProgress) const;
Use this function to display a message describing the progress of an operation.
The default implementation simply returns KErrNotSupported.
Implementations should unpack the passed aProgress buffer, construct from this a suitable message, and display it. The implementation of this function should share an understanding of the format of the buffer with the implementations of CMsvOperation-derived classes.
const TDesC8& aProgress |
Progress information obtained from a call to CMsvOperation::Progress() |
TInt |
An error code: see Error codes. |
virtual TInt GetProgress(const TDesC8& aProgress, TBuf<EProgressStringMaxLen>& aReturnString,
TInt& aTotalEntryCount, TInt& aEntriesDone,
TInt& aCurrentEntrySize, TInt& aCurrentBytesTrans) const;
Use this function to obtain progress information description and statistics. A message client application can then display this information to the user.
The default implementation returns KErrNotSupported.
Implementations should unpack the passed aProgress buffer, and fill in the return values appropriately. The implementation of this function should share an understanding of the format of the buffer with the implementations of CMsvOperation-derived classes.
const TDesC8& aProgress |
MTM-specific transfer progress information |
TBuf<EProgressStringMaxLen>& aReturnString |
On return, a string describing the progress status |
TInt& aTotalEntryCount |
On return, the total number of entries the operation is acting upon |
TInt& aEntriesDone |
On return, the number of entries which the operation has completed on |
TInt& aCurrentEntrySize |
On return, the size of the current entry the operation is acting upon |
TInt& aCurrentBytesTrans |
On return, the number of bytes of the current entry which have been completed |
TInt |
An error code: see Error codes. |
virtual TInt QueryCapability(TUid aCapability, TInt& aResponse);
Use this function to query if the MTM supports a particular capability, specified by a UID. For a list of standard capability UIDs, see Capability constants. For MTM-specific UIDs, see the documentation for the relevant MTM.
The default implementation calls iBaseMtm->QueryCapability() (i.e. the corresponding function on the Client-side MTM) to do the query. This is sufficient for many implementations.
However, it is expected that each MTM-specific function (see MTM-specific UI functionality) is indicated by a capability. For example, if the MTM supports a function with UID KMtmUiMessagingXYZ, then there might be a capability KMtmUiQueryMessagingXYZ. Therefore, if different MTM-specific functions are supported by a User Interface MTM and by the corresponding Client-side MTM, this function should be implemented to reflect this.
TUid aCapability |
Capability for which to query |
TInt& aResponse |
On return, indicates whether the capability is supported, or some other property of the capability. See Capability constants. |
TInt |
KErrNone: success KErrNotSupported: aCapability is not a recognised value |
MTM components can offer protocol-specific functionality not provided by base class interface functions. MTM components define IDs that correspond to each protocol-specific operation offered, and implement the InvokeSyncFunctionL() and InvokeAsyncFunctionL() functions to allow clients to access these operations by passing in the appropriate ID. Two functions are provided to allow the MTM component to offer both synchronous and asynchronous functionality.
Message client applications can dynamically add user-interface features for these operations using CBaseMtmUiData::MtmSpecificFunctions().
MTM developers should document the IDs if they wish to make the operations available to clients.
virtual CMsvOperation* InvokeAsyncFunctionL(TInt aFunctionId, const CMsvEntrySelection& aSelection, TRequestStatus& aCompletionStatus, TDes8& aParameter);
This function should be used to invoke asynchronous protocol-specific operations. For synchronous operations, a similar function, InvokeSyncFunctionL(), is available.
aSelection and aParameter allow data to be passed to the operation. The TRequestStatus and CMsvOperation objects are used as normal to control and monitor the operation.
The default implementation calls the corresponding function on the Client-side MTM (through iBaseMtm). This is sufficient for many implementations. However, there may be certain MTM-specific functions which require interaction with the user. These should be implemented here.
InvokeAsyncFunctionL() should return a CMsvOperation-derived object to provide asynchronous control and monitoring of the operation.
TInt aFunctionId |
ID of the requested function |
const CMsvEntrySelection& aSelection |
Selection of message entries. This is used if the operation requires message entries to work on. |
TDes8& aParameter |
Buffer containing input and output parameters. The format of this is specific to the operation. |
TRequestStatus& aCompletionStatus |
The request status to be completed when the operation has finished |
CMsvOperation* |
If successful, this is an asynchronously completing operation. If failed, this is a completed operation, with status set to the relevant error code. |
KErrNotSupported |
aFunctionId is not a recognised function ID |
Other leave codes |
Dependent on implementation |
virtual void InvokeSyncFunctionL(TInt aFunctionId, const CMsvEntrySelection& aSelection, TDes8& aParameter);
This function should be used to invoke synchronous protocol-specific operations. For asynchronous operations, a similar function, InvokeAsyncFunctionL(), is available.
aSelection and aParameter allow data to be passed to the operation.
The default implementation calls the corresponding function on the Client-side MTM (through iBaseMtm). This is sufficient for many implementations. However, there may be certain MTM-specific functions which require interaction with the user. These should be implemented here.
TInt aFunctionId |
ID of the requested function |
const CMsvEntrySelection& aSelection |
Selection of message entries. This is used if the operation requires message entries to work on. |
TDes8& aParameter |
Buffer containing input and output parameters. The format of this is specific to the operation. |
KErrNotSupported |
aFunctionId is not a recognised function ID |
Other leave codes |
Dependent on implementation |
The following protected data members can be accessed by implementers of derived classes.
CBaseMtm& iBaseMtm |
The CBaseMtm-derived object (Client-side MTM) that requested the User Interface MTM. It is set by the constructor. |
CCoeEnv* iCoeEnv |
CONE environment object. It is set by the constructor. |
TInt iFlags |
This flag records the embedding preference as set by SetPreferEmbeddedL(). It is set to EMtmUiFlagPreferEmbedded when embedding is preferred. |
Defines the maximum buffer length used in GetProgress() to hold progress information |
Flag value: indicates that embedding is preferred. See the iFlags data member. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |