×
Namespaces

Variants
Actions

Global notes

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: symbianyucca (30 Mar 2007)
Last edited: hamishwillee (23 Jul 2012)
Reviewer Approved    Thumbs up icon sm.jpg


Global notes can sometimes be really handy to use, since they show the note in their own window group and can also be used inside tight loops where normal notes fail to show. They do cause focus change in the application and can lead to problems on some platforms if a global error note is trying to display itself while a global wait note is active. Also you can't switch between applications while showing a global note. For these reasons progress & wait notes should be used instead of global wait notes.

Libraries needed:

LIBRARY aknnotify.lib eiksrv.lib

Header file needed:

#include <aknglobalnote.h>


Following code sample shows an example use of the global note:

void ShowNoteL(const TDesC& aMessage)
{
ShowGlobalNoteL(EAknGlobalInformationNote, aMessage);
User::After(2000000);
StopGlobalNoteL();
}
 
 
void ShowGlobalNoteL(TAknGlobalNoteType aNoteType, const TDesC& aMessage)
{
iNote = CAknGlobalNote::NewL();
iNoteId = iNote->ShowNoteL(aNoteType,aMessage);
}
 
 
void StopGlobalNoteL(void)
{
if(iNote && iNoteId >= 0)
{
iNote->CancelNoteL(iNoteId);
}
 
iNoteId = -1;
}

With this code you need to have the following member variables included in your class declaration:

TInt iNoteId;
CAknGlobalNote* iNote;

With the ShowGlobalNoteL() function the possible global note id values are:

- EAknGlobalInformationNote

- EAknGlobalWarningNote

- EAknGlobalConfirmationNote

- EAknGlobalErrorNote

- EAknGlobalChargingNote

- EAknGlobalWaitNote

- EAknGlobalPermanentNote

- EAknGlobalNotChargingNote

- EAknGlobalBatteryFullNote

- EAknGlobalBatteryLowNote

- EAknGlobalRechargeBatteryNote

- EAknCancelGlobalNote

- EAknGlobalTextNote

This page was last modified on 23 July 2012, at 11:00.
61 page views in the last 30 days.
×