calendarui/editors/src/calenunifiededitor.cpp
branchRCL_3
changeset 59 aba12c885d83
parent 48 bf573002ff72
child 60 96907930389d
equal deleted inserted replaced
48:bf573002ff72 59:aba12c885d83
   942             else
   942             else
   943                 {
   943                 {
   944                 iEditorDataHandler->ResetOriginalDataL();
   944                 iEditorDataHandler->ResetOriginalDataL();
   945                 }
   945                 }
   946             }
   946             }
   947         iUnifiedEditorControl->SetDataToEditorL();
   947         iUnifiedEditorControl->SetDataToEditorL(ETrue);
   948         }
   948         }
   949 
   949 
   950     if ( aChange & EChangesLocale )
   950     if ( aChange & EChangesLocale )
   951         {
   951         {
   952         iUnifiedEditorControl->ReadDataFromEditorL( ETrue );
   952         iUnifiedEditorControl->ReadDataFromEditorL( ETrue );
  1059         case EAknSoftkeyExit:            
  1059         case EAknSoftkeyExit:            
  1060             OnCmdExitL(aCommandId);
  1060             OnCmdExitL(aCommandId);
  1061             break;
  1061             break;
  1062         case EAknCmdHelp:
  1062         case EAknCmdHelp:
  1063             OnCmdHelpL();
  1063             OnCmdHelpL();
  1064             break;
       
  1065         case ECalenSend:
       
  1066             OnCmdSendL( aCommandId );
       
  1067             break;
  1064             break;
  1068         case ECalenGetLocation:
  1065         case ECalenGetLocation:
  1069           {
  1066           {
  1070             ReadPlaceFromEditorL(); // to remove any picture characters in location string
  1067             ReadPlaceFromEditorL(); // to remove any picture characters in location string
  1071         	TBuf<ECalenAbsoluteMaxTextEditorLength> location;
  1068         	TBuf<ECalenAbsoluteMaxTextEditorLength> location;
  1318             
  1315             
  1319             if( ctrlid != ECalenEditorPeople )
  1316             if( ctrlid != ECalenEditorPeople )
  1320                 {
  1317                 {
  1321                 aMenuPane->DeleteMenuItem( ECalenCmdAddPeople );
  1318                 aMenuPane->DeleteMenuItem( ECalenCmdAddPeople );
  1322                 }
  1319                 }
  1323             
       
  1324             TryInsertSendMenuL( aResourceId, aMenuPane );
       
  1325             }
  1320             }
  1326             break;
  1321             break;
  1327 
  1322 
  1328         default:
  1323         default:
  1329             {
  1324             {
  1361     {
  1356     {
  1362     TRACE_ENTRY_POINT;
  1357     TRACE_ENTRY_POINT;
  1363 
  1358 
  1364     TryToDeleteNoteL( ETrue );
  1359     TryToDeleteNoteL( ETrue );
  1365     
  1360     
  1366     TRACE_EXIT_POINT;
       
  1367     }
       
  1368 
       
  1369 // -----------------------------------------------------------------------------
       
  1370 // CCalenUnifiedEditor::OnCmdSendL
       
  1371 // Handles the send command. This function differs from the ViewerBase version
       
  1372 // in that the ViewerBase does not attempt to save or delete the entry first.
       
  1373 // -----------------------------------------------------------------------------
       
  1374 //
       
  1375 void CCalenUnifiedEditor::OnCmdSendL( TInt aCommandId )
       
  1376     {
       
  1377     TRACE_ENTRY_POINT;
       
  1378 
       
  1379     // Show menu to user 
       
  1380     // CCalenSend handles selection internally, so we don't get anything in return
       
  1381     iGlobalData->CalenSendL().DisplaySendCascadeMenuL();
       
  1382 
       
  1383     // Try to send
       
  1384     if ( iGlobalData->CalenSendL().CanSendL(aCommandId) )
       
  1385         {
       
  1386         TBool canSend(ETrue);
       
  1387 
       
  1388         const TBool continueOnError = EFalse;
       
  1389         iUnifiedEditorControl->ReadDataFromEditorL( continueOnError );
       
  1390         CCalenEditorDataHandler::TAction action =
       
  1391             EditorDataHandler().ShouldSaveOrDeleteOrDoNothingL();
       
  1392         if(  action == CCalenEditorDataHandler::EActionSave )
       
  1393             {
       
  1394             canSend = TryToSaveNoteL();
       
  1395             }
       
  1396 
       
  1397         if ( canSend )
       
  1398             {
       
  1399             iGlobalData->CalenSendL().SendAsVCalendarL( aCommandId, EditorDataHandler().Entry() );
       
  1400             }
       
  1401         }
       
  1402     TRACE_EXIT_POINT;
  1361     TRACE_EXIT_POINT;
  1403     }
  1362     }
  1404 
  1363 
  1405 // -----------------------------------------------------------------------------
  1364 // -----------------------------------------------------------------------------
  1406 // CCalenUnifiedEditor::OnCmdHelpL
  1365 // CCalenUnifiedEditor::OnCmdHelpL
  1462         // FIXME. With new MAgnEntryUi we could use MAgnEntryUi::EInstanceDeleted
  1421         // FIXME. With new MAgnEntryUi we could use MAgnEntryUi::EInstanceDeleted
  1463         iEntryUpdater->TryDeleteInstanceWithUiL( EditorDataHandler().Entry() ,
  1422         iEntryUpdater->TryDeleteInstanceWithUiL( EditorDataHandler().Entry() ,
  1464                                     EditorDataHandler().InstanceDateTime() ,
  1423                                     EditorDataHandler().InstanceDateTime() ,
  1465                                    iRepeatType, *iServices );
  1424                                    iRepeatType, *iServices );
  1466         }
  1425         }
  1467     TRACE_EXIT_POINT;
       
  1468     }
       
  1469 
       
  1470 // -----------------------------------------------------------------------------
       
  1471 // CCalenUnifiedEditor::TryInsertSendMenuL
       
  1472 // Inserts the send menu, if needed.
       
  1473 // (other items were commented in a header).
       
  1474 // -----------------------------------------------------------------------------
       
  1475 //
       
  1476 void CCalenUnifiedEditor::TryInsertSendMenuL( TInt /*aResourceId*/, CEikMenuPane* aMenuPane )
       
  1477     {
       
  1478     TRACE_ENTRY_POINT;
       
  1479 
       
  1480     // Only insert if there is some summary (or location)
       
  1481     // Changes done to remove Lunar calendar item from options menu
       
  1482     if( EditorDataHandler().AreTextFieldsEmptyL() )
       
  1483         {
       
  1484         // Delete Send Menu item if exists
       
  1485         aMenuPane->DeleteMenuItem( ECalenSend );
       
  1486         }    
       
  1487 
       
  1488     TRACE_EXIT_POINT;
  1426     TRACE_EXIT_POINT;
  1489     }
  1427     }
  1490 
  1428 
  1491 // -----------------------------------------------------------------------------
  1429 // -----------------------------------------------------------------------------
  1492 // CCalenUnifiedEditor::CloseFormWithoutActionsL
  1430 // CCalenUnifiedEditor::CloseFormWithoutActionsL