You Are Here:

Community: Wiki

This page was last modified on 7 October 2008, at 22:42.

CS000818 - Setting various indicators

From Forum Nokia Wiki



ID CS000818 Creation date February 11, 2008
Platform S60 3rd Edition, FP2 Tested on devices
Category Symbian C++ Subcategory


Keywords (APIs, classes, methods, functions): KCoreAppUIsNewEmailStatus
Note!
This API is not part of the public SDK. It can be found in the SDK API Plug-in.


Purpose

The KCoreAppUIsNewEmailStatus API is used for getting a notification of a new e-mail. The header file also contains the keys to set & get notifications for various indicators, such as POC indicator, USB indicator, and mobile TV recording.

This functionality is accomplished by listening to changes in Publish & Subscribe key values.

Note that while e-mail status P&S keys apply across all S60 3rd Edition releases (Feature Packs), the majority of the keys are introduced in Extensions plug-in package for S60 3rd Edition SDK for Symbian OS, for C++, supporting Feature Pack 2.

Use cases

1. An application needs to be notified of a change in the status of an e-mail. In that case you can use this API and can accordingly perform a particular operation based on it.

2. This API can also be used to set the status of various indicators.

Example code

Header files:

#include <coreapplicationuisdomainpskeys.h>
#include <e32property.h> //RProperty class

Link against:

LIBRARY   euser.lib 	//RProperty class

Capabilities:

WriteDeviceData  // for setting the e-mail status using RProperty::Set()
ReadDeviceData // for retrieving the e-mail status using RProperty::Get()

Get e-mail status:

The following code is used for retrieving the e-mail status:

RProperty iProperty;
TInt iEmailStatus;
// This is used for retrieving the e-mail status and the
// result is stored in iEmailStatus
iProperty.Get( KPSUidCoreApplicationUIs,
KCoreAppUIsNewEmailStatus,
iEmailStatus
);
// Compare it with TCoreAppUIsNewEmailStatus enum
// for checking the e-mail status
switch( iEmailStatus )
{
case ECoreAppUIsNoNewEmail:
CEikonEnv::Static()->AlertWin(_L("No New e-mail"));
break;
case ECoreAppUIsNewEmail:
CEikonEnv::Static()->AlertWin(_L("You have a New e-mail"));
break;
default:
CEikonEnv::Static()->AlertWin(_L("Uninitialised"));
break;
}

Set e-mail status:

The following code is used to assig a value to the e-mail status: The 3rd parameter can take any values of the TCoreAppUIsNewEmailStatus enum defined in the header file.

Setting "ECoreAppUIsNewEmailStatusUninitialized" to the e-mail status:

iProperty.Set( KPSUidCoreApplicationUIs, 
KCoreAppUIsNewEmailStatus,
ECoreAppUIsNewEmailStatusUninitialized
);

Notification of change in e-mail status:

The following is the code snippet for getting a notification whenever there is a change in the e-mail status:

RProperty iProperty;
// This is based on Active Objects.
// The function creates a handle (this object) to the specified property.
// This allows the caller to subscribe for a notification of changes
// to this e-mail status.
iProperty.Attach(KPSUidCoreApplicationUIs, KCoreAppUIsNewEmailStatus);
// The function issues an asynchronous request to be notified when the
// e-mail status is changed.
iProperty.Subscribe(iStatus);
SetActive();
// RunL is called whenever the status changes.

Get Mobile TV Recording status: The following code is used for retrieving the status of Mobile TV Recording:

TInt status;
RProperty::Get(KPSUidCoreApplicationUIs, KCoreAppUIsMtvRecStatus, status);
switch(status)
{
case ECoreAppUIsMtvRecStatusUninitialized:
// Uninitialized
break;
 
case ECoreAppUIsMtvRecStatusOff:
// Off
break;
 
case ECoreAppUIsMtvRecStatusOn:
// On
break;
}

Set Mobile TV Recording status:

The following code is used to assign a value to the mobile TV recording status:

TInt status;
TInt err;
 
RProperty::Get(KPSUidCoreApplicationUIs, KCoreAppUIsMtvRecStatus, status);
 
if(status == ECoreAppUIsMtvRecStatusOff)
{
err = RProperty::Set( KPSUidCoreApplicationUIs,
KCoreAppUIsMtvRecStatus,
ECoreAppUIsMtvRecStatusOn );
}
else
{
err = RProperty::Set( KPSUidCoreApplicationUIs,
KCoreAppUIsMtvRecStatus,
ECoreAppUIsMtvRecStatusOff );
}

The other indicator values, such as POC indicator and USB indicator, can be retrieved and set in the same way as above with the keys defined in the coreapplicationuisdomainpskeys.h header file.

Example application

ApplicationUIKeys

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: qdcZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fTSS000709E5fE2dE5fManagingE5fVoIPE5fprofilesX qdcZpublisherQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fidE2fc764fd1cE2d8b06E2d499aE2d9a6aE2d17c3903d5a65E2fforumE5fnokiaE5fcrawlerE5fagentX qdcZtitleQSxTSS000709E20E2dE20ManagingE20VoIPE20profilesE20E2dE20ForumE20NokiaE20WikiX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qrssZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qfnZdistributionQUxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2fX qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZupdatedQDx2008E2d10E2d02X qfnZuserE5ftagQSxpluginX qmarsZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ