Description:
It is possible to add custom menu items to the Options menu of the Messaging application for a 3rd party MTM message list.
Solution:
To add custom menu items to the message list:
1) Specify either EMtudContextSpecific or EMtudRemoteOnly flag in the MTM-specific function array.
2) Use the correct return value in the implementation of CBaseMtmUiData::OperationSupportedL() function.
This function is called by the messaging client to check if a
particular operation is appropriate for the selected entries in the
message list.
The following example code demonstrates these steps:
1) In UI Data MTM resource file:
#include ;
RESOURCE MTUD_FUNCTION r_mymtm_test_operation
{
functiontext = "Message command";
command = ETxtuCommandMessage;
flags = EMtudContextSpecific|
EMtudAsynchronous|
EMtudCommandTransferReceive;
}
2) Implementation of OperationSupportedL() in the UI Data MTM:
TInt CTxtiMtmUiData::OperationSupportedL( TInt aOperationId, const TMsvEntry& aContext ) const
{
TInt aReasonResourceId=0; // 0 means "operation is available"
if (aContext.iMtm != KUidMsgTypeText)
{
return R_TEXTUD_NOT_SUPPORTED;
}
const TBool isMessage = (aContext.iType == KUidMsvMessageEntry);
const TBool isService = (aContext.iType == KUidMsvServiceEntry);
if (aOperationId == ETxtuCommandMessage)
{
// Only allow this command on local messages
if ( (!isMessage) | (aContext.iServiceId != KMsvLocalServiceIndexEntryId) )
aReasonResourceId = R_TEXTUD_ONLY_MESSAGES;
}
return aReasonResourceId;
}
阅读(690) | 评论(0) | 转发(0) |