Function ids for custom MTM commands.
For MTM specific command ids use consecutive numbering starting from KMtmUiFirstFreeMtmSpecificFunction.
How to use:
Define custom commands in resources: RESOURCE MTUD_FUNCTION_ARRAY r_my_mtm_function_array
{
functions =
{
MTUD_FUNCTION
{
functiontext = "My settings";
command = KMtmUiMceSettings;
flags = EMtudCommandTransferSend;
}
MTUD_FUNCTION
{
functiontext = "My wizard";
command = KMtmUiFunctionSettingsWizard;
flags = EMtudCommandTransferSend;
}
...
}
}
Implement functionality in the UI MTM (CBaseMtmUi) void CMyMtmUi::InvokeSyncFunctionL( TInt aFunctionId,
const CMsvEntrySelection& aSelection,
TDes8& aParameter)
{
switch ( aFunctionId )
{
case KMtmUiFunctionValidateService:
{
...
TPckgBuf<TInt> resultPackage( KErrNone );
aParameter.Copy( resultPackage );
break;
}
case KMtmUiFunctionSettingsWizard:
{
...
TPckgBuf<TInt> resultPackage( 1 );
aParameter.Copy( resultPackage );
break;
}
}
}
"KMtmUiMceSettings" command is handled in a special way. The MTUD_FUNCTION is only used for registration purposes. The actual settings dialog is launched by calling "CBaseMtmUi::EditL" for the service entry of the corresponding MTM. CMsvOperation* CMyMtmUi::EditL( TRequestStatus& aStatus )
{
switch ( iBaseMtm.Entry().Entry().iType.iUid )
{
case KUidMsvServiceEntryValue:
{
return OpenServiceSettingsDialogOperationL( aStatus );
}
...
}
}
|