98 iRepeatField = CCalenRepeatField::NewL( iUnifiedEditor ); |
113 iRepeatField = CCalenRepeatField::NewL( iUnifiedEditor ); |
99 iAllDayField = CCalenAllDayField::NewL( iUnifiedEditor ); |
114 iAllDayField = CCalenAllDayField::NewL( iUnifiedEditor ); |
100 iPriorityField = CCalenPriorityField::NewL( iUnifiedEditor ); |
115 iPriorityField = CCalenPriorityField::NewL( iUnifiedEditor ); |
101 iDbField = CCalenDbField::NewL( iUnifiedEditor,aServices ); |
116 iDbField = CCalenDbField::NewL( iUnifiedEditor,aServices ); |
102 iDescription = CCalenDescription::NewL( iUnifiedEditor ); |
117 iDescription = CCalenDescription::NewL( iUnifiedEditor ); |
|
118 |
|
119 // Sets up TLS, must be done before FeatureManager is used. |
|
120 FeatureManager::InitializeLibL(); |
|
121 // Used in destructor. |
|
122 iFeatMgrInitialized = ETrue; |
|
123 |
|
124 if( FeatureManager::FeatureSupported( KFeatureIdKorean ) ) |
|
125 { |
|
126 iKoreanLunarTypeField = CKoreanLunarTypeField::NewL( iUnifiedEditor ); |
|
127 } |
103 |
128 |
104 TRACE_EXIT_POINT; |
129 TRACE_EXIT_POINT; |
105 } |
130 } |
106 |
131 |
107 // ----------------------------------------------------------------------------- |
132 // ----------------------------------------------------------------------------- |
354 // |
386 // |
355 void CCalenUnifiedEditorControl::AddDefaultBirthDayEditorL() |
387 void CCalenUnifiedEditorControl::AddDefaultBirthDayEditorL() |
356 { |
388 { |
357 TRACE_ENTRY_POINT; |
389 TRACE_ENTRY_POINT; |
358 // event type, subject, date & year,more details |
390 // event type, subject, date & year,more details |
359 |
391 |
360 RPointerArray<CCalCalendarInfo> calendarInfoList; |
392 TInt prevItem = 0; |
361 iUnifiedEditor.GetServices().GetAllCalendarInfoL(calendarInfoList); |
393 prevItem=ECalenEditorSubject; |
362 CleanupClosePushL( calendarInfoList ); |
394 |
363 |
395 if(FeatureManager::FeatureSupported( KFeatureIdKorean )) |
364 if( calendarInfoList.Count() > 1 ) |
396 { |
365 { |
397 iUnifiedEditor.InsertFieldL( R_KOREAN_LUNAR_NOTEVIEW_TYPE_LINE, |
366 iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM, |
398 EKoreanLunarTypeSelectSolarLunarLeap, ECalenEditorSubject ); |
367 ECalenEditorDBName, ECalenEditorSubject ); |
399 prevItem=EKoreanLunarTypeSelectSolarLunarLeap; |
368 |
400 } |
369 iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
401 |
370 ECalenEditorStartDate, ECalenEditorDBName ); |
402 TLunarCalendarType type = iUnifiedEditor.Edited().CalendarType(); |
371 } |
403 |
|
404 if( type != ESolar && FeatureManager::FeatureSupported( KFeatureIdKorean )) |
|
405 { |
|
406 iUnifiedEditor.InsertFieldL( R_KOREAN_LUNAR_DATE_EDITOR_LINE, |
|
407 EKoreanLunarAniversityStart, prevItem ); |
|
408 prevItem=EKoreanLunarAniversityStart; |
|
409 |
|
410 TTime birthDayYear = iUnifiedEditor.Edited().EventDateTime(); |
|
411 SetDateField( ECalenEditorStartDate, birthDayYear, ETrue ); |
|
412 } |
372 else |
413 else |
373 { |
414 { |
374 iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
415 RPointerArray<CCalCalendarInfo> calendarInfoList; |
375 ECalenEditorStartDate, ECalenEditorSubject ); |
416 iUnifiedEditor.GetServices().GetAllCalendarInfoL(calendarInfoList); |
376 } |
417 CleanupClosePushL( calendarInfoList ); |
377 |
418 |
378 CleanupStack::PopAndDestroy( &calendarInfoList ); |
419 if( calendarInfoList.Count() > 1 ) |
379 |
420 { |
380 // "Start Date" Label should be "Date of Birth" for Birthday |
421 iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM, |
381 iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate, |
422 ECalenEditorDBName, prevItem ); |
382 R_QTN_CALEN_EDITOR_DATE_OF_BIRTH ); |
423 prevItem = ECalenEditorDBName; |
383 |
424 iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
384 iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_REMINDER_ITEM, |
425 ECalenEditorStartDate, prevItem ); |
385 ECalenEditorReminder, ECalenEditorStartDate ); |
426 prevItem=ECalenEditorStartDate; |
|
427 } |
|
428 else |
|
429 { |
|
430 iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
|
431 ECalenEditorStartDate, prevItem ); |
|
432 prevItem = ECalenEditorStartDate; |
|
433 } |
|
434 |
|
435 CleanupStack::PopAndDestroy( &calendarInfoList ); |
|
436 |
|
437 // "Start Date" Label should be "Date of Birth" for Birthday |
|
438 iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate, |
|
439 R_QTN_CALEN_EDITOR_DATE_OF_BIRTH ); |
|
440 } |
|
441 |
|
442 |
|
443 iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_REMINDER_ITEM, |
|
444 ECalenEditorReminder, prevItem ); |
|
445 |
386 |
446 |
387 iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PLACE_ITEM, |
447 iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PLACE_ITEM, |
388 ECalenEditorPlace, ECalenEditorReminder ); |
448 ECalenEditorPlace, ECalenEditorReminder ); |
389 /* iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PEOPLE_ITEM, |
|
390 ECalenEditorPeople, ECalenEditorPlace ); |
|
391 */ /* iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM, |
|
392 ECalenEditorDBName, ECalenEditorPlace );*/ |
|
393 |
449 |
394 // TODO: Uncomment this when enabling attachment support |
450 // TODO: Uncomment this when enabling attachment support |
395 // Replace ECalenEditorDBName with ECalenEditorAttachment in the next statement |
451 // Replace ECalenEditorDBName with ECalenEditorAttachment in the next statement |
396 iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_ATTACHMENT_ITEM, |
452 iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_ATTACHMENT_ITEM, |
397 ECalenEditorAttachment, ECalenEditorPlace ); |
453 ECalenEditorAttachment, ECalenEditorPlace ); |
562 void CCalenUnifiedEditorControl::SetDateField( TInt aControlId, const TTime& aTime, |
618 void CCalenUnifiedEditorControl::SetDateField( TInt aControlId, const TTime& aTime, |
563 TBool aDoDraw ) |
619 TBool aDoDraw ) |
564 { |
620 { |
565 TRACE_ENTRY_POINT; |
621 TRACE_ENTRY_POINT; |
566 |
622 |
567 CEikDateEditor* dateField = NULL; |
623 TBool useLunarDate = EFalse; |
568 dateField = static_cast<CEikDateEditor*>( iUnifiedEditor.ControlOrNull( aControlId ) ); |
624 if(aControlId == ECalenEditorStartDate |
569 if( dateField ) |
625 && FeatureManager::FeatureSupported( KFeatureIdKorean )) |
570 { |
626 { |
571 dateField->SetDate( aTime ); |
627 if( CCalEntry::EAnniv == iUnifiedEditor.GetEntryType() ) |
572 if( aDoDraw ) |
628 { |
573 { |
629 TLunarCalendarType type = iUnifiedEditor.Edited().CalendarType(); |
574 dateField->DrawDeferred(); |
630 if( type != ESolar ) |
575 } |
631 { |
576 } |
632 useLunarDate = ETrue; |
577 |
633 } |
|
634 } |
|
635 } |
|
636 |
|
637 if(useLunarDate || aControlId == EKoreanLunarAniversityStart |
|
638 && FeatureManager::FeatureSupported( KFeatureIdKorean ) ) |
|
639 { |
|
640 CKoreanLunarDateEditor* dateField = NULL; |
|
641 dateField = static_cast<CKoreanLunarDateEditor*>( iUnifiedEditor.ControlOrNull( EKoreanLunarAniversityStart ) ); |
|
642 if( dateField ) |
|
643 { |
|
644 dateField->SetDate(aTime, EFalse); |
|
645 } |
|
646 if ( aDoDraw ) |
|
647 { |
|
648 dateField->DrawDeferred(); |
|
649 } |
|
650 } |
|
651 else |
|
652 { |
|
653 CEikDateEditor* dateField = NULL; |
|
654 dateField = static_cast<CEikDateEditor*>( iUnifiedEditor.ControlOrNull( aControlId ) ); |
|
655 if( dateField ) |
|
656 { |
|
657 dateField->SetDate( aTime ); |
|
658 if( aDoDraw ) |
|
659 { |
|
660 dateField->DrawDeferred(); |
|
661 } |
|
662 } |
|
663 } |
578 TRACE_EXIT_POINT; |
664 TRACE_EXIT_POINT; |
579 } |
665 } |
580 |
666 |
581 // ----------------------------------------------------------------------------- |
667 // ----------------------------------------------------------------------------- |
582 // CCalenUnifiedEditorControl::SetDateTimeField |
668 // CCalenUnifiedEditorControl::SetDateTimeField |
842 |
944 |
843 TRACE_EXIT_POINT; |
945 TRACE_EXIT_POINT; |
844 } |
946 } |
845 |
947 |
846 // ----------------------------------------------------------------------------- |
948 // ----------------------------------------------------------------------------- |
|
949 // CCalenUnifiedEditorControl::OnLunarTypeChangedL |
|
950 // Handles lunar type changed |
|
951 // ----------------------------------------------------------------------------- |
|
952 // |
|
953 void CCalenUnifiedEditorControl::OnLunarTypeChangedL( TLunarCalendarType aNewEventType ) |
|
954 { |
|
955 TRACE_ENTRY_POINT; |
|
956 if( FeatureManager::FeatureSupported( KFeatureIdKorean ) ) |
|
957 { |
|
958 TLunarCalendarType oldType = iUnifiedEditor.Edited().CalendarType(); |
|
959 if(oldType != aNewEventType) |
|
960 { |
|
961 iUnifiedEditor.Edited().SetCalendarTypeL(aNewEventType); |
|
962 if(aNewEventType == ESolar) |
|
963 { |
|
964 iUnifiedEditor.DeleteLine(EKoreanLunarAniversityStart, ETrue); |
|
965 iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
|
966 ECalenEditorStartDate, EKoreanLunarTypeSelectSolarLunarLeap ); |
|
967 iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate, |
|
968 R_QTN_CALEN_EDITOR_DATE_OF_BIRTH ); |
|
969 SetDataToEditorL(); |
|
970 } |
|
971 else |
|
972 { |
|
973 if(oldType == ESolar) |
|
974 { |
|
975 iUnifiedEditor.DeleteLine(ECalenEditorStartDate, ETrue); |
|
976 iUnifiedEditor.InsertFieldL( R_KOREAN_LUNAR_DATE_EDITOR_LINE, |
|
977 EKoreanLunarAniversityStart, EKoreanLunarTypeSelectSolarLunarLeap ); |
|
978 SetDataToEditorL(); |
|
979 } |
|
980 } |
|
981 } |
|
982 } |
|
983 TRACE_EXIT_POINT; |
|
984 } |
|
985 |
|
986 // ----------------------------------------------------------------------------- |
847 // CCalenUnifiedEditorControl::DeletePreviousEntryTypeFieldsL |
987 // CCalenUnifiedEditorControl::DeletePreviousEntryTypeFieldsL |
848 // Delete previous entry type fields on selcting |
988 // Delete previous entry type fields on selcting |
849 // the new entry type |
989 // the new entry type |
850 // ----------------------------------------------------------------------------- |
990 // ----------------------------------------------------------------------------- |
851 // |
991 // |
1353 } |
1545 } |
1354 break; |
1546 break; |
1355 |
1547 |
1356 case CCalEntry::EAnniv: |
1548 case CCalEntry::EAnniv: |
1357 { |
1549 { |
1358 iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse ); |
1550 TLunarCalendarType type = iUnifiedEditor.Edited().CalendarType(); |
1359 iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
1551 if( type != ESolar && FeatureManager::FeatureSupported( KFeatureIdKorean )) |
1360 ECalenEditorStartDate, ECalenEditorEventType ); |
1552 { |
1361 |
1553 iUnifiedEditor.DeleteLine( EKoreanLunarAniversityStart, EFalse ); |
1362 // "Start Date" Label should be "Date of Birth" for Birthday |
1554 iUnifiedEditor.InsertFieldL( R_KOREAN_LUNAR_DATE_EDITOR_LINE, |
1363 iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate, |
1555 EKoreanLunarAniversityStart, EKoreanLunarTypeSelectSolarLunarLeap ); |
1364 R_QTN_CALEN_EDITOR_DATE_OF_BIRTH ); |
1556 } |
1365 |
1557 else |
|
1558 { |
|
1559 iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse ); |
|
1560 iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
|
1561 ECalenEditorStartDate, ECalenEditorEventType ); |
|
1562 // "Start Date" Label should be "Date of Birth" for Birthday |
|
1563 iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate, |
|
1564 R_QTN_CALEN_EDITOR_DATE_OF_BIRTH ); |
|
1565 } |
|
1566 |
1366 } |
1567 } |
1367 break; |
1568 break; |
1368 |
1569 |
1369 case CCalEntry::EAppt: |
1570 case CCalEntry::EAppt: |
1370 { |
1571 { |