Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived:Setting various indicators on S60 3rd Edition FP2

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Article Metadata
Code ExampleCompatibility
Platform(s): S60 3rd Edition, FP2
S60 3rd Edition FP2
Article
Keywords: KCoreAppUIsNewEmailStatus
Created: ltomuta (17 Jun 2007)
Last edited: hamishwillee (21 Jun 2012)

Note.pngNote: This API is not part of the public SDK. It can be found in the SDK API Plug-in.

Contents

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

This page was last modified on 21 June 2012, at 06:14.
65 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×