Categories: Symbian C++ | How To | UI | Code Examples
Handle Profile Activation
From Forum Nokia Wiki
You can get notifocations for profile activations and handle them inside your applications.
In Header File
#include <settinginfo.h> // CSettingInfo #include <settinginfoids.h> // CSettingInfo ID's //Implement MSettingInfoObserver interface class MyClass:public MSettingInfoObserver { /* * Notification handler method * * param aID is the ID of changed setting * * param aNewValue is the new value of the changed setting * given as text, and to be (possibly) *converted into an integer when needed */ void HandleNotificationL( SettingInfo::TSettingID aID, const TDesC& aNewValue ); private: CSettingInfo* iSettings; }
In the CPP File
CMyClass::ConstructL() { // Create a new instance of CSettingInfo. All profile // non observalbe properties (all except the profile // index) are read using this instance iSettings = CSettingInfo::NewL(this); // Order notifications when profile is changed TInt err = iSettings->NotifyChanges(SettingInfo::EActiveProfile); if(err != KErrNone) { // an error occured, show message to user //iView->ShowMessageL(KErrOrderingProfileChangeNotifies); } } //========================================================================= // // // // //========================================================================== void CMyClass::HandleNotificationL(SettingInfo::TSettingID aID, const TDesC& aNewValue ) { TInt err(0); switch(aID) { case SettingInfo::EActiveProfile: { // First, parse the NEW active profile index // out from the value string by using TLex //TInt profileIdx(iProperties.profileIndex); //this->iapp->InForeGround(); TLex parsed(aNewValue); TInt value; if ( (err = parsed.Val(value)) == KErrNone ) { //Parsing successful if(value==0) //"General" Profile is Activated if(value==1) //"Silent" Profile is Activated if(value==2) //"meeting" Profile is Activated if(value==3) //"Outdoor" Profile is Activated if(value==4) //"Pager" Profile is Activated if(value==5) //"Offline" Profile is Activated } else { // parsing failed..... } break; } default: break; } }
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| profile issue in version 1.2 symbian | mateen_maldar | Symbian User Interface | 0 | 2006-02-06 15:21 |
| How to access/edit a Profile name? | powerlenin | Symbian Tools & SDKs | 4 | 2007-11-26 20:08 |
| S60 3rd Edition SDK -- how to read Phone's SIP profile from J2ME Midlet | infy_gcl | Mobile Java Networking & Messaging & Security | 0 | 2006-11-22 12:20 |
| instantaneous wireless network with BT | dphj | Bluetooth Technology | 2 | 2003-03-31 16:19 |
| Nokia N73 ---No Signal---Help Please | ayme | General Discussion | 2 | 2007-08-22 05:33 |
