calendarui/editors/src/calenunifiededitorcontrol.cpp
branchRCL_3
changeset 31 97232defd20e
parent 30 bd7edf625bdd
equal deleted inserted replaced
30:bd7edf625bdd 31:97232defd20e
    22 #include <e32des16.h>
    22 #include <e32des16.h>
    23 #include <calentry.h>
    23 #include <calentry.h>
    24 #include <CalenDefaultEditorsData.rsg>
    24 #include <CalenDefaultEditorsData.rsg>
    25 #include <calendateutils.h>
    25 #include <calendateutils.h>
    26 #include <calenservices.h>
    26 #include <calenservices.h>
    27 
    27 #include <featmgr.h>
    28 // user includes
    28 // user includes
    29 #include "calenunifiededitorcontrol.h"
    29 #include "calenunifiededitorcontrol.h"
    30 #include "calenunifiededitor.h"
    30 #include "calenunifiededitor.h"
    31 #include "CalenDefaultEditors.hrh"
    31 #include "CalenDefaultEditors.hrh"
    32 #include "calenentryutil.h"
    32 #include "calenentryutil.h"
    35 #include "calenrepeatfield.h"
    35 #include "calenrepeatfield.h"
    36 #include "calenalldayfield.h"
    36 #include "calenalldayfield.h"
    37 #include "calenpriorityfield.h"
    37 #include "calenpriorityfield.h"
    38 #include "calendbfield.h"
    38 #include "calendbfield.h"
    39 #include "CalenDescription.h"
    39 #include "CalenDescription.h"
       
    40 #include "KoreanLunarDateEditor.h"
       
    41 #include "KoreanLunarTypeField.h"
       
    42 
    40 
    43 
    41 // debug
    44 // debug
    42 #include "calendarui_debug.h"
    45 #include "calendarui_debug.h"
    43 
    46 
    44 // Constants
    47 // Constants
    79     delete iAllDayField;
    82     delete iAllDayField;
    80     delete iPriorityField;
    83     delete iPriorityField;
    81     delete iDbField;
    84     delete iDbField;
    82     delete iDescription;
    85     delete iDescription;
    83     
    86     
       
    87     if( iKoreanLunarTypeField )
       
    88         {
       
    89         delete iKoreanLunarTypeField;
       
    90         }
       
    91         
       
    92     // Do not call UnInitializeLib() if InitalizeLib() leaves.
       
    93     if ( iFeatMgrInitialized )
       
    94         {
       
    95         // Frees the TLS. Must be done after FeatureManager is used.
       
    96         FeatureManager::UnInitializeLib();  
       
    97         }  
       
    98     
    84     TRACE_EXIT_POINT;
    99     TRACE_EXIT_POINT;
    85     }
   100     }
    86 
   101 
    87 // -----------------------------------------------------------------------------
   102 // -----------------------------------------------------------------------------
    88 // CCalenUnifiedEditorControl::ConstructL
   103 // CCalenUnifiedEditorControl::ConstructL
    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 // -----------------------------------------------------------------------------
   340       {
   365       {
   341         iDbField->InitDbFieldLayoutL();
   366         iDbField->InitDbFieldLayoutL();
   342       }
   367       }
   343     CleanupStack::PopAndDestroy( &calendarInfoList );
   368     CleanupStack::PopAndDestroy( &calendarInfoList );
   344     
   369     
       
   370     
       
   371     if( CCalEntry::EAnniv == iUnifiedEditor.GetEntryType() 
       
   372 	     && FeatureManager::FeatureSupported( KFeatureIdKorean ) )
       
   373         {
       
   374         iKoreanLunarTypeField->PreLayoutDynInitL();
       
   375         }
       
   376 
   345     iDescription->InitDescritpionFieldLayoutL();
   377     iDescription->InitDescritpionFieldLayoutL();
   346     
   378     
   347     TRACE_EXIT_POINT;
   379     TRACE_EXIT_POINT;
   348     }
   380     }
   349 
   381 
   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
   719         case ECalenEditorDBName:
   805         case ECalenEditorDBName:
   720             {
   806             {
   721             iDbField->HandleControlStateChangeL( aControlId );
   807             iDbField->HandleControlStateChangeL( aControlId );
   722             }
   808             }
   723             break;
   809             break;
       
   810         case EKoreanLunarTypeSelectSolarLunarLeap:
       
   811         	{
       
   812         	if (FeatureManager::FeatureSupported( KFeatureIdKorean ))
       
   813         		{
       
   814         		iKoreanLunarTypeField->HandleControlStateChangeL( aControlId );
       
   815         		}
       
   816         	}
       
   817             break;
       
   818         case EKoreanLunarAniversityStart:
       
   819         	{
       
   820         	iKoreanLunarDateEditor->HandleControlStateChangeL( aControlId );
       
   821         	}
       
   822         	  
   724         default:
   823         default:
   725             break;
   824             break;
   726         }
   825         }
   727    
   826    
   728     TRACE_EXIT_POINT;
   827     TRACE_EXIT_POINT;
   748             }
   847             }
   749             break;
   848             break;
   750             
   849             
   751         case ECalenEditorStartTime:    
   850         case ECalenEditorStartTime:    
   752         case ECalenEditorStartDate:
   851         case ECalenEditorStartDate:
       
   852         case EKoreanLunarAniversityStart:
   753             {
   853             {
   754             ReadStartDateTimeFromEditorL( ETrue, aFocusedId );
   854             ReadStartDateTimeFromEditorL( ETrue, aFocusedId );
   755             UpdateMeetingDurationL();
   855             UpdateMeetingDurationL();
   756             }
   856             }
   757             break;
   857             break;
   802             break;
   902             break;
   803         case ECalenEditorAttachment:
   903         case ECalenEditorAttachment:
   804             break;
   904             break;
   805         case ECalenEditorDescription:
   905         case ECalenEditorDescription:
   806             break;
   906             break;
       
   907         case EKoreanLunarTypeSelectSolarLunarLeap:
       
   908         	break;
   807         default:
   909         default:
   808             break;
   910             break;
   809         }
   911         }
   810     
   912     
   811     iReminderField->PrepareForFocusTransitionL( aFocusedId );
   913     iReminderField->PrepareForFocusTransitionL( aFocusedId );
   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 //
   864             iUnifiedEditor.DeleteLine( ECalenEditorPlace, EFalse );
  1004             iUnifiedEditor.DeleteLine( ECalenEditorPlace, EFalse );
   865             }
  1005             }
   866             break;
  1006             break;
   867         case CCalEntry::EAnniv:
  1007         case CCalEntry::EAnniv:
   868             {
  1008             {
   869             iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse );
  1009           	TLunarCalendarType type =  iUnifiedEditor.Edited().CalendarType();
       
  1010 			if( type != ESolar && FeatureManager::FeatureSupported( KFeatureIdKorean ) )
       
  1011 				{
       
  1012 				iUnifiedEditor.DeleteLine( EKoreanLunarAniversityStart, EFalse );
       
  1013                 }
       
  1014             else
       
  1015 				{
       
  1016 				iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse );
       
  1017             	}
       
  1018 			
       
  1019 			if(FeatureManager::FeatureSupported( KFeatureIdKorean ))
       
  1020 				{
       
  1021 				iUnifiedEditor.DeleteLine( EKoreanLunarTypeSelectSolarLunarLeap, EFalse );
       
  1022 				}
   870             }
  1023             }
   871             break;
  1024             break;
   872         case CCalEntry::EAppt:
  1025         case CCalEntry::EAppt:
   873             {
  1026             {
   874             if( iUnifiedEditor.Edited().IsAllDayEvent() ) 
  1027             if( iUnifiedEditor.Edited().IsAllDayEvent() ) 
  1059             {
  1212             {
  1060             iRepeatField->ReadDataFromFormL( aContinueOnError );
  1213             iRepeatField->ReadDataFromFormL( aContinueOnError );
  1061             }
  1214             }
  1062         }
  1215         }
  1063     
  1216     
       
  1217     if( iUnifiedEditor.GetEntryType() == CCalEntry::EAnniv 
       
  1218         &&  FeatureManager::FeatureSupported( KFeatureIdKorean ) )
       
  1219     	{
       
  1220     	CCoeControl* lunarcaltype = iUnifiedEditor.ControlOrNull( EKoreanLunarTypeSelectSolarLunarLeap );
       
  1221     	if( lunarcaltype )
       
  1222     		{
       
  1223     	    iKoreanLunarTypeField->ReadDataFromFormL( aContinueOnError );
       
  1224     	    }
       
  1225     	}
       
  1226     
  1064     iDbField->ReadDataFromFormL( aContinueOnError );
  1227     iDbField->ReadDataFromFormL( aContinueOnError );
  1065     
  1228     
  1066     TRACE_EXIT_POINT;
  1229     TRACE_EXIT_POINT;
  1067     }
  1230     }
  1068 
  1231 
  1249 // -----------------------------------------------------------------------------
  1412 // -----------------------------------------------------------------------------
  1250 //
  1413 //
  1251 TTime CCalenUnifiedEditorControl::ReadTimeField( TInt aControlId )
  1414 TTime CCalenUnifiedEditorControl::ReadTimeField( TInt aControlId )
  1252     {
  1415     {
  1253     TRACE_ENTRY_POINT;
  1416     TRACE_ENTRY_POINT;
       
  1417 
       
  1418     if(aControlId == ECalenEditorStartDate && FeatureManager::FeatureSupported( KFeatureIdKorean ))
       
  1419 		{
       
  1420 		if( CCalEntry::EAnniv == iUnifiedEditor.GetEntryType() )
       
  1421 			{
       
  1422 			TLunarCalendarType type =  iUnifiedEditor.Edited().CalendarType();
       
  1423 			if( type != ESolar )
       
  1424 				{
       
  1425 				aControlId = EKoreanLunarAniversityStart;
       
  1426 				TRACE_EXIT_POINT;
       
  1427 				return static_cast<CKoreanLunarDateEditor*>( iUnifiedEditor.Control( aControlId ) )->Date();
       
  1428 				}
       
  1429 			}
       
  1430 		}
  1254     TRACE_EXIT_POINT;
  1431     TRACE_EXIT_POINT;
  1255     return static_cast<CEikTTimeEditor*>( iUnifiedEditor.Control( aControlId ) )->GetTTime();
  1432     return static_cast<CEikTTimeEditor*>( iUnifiedEditor.Control( aControlId ) )->GetTTime();
  1256     }
  1433     }
  1257 
  1434 
  1258 // -----------------------------------------------------------------------------
  1435 // -----------------------------------------------------------------------------
  1261 // -----------------------------------------------------------------------------
  1438 // -----------------------------------------------------------------------------
  1262 //
  1439 //
  1263 TTime CCalenUnifiedEditorControl::ReadDateField( TInt aControlId )
  1440 TTime CCalenUnifiedEditorControl::ReadDateField( TInt aControlId )
  1264     {
  1441     {
  1265     TRACE_ENTRY_POINT;
  1442     TRACE_ENTRY_POINT;
       
  1443 
       
  1444     if(aControlId == ECalenEditorStartDate && FeatureManager::FeatureSupported( KFeatureIdKorean ))
       
  1445     	{
       
  1446     	if( CCalEntry::EAnniv == iUnifiedEditor.GetEntryType() )
       
  1447     		{
       
  1448     		TLunarCalendarType type =  iUnifiedEditor.Edited().CalendarType();
       
  1449     		if( type != ESolar )
       
  1450     			{
       
  1451     			aControlId = EKoreanLunarAniversityStart;
       
  1452 				TRACE_EXIT_POINT;
       
  1453     			return static_cast<CKoreanLunarDateEditor*>( iUnifiedEditor.Control( aControlId ) )->Date();
       
  1454     			}
       
  1455     		}
       
  1456     	}
       
  1457     	
  1266     TRACE_EXIT_POINT;
  1458     TRACE_EXIT_POINT;
  1267     return static_cast<CEikDateEditor*>( iUnifiedEditor.Control( aControlId ) )->Date();
  1459     return static_cast<CEikDateEditor*>( iUnifiedEditor.Control( aControlId ) )->Date();
  1268     }
  1460     }
  1269 
  1461 
  1270 // -----------------------------------------------------------------------------
  1462 // -----------------------------------------------------------------------------
  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             {