Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived:Adding custom menu items for a 3rd party MTM

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Article Metadata
Platform(s): S60 3rd Edition
S60 3rd Edition, FP1
S60 3rd Edition FP1
S60 3rd Edition (initial release)
Created: User:Technical writer 1 (22 Aug 2007)
Last edited: hamishwillee (14 Jun 2012)


Adding custom menu items for a 3rd party MTM


It is possible to add custom menu items to the Options menu of the Messaging application for a 3rd party MTM message list.


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 <mtud.rh>
    RESOURCE MTUD_FUNCTION r_mymtm_test_operation
        functiontext = "Message command";
        command = ETxtuCommandMessage;
        flags = EMtudContextSpecific|
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;

This page was last modified on 14 June 2012, at 07:51.
17 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.