You Are Here:

Community: Wiki

This page was last modified on 15 October 2008, at 12:09.

CS001119 - Playing a message with the native message reader

From Forum Nokia Wiki



ID CS001119 Creation date October 2, 2008
Platform S60 3rd Edition, FP1 Tested on devices Nokia E90 Communicator
Category Symbian C++ Subcategory Messaging


Keywords (APIs, classes, methods, functions): AIW, TTS, messaging

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.

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fKIS001482E5fE2dE5f3rdE5fpartyE5fMTME5fmailboE78E5fnotE5fvisibleE5finE5fMessagingE5fapplicationE5fofE5fNokiaE5f5800E5fE58pressMusicX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZmessagingQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZuserE5ftagQSxmessagingX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ