×
Namespaces

Variants
Actions

System Application Notification API for Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Tested on: Nokia 5800 XpressMusic
Compatibility
Platform(s): S60 5th Edition
S60 5th Edition
Article
Keywords: Symbian, Property, Subscribe
Created: User:Kbwiki (10 Mar 2010)
Last edited: hamishwillee (01 Aug 2012)

Description

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

The System Application Notification API is used for getting a notification of various system events. These include power key events, alarm light on/off, and the soft reject key event. The header file (coreapplicationuisdomainpskeys.h) also contains keys for setting and getting the status for several indicators.

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

Example Code

Header files

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

Required capabilities

ReadUserData


The following code can be used for retrieving the status for various events:

Definitions in header file

  enum TWatcherType
{
EPowerKey,
EAlarm,
ELight
}
 
TWatcherType iWatcherType;
RProperty iProperty;
TInt iValue;
 
 
'''Implementation'''
 
// See coreapplicationuisdomainpskeys.h possible values for iKey
iProperty.Attach( KPSUidCoreApplicationUIs, iKey );
iProperty.Get( iValue );
 
TBuf<128> message( _L("N/A") );
 
if ( iValue != KErrNotFound )
{
switch ( iWatcherType )
{
case EPowerKey:
if ( aValue == ECoreAppUIsHideAlarmUninitialized )
{
message = _L("Power Key Pressed Alarm Not Initialized");
}
else if ( aValue == ECoreAppUIsDoNotHideAlarm )
{
message = _L("Do Not Hide Alarm" );
}
else if ( aValue == ECoreAppUIsHideAlarm )
{
message = _L( "Hide Alarm" );
}
break;
 
case EAlarm:
if (aValue == ECoreAppUIsDisableKeyguardUninitialized )
{
message = _L("Disable Keyguard Uninitialized" );
}
else if ( aValue == ECoreAppUIsEnableKeyguard )
{
message = _L("Keyguard Enabled");
}
else if ( aValue == ECoreAppUIsDisableKeyguard )
{
message = _L("Keyguard Disabled");
}
break;
 
case ELight:
if ( aValue == ECoreAppUIsKeyEventUninitialized )
{
message = _L("Light Uninitialized");
}
else if ( aValue == ECoreAppUIsNoKeyEvent )
{
message = _L("Light on");
}
else if ( aValue == ECoreAppUIsKeyEvent )
{
message = _L("Light off");
}
break;
}
 
CAknInformationNote* note = new (ELeave) CAknInformationNote;
note->ExecuteLD( message );

See also

Archived:Setting various indicators on S60 3rd Edition FP2

This page was last modified on 1 August 2012, at 04:39.
69 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.

×