gsprofilesrv_pub/profiles_engine_wrapper_api/tsrc/BC/ProfilesEngineWrapperAPI/src/ProEngWrapAPIBlocks.cpp
branchRCL_3
changeset 24 8ee96d21d9bf
parent 20 3b67655da2cc
child 25 7e0eff37aedb
equal deleted inserted replaced
23:8bda91a87a00 24:8ee96d21d9bf
    62         ENTRY( "NewEngineLCWithRFsL", CProEngWrapAPI::NewEngineLCWithRFsL ),
    62         ENTRY( "NewEngineLCWithRFsL", CProEngWrapAPI::NewEngineLCWithRFsL ),
    63         ENTRY( "NewNotifyHandlerL", CProEngWrapAPI::NewNotifyHandlerL ),
    63         ENTRY( "NewNotifyHandlerL", CProEngWrapAPI::NewNotifyHandlerL ),
    64         ENTRY( "ReqProfActNotificationsL", CProEngWrapAPI::RequestProfileActivationNotificationsL ),
    64         ENTRY( "ReqProfActNotificationsL", CProEngWrapAPI::RequestProfileActivationNotificationsL ),
    65         ENTRY( "CanProfActNotificationsL", CProEngWrapAPI::CancelProfileActivationNotificationsL ),
    65         ENTRY( "CanProfActNotificationsL", CProEngWrapAPI::CancelProfileActivationNotificationsL ),
    66         ENTRY( "ReqActProfNotificationsL", CProEngWrapAPI::RequestActiveProfileNotificationsL ),
    66         ENTRY( "ReqActProfNotificationsL", CProEngWrapAPI::RequestActiveProfileNotificationsL ),
    67         ENTRY( "CanActProfNotificationsL", CProEngWrapAPI::CancelActiveProfileNotificationsL ),
    67         ENTRY( "CanActProfNotificationsL", CProEngWrapAPI::CancelProfileActivationNotificationsL ),
    68         ENTRY( "ReqProfNotificationsL", CProEngWrapAPI::RequestProfileNotificationsL ),
    68         ENTRY( "ReqProfNotificationsL", CProEngWrapAPI::RequestProfileNotificationsL ),
    69         ENTRY( "CanProfNotificationsL", CProEngWrapAPI::CancelProfileNotificationsL ),
    69         ENTRY( "CanProfNotificationsL", CProEngWrapAPI::CancelProfileNotificationsL ),
    70         ENTRY( "ReqProfNameArrayNotL", CProEngWrapAPI::RequestProfileNameArrayNotificationsL ),
    70         ENTRY( "ReqProfNameArrayNotL", CProEngWrapAPI::RequestProfileNameArrayNotificationsL ),
    71         ENTRY( "CanProfNameArrayNotL", CProEngWrapAPI::CancelProfileNameArrayNotificationsL ),
    71         ENTRY( "CanProfNameArrayNotL", CProEngWrapAPI::CancelProfileNameArrayNotificationsL ),
    72         ENTRY( "CancelAllL", CProEngWrapAPI::CancelAllL ),
    72         ENTRY( "CancelAllL", CProEngWrapAPI::CancelAllL ),
   220         }
   220         }
   221     CProEngVTObserver* observer = new ( ELeave ) CProEngVTObserver(*iSchedulerUtility);
   221     CProEngVTObserver* observer = new ( ELeave ) CProEngVTObserver(*iSchedulerUtility);
   222     CleanupStack::PushL( observer );
   222     CleanupStack::PushL( observer );
   223 
   223 
   224     TRAP_IGNORE(nh->RequestProfileActivationNotificationsL ( *observer ) );
   224     TRAP_IGNORE(nh->RequestProfileActivationNotificationsL ( *observer ) );
   225     
   225     engine->SetActiveProfileL( EProfileMeetingId );
   226     TInt previousid( engine->ActiveProfileId() ); 
   226     iSchedulerUtility->Start();
   227     if ( previousid == EProfileMeetingId )   //example for active profile change
       
   228         {
       
   229         engine->SetActiveProfileL( EProfileOutdoorId );
       
   230         }
       
   231     else 
       
   232         {
       
   233         engine->SetActiveProfileL( EProfileMeetingId );
       
   234         }
       
   235     TInt activeid( engine->ActiveProfileId() );    
       
   236     if ( previousid!=activeid )
       
   237         {
       
   238         iSchedulerUtility->Start();
       
   239         }
       
   240     
       
   241     CleanupStack::PopAndDestroy( observer );
   227     CleanupStack::PopAndDestroy( observer );
   242     CleanupStack::PopAndDestroy( wrapper );
   228     CleanupStack::PopAndDestroy( wrapper );
   243     CleanupStack::PopAndDestroy(); // engine
   229     CleanupStack::PopAndDestroy(); // engine
   244     return KErrNone;
   230     return KErrNone;
   245     }
   231     }
   265         }
   251         }
   266     CProEngVTObserver* observer = new ( ELeave ) CProEngVTObserver(*iSchedulerUtility);
   252     CProEngVTObserver* observer = new ( ELeave ) CProEngVTObserver(*iSchedulerUtility);
   267     CleanupStack::PushL( observer );
   253     CleanupStack::PushL( observer );
   268 
   254 
   269     TRAP_IGNORE(nh->RequestProfileActivationNotificationsL ( *observer ) );
   255     TRAP_IGNORE(nh->RequestProfileActivationNotificationsL ( *observer ) );
   270     TInt previousid( engine->ActiveProfileId() );
   256     engine->SetActiveProfileL( EProfileMeetingId );
   271     if ( previousid == EProfileMeetingId )     //example for active profile change
   257     iSchedulerUtility->Start();
   272         {
       
   273         engine->SetActiveProfileL( EProfileOutdoorId );
       
   274         }
       
   275     else 
       
   276         {
       
   277         engine->SetActiveProfileL( EProfileMeetingId );
       
   278         }
       
   279     TInt activeid( engine->ActiveProfileId() );
       
   280     if ( previousid!=activeid )
       
   281         {
       
   282         iSchedulerUtility->Start();
       
   283         }
       
   284         
       
   285     nh->CancelProfileActivationNotifications();
   258     nh->CancelProfileActivationNotifications();
   286     CleanupStack::PopAndDestroy( observer );
   259     CleanupStack::PopAndDestroy( observer );
   287     CleanupStack::PopAndDestroy( wrapper );
   260     CleanupStack::PopAndDestroy( wrapper );
   288     CleanupStack::PopAndDestroy(); // engine
   261     CleanupStack::PopAndDestroy(); // engine
   289     return KErrNone;
   262     return KErrNone;