Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1562241
  • 博文数量: 237
  • 博客积分: 5139
  • 博客等级: 大校
  • 技术积分: 2751
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-18 14:48
文章分类

全部博文(237)

文章存档

2016年(1)

2012年(4)

2011年(120)

2010年(36)

2009年(64)

2008年(12)

分类: C/C++

2009-08-13 15:37:37

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;
        }
阅读(678) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~