Writing a UI Data MTM

This section explains the initial steps to be performed to write a UI Data MTM. It does not explain the implementation of all UI Data MTM functionality.

Context

A derived UI Data MTM is simpler to implement than the MTM classes, and most of its code is specific to the protocol that is being implemented. The UI Data MTM implementation can require a resource file that details the strings used by the MTM and a list of functions (as command IDs) and flags that are specific to the MTM.

Steps

  1. Derive a class from the CBaseMtmUiData class.
  2. Register it using the CRegisteredMtmDll parameter.

Results

Use the derived CBaseMtmUiData class functionality in the Messaging client application.

//
// CTxtiMtmUiData: UI Data MTM
//

CTxtiMtmUiData* CTxtiMtmUiData::NewL(CRegisteredMtmDll& aRegisteredDll)
    {
    CTxtiMtmUiData* base=new(ELeave) CTxtiMtmUiData(aRegisteredDll);
    CleanupStack::PushL(base);
    base->ConstructL();
    CleanupStack::Pop();
    return base;
    }

Related concepts