alarmui/src/AlmAlarmControl.cpp
branchRCL_3
changeset 86 ed599363c2d7
parent 66 bd7edf625bdd
equal deleted inserted replaced
78:356f28cd5ca0 86:ed599363c2d7
    46 
    46 
    47 const TInt KAlarmPriority( 3095 );  // Priority for global note queue
    47 const TInt KAlarmPriority( 3095 );  // Priority for global note queue
    48 
    48 
    49 const TUint KAlarmAutoShutdown( 60000000 );  // 60 s
    49 const TUint KAlarmAutoShutdown( 60000000 );  // 60 s
    50 const TUint KShutdownTime( 1500000 ); // 1.5 s
    50 const TUint KShutdownTime( 1500000 ); // 1.5 s
       
    51 
       
    52 const TInt KErrDuplicateAlarm( -1001 ); // error code
       
    53 
    51 
    54 
    52 // ==========================================================
    55 // ==========================================================
    53 // ================= MEMBER FUNCTIONS =======================
    56 // ================= MEMBER FUNCTIONS =======================
    54 
    57 
    55 // -----------------------------------------------------------------------------
    58 // -----------------------------------------------------------------------------
   503                 // (e.g. updating snooze time before showing the snooze info note)
   506                 // (e.g. updating snooze time before showing the snooze info note)
   504                 TRAPD( err, iAlarmUtils->InitialiseAlarmDataL(); )
   507                 TRAPD( err, iAlarmUtils->InitialiseAlarmDataL(); )
   505 
   508 
   506                 HBufC* text = NULL;
   509                 HBufC* text = NULL;
   507 
   510 
       
   511 				if(!err && iAlarmUtils->CheckForDuplicateAlarm())
       
   512 					{
       
   513 					err = KErrDuplicateAlarm;
       
   514 					}
       
   515 				
   508                 if( !err )
   516                 if( !err )
   509                 {
   517                 {
   510                     TRAP( err, iAlarmUtils->GetAlarmLabelL( text ); )
   518                     TRAP( err, iAlarmUtils->GetAlarmLabelL( text ); )
   511                 }
   519                 }
   512             	// cleanup (release global data)
   520             	// cleanup (release global data)
   526                     // disable silence key when ringing type is set to "silent" or if alarm sounds is set off
   534                     // disable silence key when ringing type is set to "silent" or if alarm sounds is set off
   527                     cba |= iAlarmUtils->IsRingingTypeSilent() || iAlarmUtils->IsOffTone() ? ENoSilence : 0;
   535                     cba |= iAlarmUtils->IsRingingTypeSilent() || iAlarmUtils->IsOffTone() ? ENoSilence : 0;
   528                     // disable silence and snooze key if alarm can't be snoozed anymore
   536                     // disable silence and snooze key if alarm can't be snoozed anymore
   529                     cba |= iAlarmUtils->CanSnooze() ? 0 : EHideSnooze | ENoSilence;
   537                     cba |= iAlarmUtils->CanSnooze() ? 0 : EHideSnooze | ENoSilence;
   530                     // show "Open" MSK for calendar alarms if the security lock is not active
   538                     // show "Open" MSK for calendar alarms if the security lock is not active
   531                     cba |= iAlarmUtils->IsCalendarAlarm() && !iAlarmUtils->IsSecurityLockActive() ? EMskOpen : 0;
   539                     cba |= iAlarmUtils->IsCalendarAlarm() && !iAlarmUtils->IsSecurityLockActive() ? EMskOpen : 0; 
   532 
   540 					                  
       
   541 					if(iAlarmUtils->IsCalendarAlarm())
       
   542                         {
       
   543                     	iAlarmUtils->StoreCurrentCalendarAlarmData();
       
   544 						}
   533                     // request alarm dialog
   545                     // request alarm dialog
   534                     TBuf<1> time;
   546                     TBuf<1> time;
   535                     TRAP( err, iGlobalNoteId = iAlarmUtils->NotifierDialogController()->DisplayAlarmL( cba, *text, time/*not used*/ ) );
   547                     TRAP( err, iGlobalNoteId = iAlarmUtils->NotifierDialogController()->DisplayAlarmL( cba, *text, time/*not used*/ ) );
   536                     delete text; // only delete if GetAlarmLabelL call was successfull
   548                     delete text; // only delete if GetAlarmLabelL call was successfull
   537                     ASSERT( !err );
   549                     ASSERT( !err );