54 #ifndef SYMBIAN_CALENDAR_V2 |
54 #ifndef SYMBIAN_CALENDAR_V2 |
55 #include <agmalarm.h> // deprecated, use CalAlarm.h when SYMBIAN_CALENDAR_V2 flag is enabled |
55 #include <agmalarm.h> // deprecated, use CalAlarm.h when SYMBIAN_CALENDAR_V2 flag is enabled |
56 #endif // SYMBIAN_CALENDAR_V2 |
56 #endif // SYMBIAN_CALENDAR_V2 |
57 #include <calsession.h> |
57 #include <calsession.h> |
58 #include <calentryview.h> |
58 #include <calentryview.h> |
|
59 #include <clockdomaincrkeys.h> |
|
60 #include <calendardomaincrkeys.h> |
59 // #include <calenlauncher.h> // for launching calendar entry view |
61 // #include <calenlauncher.h> // for launching calendar entry view |
60 |
62 |
61 |
63 |
62 |
64 |
63 // CONSTANTS AND MACROS |
65 // CONSTANTS AND MACROS |
74 const TUint KInactivityResetInterval( 1000000 ); // 1.0 s |
76 const TUint KInactivityResetInterval( 1000000 ); // 1.0 s |
75 |
77 |
76 const TInt KMaxProfileVolume( 10 ); |
78 const TInt KMaxProfileVolume( 10 ); |
77 const TInt KVolumeRampPeriod( 3000000 ); // 3 seconds |
79 const TInt KVolumeRampPeriod( 3000000 ); // 3 seconds |
78 _LIT( KRngMimeType, "application/vnd.nokia.ringing-tone" ); |
80 _LIT( KRngMimeType, "application/vnd.nokia.ringing-tone" ); |
79 const TUid KCRUidCalendar = {0x101F874B}; |
|
80 //const TUint32 KCalendarSoundFile = 0x00000004; |
81 //const TUint32 KCalendarSoundFile = 0x00000004; |
81 const TUint32 KCalendarDefaultSoundFile = 0x00000005; |
|
82 const TUint32 KCalendarSnoozeTime = 0x00000007; |
|
83 const TUid KCRUidClockApp = {0x101F874D}; |
|
84 //const TUint32 KClockAppSoundFile = 0x00000000; |
82 //const TUint32 KClockAppSoundFile = 0x00000000; |
85 const TUint32 KClockAppDefaultSoundFile = 0x00000001; |
|
86 const TUint32 KClockAppSnoozeTime = 0x00000002; |
|
87 const TUid KAlarmClockOne = { 0x101F793A }; |
83 const TUid KAlarmClockOne = { 0x101F793A }; |
88 |
84 |
89 const TUid KCRUidProfileEngine = {0x101F8798}; |
85 const TUid KCRUidProfileEngine = {0x101F8798}; |
90 //const TUint32 KProEngActiveReminderTone = 0x7E00001C; |
86 //const TUint32 KProEngActiveReminderTone = 0x7E00001C; |
91 //const TUint32 KProEngActiveClockAlarmTone = 0x7E00001D; |
87 //const TUint32 KProEngActiveClockAlarmTone = 0x7E00001D; |
438 CRepository* profileRepository = NULL; |
434 CRepository* profileRepository = NULL; |
439 CRepository* repository = NULL; |
435 CRepository* repository = NULL; |
440 |
436 |
441 if( IsClockAlarm() ) |
437 if( IsClockAlarm() ) |
442 { |
438 { |
443 PIM_TRAPD_ASSERT( repository = CRepository::NewL( KCRUidClockApp ); ) |
439 PIM_TRAPD_ASSERT( repository = CRepository::NewL( TUid::Uid(KCRUidClockApp) ); ) |
444 PIM_TRAPD_ASSERT( profileRepository = CRepository::NewL( |
440 PIM_TRAPD_ASSERT( profileRepository = CRepository::NewL( |
445 KCRUidProfileEngine ); ) |
441 KCRUidProfileEngine ); ) |
446 |
442 |
447 if( repository ) |
443 if( repository ) |
448 { |
444 { |
457 iAlarmData.iAlarmTone ); ) |
453 iAlarmData.iAlarmTone ); ) |
458 } |
454 } |
459 } |
455 } |
460 else |
456 else |
461 { |
457 { |
462 PIM_TRAPD_ASSERT( repository = CRepository::NewL( KCRUidCalendar ); ) |
458 PIM_TRAPD_ASSERT( repository = |
463 PIM_TRAPD_ASSERT( profileRepository = CRepository::NewL( KCRUidProfileEngine ); ) |
459 CRepository::NewL( TUid::Uid(KCRUidCalendar) ); ) |
|
460 PIM_TRAPD_ASSERT( profileRepository = |
|
461 CRepository::NewL( KCRUidProfileEngine ); ) |
464 |
462 |
465 if( repository ) |
463 if( repository ) |
466 { |
464 { |
467 PIM_ASSERT( repository->Get( KCalendarDefaultSoundFile, |
465 PIM_ASSERT( repository->Get( KCalendarDefaultSoundFile, |
468 iAlarmData.iDefaultAlarmTone ); ) |
466 iAlarmData.iDefaultAlarmTone ); ) |
658 switch( iAlarmData.iAlarmType ) |
656 switch( iAlarmData.iAlarmType ) |
659 { |
657 { |
660 case EAlarmTypeClock: |
658 case EAlarmTypeClock: |
661 { |
659 { |
662 CRepository* repository = NULL; |
660 CRepository* repository = NULL; |
663 PIM_TRAPD_ASSERT( repository = CRepository::NewL( KCRUidClockApp ); ) |
661 PIM_TRAPD_ASSERT( repository = CRepository::NewL( TUid::Uid(KCRUidClockApp) ); ) |
664 |
662 |
665 if( repository ) |
663 if( repository ) |
666 { |
664 { |
667 repository->Get( KClockAppSnoozeTime, iAlarmData.iSnoozeTime ); |
665 repository->Get( KClockAppSnoozeTime, iAlarmData.iSnoozeTime ); |
668 delete repository; |
666 delete repository; |
671 } |
669 } |
672 |
670 |
673 case EAlarmTypeCalendar: |
671 case EAlarmTypeCalendar: |
674 { |
672 { |
675 CRepository* repository = NULL; |
673 CRepository* repository = NULL; |
676 PIM_TRAPD_ASSERT( repository = CRepository::NewL( KCRUidCalendar ); ) |
674 PIM_TRAPD_ASSERT( repository = |
|
675 CRepository::NewL( TUid::Uid(KCRUidCalendar) ); ) |
677 |
676 |
678 if( repository ) |
677 if( repository ) |
679 { |
678 { |
680 repository->Get( KCalendarSnoozeTime, iAlarmData.iSnoozeTime ); |
679 repository->Get( KCalendarSnoozeTime, iAlarmData.iSnoozeTime ); |
681 delete repository; |
680 delete repository; |