calendarui/editors/src/calenunifiededitorcontrol.cpp
branchRCL_3
changeset 30 d68a4b5d5885
parent 27 55d60436f00b
child 36 9c5b1510919f
equal deleted inserted replaced
27:55d60436f00b 30:d68a4b5d5885
   327                 CCalEntry::ETodo != iUnifiedEditor.GetEntryType() )
   327                 CCalEntry::ETodo != iUnifiedEditor.GetEntryType() )
   328         {
   328         {
   329         iRepeatField->InitRepetFieldLayoutL();
   329         iRepeatField->InitRepetFieldLayoutL();
   330         }
   330         }
   331 
   331 
   332     iDbField->InitDbFieldLayoutL();
   332     RPointerArray<CCalCalendarInfo> calendarInfoList; 
       
   333     iUnifiedEditor.GetServices().GetAllCalendarInfoL(calendarInfoList);
       
   334     CleanupClosePushL( calendarInfoList );
       
   335     if( calendarInfoList.Count() > 1 )
       
   336       {
       
   337         iDbField->InitDbFieldLayoutL();
       
   338       }
       
   339     CleanupStack::PopAndDestroy( &calendarInfoList );
       
   340     
   333     iDescription->InitDescritpionFieldLayoutL();
   341     iDescription->InitDescritpionFieldLayoutL();
   334     
   342     
   335     TRACE_EXIT_POINT;
   343     TRACE_EXIT_POINT;
   336     }
   344     }
   337 
   345 
   342 //
   350 //
   343 void CCalenUnifiedEditorControl::AddDefaultBirthDayEditorL()
   351 void CCalenUnifiedEditorControl::AddDefaultBirthDayEditorL()
   344     {
   352     {
   345     TRACE_ENTRY_POINT;
   353     TRACE_ENTRY_POINT;
   346     // event type, subject, date & year,more details
   354     // event type, subject, date & year,more details
   347      
   355     
   348     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, 
   356     RPointerArray<CCalCalendarInfo> calendarInfoList; 
   349                   ECalenEditorStartDate, ECalenEditorSubject ); 
   357     iUnifiedEditor.GetServices().GetAllCalendarInfoL(calendarInfoList);
   350 
   358     CleanupClosePushL( calendarInfoList );
       
   359 
       
   360     if( calendarInfoList.Count() > 1 )
       
   361         {
       
   362         iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM,
       
   363             ECalenEditorDBName, ECalenEditorSubject );
       
   364 
       
   365         iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, 
       
   366             ECalenEditorStartDate, ECalenEditorDBName );
       
   367         }
       
   368     else
       
   369         {
       
   370         iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, 
       
   371             ECalenEditorStartDate, ECalenEditorSubject );
       
   372         }
       
   373 
       
   374     CleanupStack::PopAndDestroy( &calendarInfoList );
       
   375     
   351     // "Start Date" Label should be "Date of Birth" for Birthday
   376     // "Start Date" Label should be "Date of Birth" for Birthday
   352     iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate,
   377     iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate,
   353                     R_QTN_CALEN_EDITOR_DATE_OF_BIRTH );
   378                     R_QTN_CALEN_EDITOR_DATE_OF_BIRTH );
   354 
   379 
   355     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_REMINDER_ITEM,
   380     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_REMINDER_ITEM,
   357 
   382 
   358     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PLACE_ITEM,
   383     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PLACE_ITEM,
   359                     ECalenEditorPlace, ECalenEditorReminder );
   384                     ECalenEditorPlace, ECalenEditorReminder );
   360 /*    iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PEOPLE_ITEM,
   385 /*    iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PEOPLE_ITEM,
   361                     ECalenEditorPeople, ECalenEditorPlace );
   386                     ECalenEditorPeople, ECalenEditorPlace );
   362 */    iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM,
   387 */   /* iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM,
   363                     ECalenEditorDBName, ECalenEditorPlace );
   388                     ECalenEditorDBName, ECalenEditorPlace );*/
   364 
   389 
   365     // TODO: Uncomment this when enabling attachment support
   390     // TODO: Uncomment this when enabling attachment support
   366     // Replace ECalenEditorDBName with ECalenEditorAttachment in the next statement
   391     // Replace ECalenEditorDBName with ECalenEditorAttachment in the next statement
   367     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_ATTACHMENT_ITEM,
   392     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_ATTACHMENT_ITEM,
   368                     ECalenEditorAttachment, ECalenEditorDBName );
   393                     ECalenEditorAttachment, ECalenEditorPlace );
   369 
   394 
   370     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DESCRIPTION_ITEM,
   395     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DESCRIPTION_ITEM,
   371                     ECalenEditorDescription, ECalenEditorAttachment );
   396                     ECalenEditorDescription, ECalenEditorAttachment );
   372     
   397     
   373     TRACE_EXIT_POINT;
   398     TRACE_EXIT_POINT;
   386     // end date,place,more details
   411     // end date,place,more details
   387     
   412     
   388     // all day event 
   413     // all day event 
   389     // subject,event type,all day,start date,end date,place,more details 
   414     // subject,event type,all day,start date,end date,place,more details 
   390     
   415     
   391   
   416     RPointerArray<CCalCalendarInfo> calendarInfoList; 
       
   417     iUnifiedEditor.GetServices().GetAllCalendarInfoL(calendarInfoList);
       
   418     CleanupClosePushL( calendarInfoList );
       
   419 
       
   420     if( calendarInfoList.Count() > 1 )
       
   421         {
       
   422     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM,
       
   423             ECalenEditorDBName, ECalenEditorSubject );
       
   424 
   392     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_ALL_DAY_ITEM,
   425     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_ALL_DAY_ITEM,
       
   426             ECalenEditorAllDayItem, ECalenEditorDBName );
       
   427         }
       
   428     else
       
   429         {
       
   430     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_ALL_DAY_ITEM, 
   393             ECalenEditorAllDayItem, ECalenEditorSubject );
   431             ECalenEditorAllDayItem, ECalenEditorSubject );
   394 
   432         }
       
   433 
       
   434     CleanupStack::PopAndDestroy( &calendarInfoList );
       
   435     
   395     if( !iUnifiedEditor.Edited().IsAllDayEvent() )
   436     if( !iUnifiedEditor.Edited().IsAllDayEvent() )
   396         {
   437         {
   397         iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_TIME_ITEM, 
   438         iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_TIME_ITEM, 
   398                 ECalenEditorStartTime, ECalenEditorAllDayItem );
   439                 ECalenEditorStartTime, ECalenEditorAllDayItem );
   399         iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_END_TIME_ITEM,
   440         iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_END_TIME_ITEM,
   416     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_REPEAT_ITEM,
   457     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_REPEAT_ITEM,
   417                     ECalenEditorRepeat, ECalenEditorReminder );
   458                     ECalenEditorRepeat, ECalenEditorReminder );
   418     /*iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PEOPLE_ITEM,
   459     /*iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PEOPLE_ITEM,
   419                     ECalenEditorPeople, ECalenEditorRepeat );
   460                     ECalenEditorPeople, ECalenEditorRepeat );
   420     */
   461     */
   421     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM,
   462    /* iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM,
   422                     ECalenEditorDBName, ECalenEditorRepeat );
   463                     ECalenEditorDBName, ECalenEditorRepeat );
   423     
   464     */
   424     // TODO: Uncomment this when enabling attachment support
   465     // TODO: Uncomment this when enabling attachment support
   425     // Replace ECalenEditorDBName with ECalenEditorAttachment in the next statement
   466     // Replace ECalenEditorDBName with ECalenEditorAttachment in the next statement
   426     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_ATTACHMENT_ITEM,
   467     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_ATTACHMENT_ITEM,
   427                     ECalenEditorAttachment, ECalenEditorDBName );
   468                     ECalenEditorAttachment, ECalenEditorRepeat );
   428     
   469     
   429     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DESCRIPTION_ITEM,
   470     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DESCRIPTION_ITEM,
   430                     ECalenEditorDescription, ECalenEditorAttachment );
   471                     ECalenEditorDescription, ECalenEditorAttachment );
   431     
   472     
   432     TRACE_EXIT_POINT;
   473     TRACE_EXIT_POINT;
   439 //
   480 //
   440 void CCalenUnifiedEditorControl::AddDefaultTodoEditorL()
   481 void CCalenUnifiedEditorControl::AddDefaultTodoEditorL()
   441     {
   482     {
   442     TRACE_ENTRY_POINT;
   483     TRACE_ENTRY_POINT;
   443     // event type,subject,due date,more details
   484     // event type,subject,due date,more details
   444     
   485    RPointerArray<CCalCalendarInfo> calendarInfoList; 
   445     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, 
   486    iUnifiedEditor.GetServices().GetAllCalendarInfoL(calendarInfoList);
   446                     ECalenEditorStartDate, ECalenEditorSubject );
   487    CleanupClosePushL( calendarInfoList );
       
   488    
       
   489     if( calendarInfoList.Count() > 1 )
       
   490         {
       
   491         iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM,
       
   492                         ECalenEditorDBName, ECalenEditorSubject );
       
   493         
       
   494         iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, 
       
   495                             ECalenEditorStartDate, ECalenEditorDBName );
       
   496         }
       
   497     else
       
   498         {
       
   499         iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, 
       
   500                                ECalenEditorStartDate, ECalenEditorSubject );
       
   501         }
       
   502     
       
   503     CleanupStack::PopAndDestroy( &calendarInfoList );
   447 
   504 
   448     // "Start Date" Label should be "Due date" for To-Do
   505     // "Start Date" Label should be "Due date" for To-Do
   449     iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate,
   506     iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate,
   450                     R_QTN_CALEN_EDITOR_DUE_DATE );
   507                     R_QTN_CALEN_EDITOR_DUE_DATE );
   451     
   508     
   453                     ECalenEditorReminder, ECalenEditorStartDate );
   510                     ECalenEditorReminder, ECalenEditorStartDate );
   454     
   511     
   455     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PRIORITY_ITEM, 
   512     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PRIORITY_ITEM, 
   456                     ECalenEditorPriority, ECalenEditorReminder );
   513                     ECalenEditorPriority, ECalenEditorReminder );
   457 
   514 
   458     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM,
   515     /*iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM,
   459                     ECalenEditorDBName, ECalenEditorPriority );
   516                     ECalenEditorDBName, ECalenEditorPriority );*/
   460     
   517     
   461     // TODO: Uncomment this when enabling attachment support
   518     // TODO: Uncomment this when enabling attachment support
   462     // Replace ECalenEditorDBName with ECalenEditorAttachment in the next statement
   519     // Replace ECalenEditorDBName with ECalenEditorAttachment in the next statement
   463     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_ATTACHMENT_ITEM,
   520     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_ATTACHMENT_ITEM,
   464                     ECalenEditorAttachment, ECalenEditorDBName );
   521                     ECalenEditorAttachment, ECalenEditorPriority );
   465     
   522     
   466     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DESCRIPTION_ITEM,
   523     iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DESCRIPTION_ITEM,
   467                     ECalenEditorDescription, ECalenEditorAttachment );
   524                     ECalenEditorDescription, ECalenEditorAttachment );
   468     
   525     
   469     TRACE_EXIT_POINT;
   526     TRACE_EXIT_POINT;
   866     if( PeopleFieldCtrl )
   923     if( PeopleFieldCtrl )
   867         {
   924         {
   868         iUnifiedEditor.DeleteLine( ECalenEditorPeople );
   925         iUnifiedEditor.DeleteLine( ECalenEditorPeople );
   869         }
   926         }
   870     */
   927     */
   871     iUnifiedEditor.DeleteLine( ECalenEditorDBName );
   928     CCoeControl* dbNameCtrl = iUnifiedEditor.ControlOrNull( ECalenEditorDBName );
   872     
   929     if( dbNameCtrl )
       
   930         {
       
   931         iUnifiedEditor.DeleteLine( ECalenEditorDBName );
       
   932         }
   873     // TODO: Uncomment this when enabling attachment support
   933     // TODO: Uncomment this when enabling attachment support
   874     iUnifiedEditor.DeleteLine( ECalenEditorAttachment );
   934     iUnifiedEditor.DeleteLine( ECalenEditorAttachment );
   875     
   935     
   876     iUnifiedEditor.DeleteLine( ECalenEditorDescription );
   936     iUnifiedEditor.DeleteLine( ECalenEditorDescription );
   877     
   937     
  1281             break;
  1341             break;
  1282             
  1342             
  1283         case CCalEntry::EAnniv:
  1343         case CCalEntry::EAnniv:
  1284             {
  1344             {
  1285             iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse );
  1345             iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse );
  1286             iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_BIRTHDAY_YEAR_ITEM, 
  1346             iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, 
  1287                     ECalenEditorStartDate, ECalenEditorEventType );
  1347                     ECalenEditorStartDate, ECalenEditorEventType );
       
  1348             
       
  1349             // "Start Date" Label should be "Date of Birth" for Birthday
       
  1350             iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate,
       
  1351                             R_QTN_CALEN_EDITOR_DATE_OF_BIRTH );
  1288             
  1352             
  1289             }
  1353             }
  1290             break;
  1354             break;
  1291             
  1355             
  1292         case CCalEntry::EAppt:
  1356         case CCalEntry::EAppt: