You Are Here:

Community: Wiki

This page was last modified on 3 November 2008, at 13:36.

TSS000458 - Inserting text or an icon on the navi pane of an application

From Forum Nokia Wiki


ID TSS000458 Creation date October 19, 2006
Platform S60 3rd Edition Devices
Category Symbian C++ Subcategory


Keywords (APIs, classes, methods, functions):

Overview

Inserting text or an icon on the navi pane of an application

Description

S60 applications can set custom icons or texts to be displayed on the navi pane while their application is in foreground.

Solution

First, a reference to the status pane is retrieved. Next, the reference of the navi pane is obtained from the status pane. The application then has to create a text-based Navi decorator object using the CAknNavigationDecorator class. Finally, the decorator object needs to be pushed onto the navi pane so that it becomes visible.
//------------------------------------------------------------------------------
  CAknNavigationControlContainer* iNaviPane = 0;
  CAknNavigationDecorator* iNaviDecorator = 0;
  //Get the reference of the status pane
  CEikStatusPane *statusPane = iEikonEnv->AppUiFactory()->StatusPane();
  if ( statusPane )
    {
    //Get the reference of the navi pane
iNaviPane=static_cast<CAknNavigationControlContainer*>(statusPane->ControlL(
    TUid::Uid(EEikStatusPaneUidNavi)) );
    //Create a Navi decorator object
iNaviDecorator= iNaviPane->CreateEditorIndicatorContainerL();
    //Get the reference of the indicator container inside the NaviDecorator
    CAknIndicatorContainer* indiContainer =
      static_cast<CAknIndicatorContainer*>(iNaviDecorator->DecoratedControl());
if ( indiContainer && CEikStatusPaneBase::Current() )
      {
      TBuf<32> msgSize;
      msgSize.Append(_L("Test")); // Text to be displayed

      indiContainer->SetIndicatorValueL(
    TUid::Uid( EAknNaviPaneEditorIndicatorMessageLength ), msgSize );
   
      indiContainer->SetIndicatorState(
    TUid::Uid( EAknNaviPaneEditorIndicatorMessageLength ),
    EAknIndicatorStateOn);
      }

    //Push the object onto the navi pane.
iNaviPane->PushL( *iNaviDecorator );
}
//------------------------------------------------------------------------------

Similarly, the code snippet to display an icon on the navi pane is as follows:
//------------------------------------------------------------------------------
  CFbsBitmap* bitmap = NULL;
  CFbsBitmap* mask = NULL;
  CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
  CAknNavigationControlContainer* naviPane =
    (CAknNavigationControlContainer*)statusPane->ControlL(
      TUid::Uid(EEikStatusPaneUidNavi));
  // Create an icon
  AknIconUtils::CreateIconLC (bitmap, mask, KIconFile,
    EMbmCarsvgCircle, EMbmCarsvgCircle_mask); //KIconFile is the .mif file

  TSize size(30,30);
  AknIconUtils::SetSize(bitmap, size); // Sets the size of the extracted image
  //Create a Navi Decorator encapsulation for the image.
  CAknNavigationDecorator* naviDecorator =
    naviPane->CreateNavigationImageL(bitmap, mask);
  //Push the image onto the navi pane.
  naviPane->PushL(*naviDecorator);
//------------------------------------------------------------------------------
Required include files and libraries:
#include <aknnavi.h>               // for CAknNavigationControlContainer
#include <eikspane.h>              // for CEikStatusPane
#include <aknnavide.h>             // for CAknNavigationDecorator
#include <akniconutils.h>          // for AknIconUtils
#include <aknindicatorcontainer.h> // for CAknIndicatorContainer
LIBRARY     aknicon.lib
LIBRARY     fbscli.lib
LIBRARY     avkon.lib
Note:
The icons or text stay on the navi pane as long as the application is in foreground but they do not affect the idle screen of the device.

Related Wiki Articles

No related wiki articles found

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 qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fTSS000049E5fE2dE5fHowE5fcanE5fIE5fconvertE5ftheE5fcontentsE5fofE5fTBufE5ftoE5fTIntE253FX qdcZpublisherQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fidE2fc764fd1cE2d8b06E2d499aE2d9a6aE2d17c3903d5a65E2fforumE5fnokiaE5fcrawlerE5fagentX qdcZtitleQSxTSS000049E20E2dE20HowE20canE20IE20convertE20theE20contentsE20ofE20TBufE20toE20TIntE3fE20E2dE20ForumE20NokiaE20WikiX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZKnowledgeBaseContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZTechnicalSolutionQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qrssZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qfnZdistributionQUxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2fX qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZKnowledgeBaseContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZTechnicalSolutionQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZupdatedQDx2008E2d10E2d02X qmarsZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZKnowledgeBaseContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZTechnicalSolutionQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ