Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 11:42, 17 October 2007.

TSS000763 - Notification of a change in the Active Profile Ringtone

From Forum Nokia Wiki


ID TSS000763 Creation date October 17, 2007
Platform S60 3rd Edition, MR Devices All devices
Category Symbian C++ Subcategory Profile Engine


Overview

Profiles Engine API, part of the Extension plug-in package for S60 3rd Edition, MR, provides the class CProfileChangeNotifyHandler that can be used to get a notification for activation of a new profile and modifications of current active profile settings.

See also How to get notification of profile change

Description

Header files:

 #include <CProfileChangeNotifyHandler.h>
 #include <MProfileChangeObserver.h>
 #include <MProfileEngine.h>  // link against profileeng.lib
 #include <MProfile.h>
 #include <MProfileTones.h>

Derive a class from MProfileChangeObserver and implement a pure virtual function HandleActiveProfileEventL() in order to get notifications.

Create an instance of CProfileChangeNotifyHandler class in the ConstructL() of this class:

 CProfileChangeNotifyHandler* iHandler = 
     CProfileChangeNotifyHandler::NewL( this );

First, store the ring tone from the active profile in a descriptor. Whenever a change notification for the active profile comes in, re-retrieve the ring tone and compare it with the old value.

The following code is used to get the active profile ring tone:

 MProfileEngine* profileEngine = CreateProfileEngineL();
 CleanupReleasePushL(*profileEngine);
 MProfile* activProfile = 
     profileEngine->ActiveProfileL();
 const MProfileTones& activeProfileTone = 
     activProfile->ProfileTones();
 // iCurrentRingTone is of type TFileName
 iCurrentRingTone = activeProfileTone.RingingTone1(); 
 CleanupStack::PopAndDestroy(); // profileEngine

Implementation of HandleActiveProfileEventL():

 HandleActiveProfileEventL( TProfileEvent aProfileEvent, 
                            TInt aProfileId )
   {
   switch(aProfileEvent)
     {
     case EProfileActiveProfileModified:
       {
       // Active profile settings are modified
       MProfileEngine* profileEngineNew =
           CreateProfileEngineL();
       CleanupReleasePushL(*profileEngineNew);
       MProfile* activeProfileNew = 
           profileEngineNew->ActiveProfileL();
       const MProfileTones& activeProfileToneNew = 
           activeProfileNew->ProfileTones();
       TFileName ringToneNew = 
           activeProfileToneNew.RingingTone1();
       TBool ringToneChanged = 
           iCurrentRingTone.operator!=(ringToneNew);
 
       if( ringToneChanged )
         {
         // Active profile ring tone changed
         iCurrentRingTone = ringToneNew;
         }
       else
         {
         // Some other profile settings have changed
         }
       CleanupStack::PopAndDestroy(); // profileEngineNew
       break;
       }
     default:
       break;
     }
   }

Example Project for getting Notification of Active Profile Ringtone Change

Related Discussions
Thread Thread Starter Forum Replies Last Post
What Bluetooth profiles do the Nokia 6310, 6310i and 8910 support? Nokia_FAQ Bluetooth Technology 1 2002-05-13 20:11
How can I get notification that the ringing profile has changed? iulian_moldovan General Symbian C++ 3 2006-03-29 08:29
3G Connection Status shashishaw Symbian Networking & Messaging 0 2005-08-05 11:16
Thread Notification KKrishna General Symbian C++ 2 2008-06-12 05:02
Change Ringtone Mdhaval General Symbian C++ 0 2005-05-23 12:03
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZKnowledgeBaseContentQ
     qfnZtypeQUqfnTypeZTechnicalSolutionQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX