#include <mw/biocmtm.h>
class CBIOClientMtm : public CBaseMtm |
Public Member Functions | |
---|---|
~CBIOClientMtm() | |
virtual void | AddAddresseeL(const TDesC &) |
virtual void | AddAddresseeL(const TDesC &, const TDesC &) |
virtual TMsvPartList | Find(const TDesC &, TMsvPartList) |
virtual CMsvOperation * | ForwardL(TMsvId, TMsvPartList, TRequestStatus &) |
void | HandleEntryEvent(TMsvEntryEvent, TAny *, TAny *, TAny *) |
virtual CMsvOperation * | InvokeAsyncFunctionL(TInt, const CMsvEntrySelection &, TDes8 &, TRequestStatus &) |
virtual void | InvokeSyncFunctionL(TInt, const CMsvEntrySelection &, TDes8 &) |
virtual void | LoadMessageL() |
IMPORT_C CBIOClientMtm * | NewL(CRegisteredMtmDll &, CMsvSession &) |
virtual TInt | QueryCapability(TUid, TInt &) |
virtual void | RemoveAddressee(TInt) |
virtual CMsvOperation * | ReplyL(TMsvId, TMsvPartList, TRequestStatus &) |
virtual void | SaveMessageL() |
virtual TMsvPartList | ValidateMessage(TMsvPartList) |
Protected Member Functions | |
---|---|
virtual void | ContextEntrySwitched() |
Inherited Attributes | |
---|---|
CBaseMtm::iAddresseeList | |
CBaseMtm::iCharFormatLayer | |
CBaseMtm::iMsvEntry | |
CBaseMtm::iParaFormatLayer |
BIO client MTM interface.
The BIO client MTM is simply responsible for requesting BIO message parser operations to the BIO Server MTM through InvokeAsyncFunctionL(). Many of the other base class functions are implemented to do nothing.
void | AddAddresseeL | ( | const TDesC & | aRealAddress | ) | [virtual] |
Reimplemented from CBaseMtm::AddAddresseeL(const TDesC &)
Adds an addressee for the current context.
Addresses are not validated by checking their format by this function. Usually that is performed by calling ValidateMessage().
Requirements:
Implementations should append the address to the object's address cache in the protected iAddresseeList data member. Some implementations may also wish to store addresses in an internal data structure appropriate for the protocol, for example, a class holding message header information.
Parameter | Description |
---|---|
aRealAddress | String representing an address to be added to the list for the current message |
Reimplemented from CBaseMtm::AddAddresseeL(const TDesC &,const TDesC &)
Adds an addressee for the current context, and enables the client to specify an alias, which may be useful for some protocols. For example, for fax, if the address is the fax number, the alias could supply the recipient's name.
Addresses are not validated by checking their format by this function. Usually that is performed by calling ValidateMessage().
Requirements:
Implementations should append the address to the object's address cache in the protected iAddresseeList data member. Some implementations may also wish to store addresses in an internal data structure appropriate for the protocol, for example, a class holding message header information.
Parameter | Description |
---|---|
aRealAddress | String representing an address to be added to the list for the current message |
aAlias | Alias information |
void | ContextEntrySwitched | ( | ) | [protected, virtual] |
Reimplemented from CBaseMtm::ContextEntrySwitched()
Called by the base class functions SwitchCurrentEntryL() and SetCurrentEntryL() when the context is changed to another entry.
Client applications do not use this function. It is relevant only to implementers of derived classes.
Requirements:
An implementation should clear:
1. address data stored in iAddresseeList
2. any caches of MTM-specific entry data relating to a previous context. For example, if the implementation has a private buffer storing a message subject, for access through Subject(), this buffer should be cleared.
TMsvPartList | Find | ( | const TDesC & | aTextToFind, |
TMsvPartList | aPartList | |||
) | [virtual] |
Reimplemented from CBaseMtm::Find(const TDesC &,TMsvPartList)
Searches the specified message part(s) for the plain-text version of the text to be found.
If the specified part list indicates a part that is not supported, or is not present in the current message, the function behaves as if the specified part exists but does not contain the required text.
Requirements:
The parts of the entry for which searching is allowed is implementation specific. If no searching is supported, always return 0.
Parameter | Description |
---|---|
aTextToFind | The plain-text version of the text to be found. |
aPartList | Indicates the message parts which should be searched. |
Returns: If the text was not found, or searching is unsupported, 0. If the text was found, a bitmask of the TMsvPartList IDs for each part in which the text was present.
CMsvOperation * | ForwardL | ( | TMsvId | aDestination, |
TMsvPartList | aPartList, | |||
TRequestStatus & | aCompletionStatus | |||
) | [virtual] |
Reimplemented from CBaseMtm::ForwardL(TMsvId,TMsvPartList,TRequestStatus &)
Creates a forwarded message from the current message context.
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.
Requirements:
A typical implementation for this function would include the following steps:
1. create a new message in the specified destination by calling CMsvEntry::CreateL()
2. set the entry index values as appropriate
3. set message content as required. The normal minimum is to include the text of the original message. An implementation may also follow the options specified in aPartlist to include other properties of the original message.
4. set the context to the reply
5. return a CMsvOperation-derived object to provide asynchronous control and monitoring of the operation
If forwarded messages are not supported, implementations should leave with KErrNotSupported.
The implementation of this function may be similar to that of ReplyL(), allowing opportunities for code sharing.
Parameter | Description |
---|---|
aDestination | The entry to which to assign the forwarded message |
aPartList | Defines the parts that are to be copied from the original message into the forwarded message |
aCompletionStatus | The request status to be completed when the operation has finished |
Returns: 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.
CMsvOperation * | InvokeAsyncFunctionL | ( | TInt | aFunctionId, |
const CMsvEntrySelection & | aSelection, | |||
TDes8 & | aParameter, | |||
TRequestStatus & | aCompletionStatus | |||
) | [virtual] |
Reimplemented from CBaseMtm::InvokeAsyncFunctionL(TInt,const CMsvEntrySelection &,TDes8 &,TRequestStatus &)
Invokes 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.
Requirements:
For functionality that requires message transport access, such as making a connection, the implementation should pass the request onto the corresponding Server-side MTM. This is done through calling CMsvSession::TransferCommandL(). Implementations may also provide protocol-specific functions themselves if this is useful.
InvokeAsyncFunctionL() should return a CMsvOperation-derived object to provide asynchronous control and monitoring of the operation. If CMsvSession::TransferCommandL() is called, this should be the CMsvOperation object returned by that function.
Parameter | Description |
---|---|
aFunctionId | ID of the requested operation |
aSelection | Selection of message entries. This is used if the operation requires message entries to work on. |
aParameter | Buffer containing input and output parameters. The format of this is specific to the operation. |
aCompletionStatus | The request status to be completed when the operation has finished |
Returns: If successful, this is an asynchronously completing operation. If failed, this is a completed operation, with status set to the relevant error code.
void | InvokeSyncFunctionL | ( | TInt | aFunctionId, |
const CMsvEntrySelection & | aSelection, | |||
TDes8 & | aParameter | |||
) | [virtual] |
Reimplemented from CBaseMtm::InvokeSyncFunctionL(TInt,const CMsvEntrySelection &,TDes8 &)
Invokes synchronous protocol-specific operations. For asynchronous operations, a similar function, InvokeAsyncFunctionL(), is available.
aSelection and aParameter allow data to be passed to the operation.
Requirements:
For functionality that requires message transport access, such as making a connection, the implementation should pass the request onto the corresponding Server-side MTM. This is done through calling CMsvSession::TransferCommandL(). Implementations may also provide protocol-specific functions themselves if this is useful.
Parameter | Description |
---|---|
aFunctionId | ID of the requested operation |
aSelection | Selection of message entries. This is used if the operation requires message entries to work on. |
aParameter | Buffer containing input and output parameters. The format of this is specific to the operation. |
void | LoadMessageL | ( | ) | [virtual] |
Reimplemented from CBaseMtm::LoadMessageL()
Loads the cache with the message data for the current context.
It can only be called on message contexts.
It is typically used after the context has been set with SetCurrentEntryL() or SwitchCurrentEntryL(). CBaseMtm functions to manipulate the entry can only be called after this function has been called.
Requirements:
An implementation must restore the store and index entry relating to the message context. Typically, the message store should be opened for reading with CMsvEntry::ReadStoreL(). It should be then be read to set the following:
1. body text: call RestoreBodyL() to update the cached body text
2. address list: read the appropriate MTM-specific area of the store to update iAddresseeList
3. subject: if supported, read the appropriate MTM-specific area of the store and update the cache with SetSubjectL()
The function should panic for non-message contexts.
IMPORT_C CBIOClientMtm * | NewL | ( | CRegisteredMtmDll & | aRegisteredMtmDll, |
CMsvSession & | aSession | |||
) | [static] |
void | RemoveAddressee | ( | TInt | aIndex | ) | [virtual] |
Reimplemented from CBaseMtm::RemoveAddressee(TInt)
Removes an address from the current address list. The address is specified by a zero-based index into the address list. If the index is not known, applications can use AddresseeList() to retrieve the entire list to find the item.
Requirements:
Implementations should call iAddresseeList->Delete(aIndex) to remove the address from in the address list protected data member.
Parameter | Description |
---|---|
aIndex | Index of address to be removed |
CMsvOperation * | ReplyL | ( | TMsvId | aDestination, |
TMsvPartList | aPartlist, | |||
TRequestStatus & | aCompletionStatus | |||
) | [virtual] |
Reimplemented from CBaseMtm::ReplyL(TMsvId,TMsvPartList,TRequestStatus &)
Creates a reply message to the current message context.
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 creating the reply is complete. On completion, the context is set to the reply message.
Requirements:
A typical implementation for this function would include the following steps:
1. create a new message in the specified destination by calling CMsvEntry::CreateL()
2. set the entry index values as appropriate
3. set the properties of the message as required. The normal minimum is to set the address to the sender of the original message. An implementation may also follow the options specified in aPartlist to set other properties, for example, to include the original message text.
4. set the context to the reply
5. return a CMsvOperation-derived object to provide asynchronous control and monitoring of the operation
If message replies are not supported, implementations should leave with KErrNotSupported.
The implementation of this function may be similar to that of ForwardL(), allowing opportunities for code sharing.
Parameter | Description |
---|---|
aDestination | The entry to which to assign the reply |
aPartlist | Defines the parts that are to be copied from the original message into the reply |
aCompletionStatus | The request status to be completed when the operation has finished |
Returns: If successful, this is an asynchronously completing reply operation. If failed, this is a completed operation, with status set to the relevant error code.
void | SaveMessageL | ( | ) | [virtual] |
Reimplemented from CBaseMtm::SaveMessageL()
Commits cached changes to the storage controlled by the Message Server.
It can only be called on message contexts. It should be called in the following circumstances:
1. to preserve changes when the context is changed, or when the Client-side MTM object is deleted
2. to enable other parts of the Messaging to access the updated entry, as required, for example, before sending a message
Requirements:
An implementation must update the store and index entry relating to the message context. Typically, the message store should be opened for editing with CMsvEntry::EditStoreL(). It should be updated as follows:
1. body text: call StoreBodyL() to update the store's body text stream
2. address list: update the appropriate MTM-specific area of the store from the data in iAddresseeList
3. subject: if supported, update the appropriate MTM-specific area of the store from the private cache set by SetSubjectL()
Changes can then be committed to the store with CMsvStore::CommitL().
The index entry should also be updated to reflect changes. Possible fields that may need updating include: Description (for subject changes); Details and Multiple Recipients (for recipient changes); and Size. Index entry changes are committed using CMsvEntry::ChangeL().
The function should panic for non-message contexts.
TMsvPartList | ValidateMessage | ( | TMsvPartList | aPartList | ) | [virtual] |
Reimplemented from CBaseMtm::ValidateMessage(TMsvPartList)
Validates the current message context.
The precise validation performed is specific to the MTM, but, typically, checks that the specified message parts are well-formed.
Requirements:
Implementation of this function is highly protocol-specific. A minimum step is to check that the current context is a message.
Parameter | Description |
---|---|
aPartList | Indicates the message parts for which validation is requested |
Returns: If valid, KErrNone If invalid, identifies the invalid part(s). The error value is the bitmask of the TMsvPartList IDs for each invalid part