Namespaces
Variants
Actions
(Difference between revisions)

Playing a message with the native message reader on Symbian

Jump to: navigation, search
m (Hamishwillee - Bot update - Merge KB into wiki)
 

Latest revision as of 04:03, 14 June 2012

Article Metadata

Tested with
Devices(s): Nokia E90 Communicator

Compatibility
Platform(s): S60 3rd Edition, FP1

Article
Keywords: AIW, TTS, messaging
Created: User:Technical writer 1 (02 Oct 2008)
Last edited: hamishwillee (14 Jun 2012)

Contents

Overview

With AIW you can easily tell the preinstalled native message reader application to read any message stored in your messaging folders.

This snippet can be self-signed.

Preconditions (optional)

This API works only in devices that have a preinstalled native message reader application.

MMP file

The following library is required:

LIBRARY servicehandler.lib

0

In the resource file

Add the following headers:

 #include <AiwCommon.hrh>
#include <AiwCommon.rh>

Next, in the MENU_PANE resource, define a menu item as follows:

 MENU_ITEM
{
command = EAIWPlaceHolder1;
txt = "";
}

And define the AIW menu interest item as follows:

 RESOURCE AIW_INTEREST R_AIWTEST_MSG
{
items =
{
AIW_CRITERIA_ITEM
{
id = EAIWPlaceHolder1;
serviceCmd = KAiwCmdView; //from aiwcommon.hrh
serviceClass = KAiwClassMenu; //from aiwcommon.hrh
contentType = "message/*";
}
};
}


Source file

Add the following header

 #include <AiwServiceHandler.h>

Construct the CAiwServiceHandler and attach the menu interest to it. Note that the code assumes that the iEntry is member variable of the class, its type is TMsvEntry, and it is for a valid message.

 iServiceHandler = CAiwServiceHandler::NewL();
iServiceHandler->AttachMenuL(R_AIWTEST_MENU, R_AIWTEST_MSG);

Then add the actual menu item into the menu when it is shown:

 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane *aMenuPane )
{
 
if(aResourceId == R_AIWTEST_MENU)
{
CAiwGenericParamList* params = CAiwGenericParamList::NewLC();
 
TPckgC<TMsvEntry> packedEntry(iEntry);
TAiwGenericParam mailParam( EGenericParamMessageItem);
mailParam.Value().Set(packedEntry);
params->AppendL( mailParam );
 
// Let AIW provider add its menu items to the menu.
iServiceHandler->InitializeMenuPaneL(
*aMenuPane,
aResourceId,
EAIWExampleCmdLast,
*params);
 
}
}

To play the message, the user selects the added menu item. You can handle it as follows in the command handlers default block:

 CAiwGenericParamList* paramList = CAiwGenericParamList::NewLC();
 
TPckgC<TMsvEntry> packedEntry(iEntry);
TAiwGenericParam mailParam( EGenericParamMessageItem);
mailParam.Value().Set(packedEntry);
paramList->AppendL( mailParam );
 
iServiceHandler->ExecuteMenuCmdL(
aCommand,
*paramList,
iServiceHandler->OutParamListL(),
0,
this);
 
CleanupStack::PopAndDestroy(paramList);

Postconditions

The selected message should now be played with the native message reader.

This page was last modified on 14 June 2012, at 04:03.
273 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved