phonebookui/Phonebook2/UIControls/src/CPbk2ContactEditorDlgImpl.cpp
branchRCL_3
changeset 9 0d28c1c5b6dd
parent 8 5586b4d2ec3e
child 11 2828b4d142c0
equal deleted inserted replaced
8:5586b4d2ec3e 9:0d28c1c5b6dd
    67 #include <Pbk2Commands.hrh>
    67 #include <Pbk2Commands.hrh>
    68 #include "Pbk2FieldProperty.hrh"
    68 #include "Pbk2FieldProperty.hrh"
    69 #include "Pbk2IconId.hrh"
    69 #include "Pbk2IconId.hrh"
    70 #include <Pbk2UID.h>
    70 #include <Pbk2UID.h>
    71 #include <pbk2mapcommands.hrh>
    71 #include <pbk2mapcommands.hrh>
       
    72 #include <MPbk2StartupMonitor.h>
    72 
    73 
    73 // Virtual Phonebook
    74 // Virtual Phonebook
    74 #include <CVPbkContactManager.h>
    75 #include <CVPbkContactManager.h>
    75 #include <MVPbkStoreContact.h>
    76 #include <MVPbkStoreContact.h>
    76 #include <MVPbkContactStore.h>
    77 #include <MVPbkContactStore.h>
   235 
   236 
   236     // Remove empty status pane
   237     // Remove empty status pane
   237     if (iNaviContainer)
   238     if (iNaviContainer)
   238         {
   239         {
   239         iNaviContainer->Pop();
   240         iNaviContainer->Pop();
       
   241         TRAP_IGNORE(RestorePrevNaviDecoratorL());        
   240         }
   242         }
   241 
   243 
   242     delete iStoreContact;
   244     delete iStoreContact;
   243     delete iFieldFactory;
   245     delete iFieldFactory;
   244     delete iPbk2BaseCommand;
   246     delete iPbk2BaseCommand;
   935                             iExitRecord.Set(EExitOrdered);
   937                             iExitRecord.Set(EExitOrdered);
   936                             // Remove empty status pane
   938                             // Remove empty status pane
   937                             if (iNaviContainer)
   939                             if (iNaviContainer)
   938                                 {
   940                                 {
   939                                 iNaviContainer->Pop();
   941                                 iNaviContainer->Pop();
       
   942                                 RestorePrevNaviDecoratorL();
   940                                 iNaviContainer = NULL;
   943                                 iNaviContainer = NULL;
   941                                 }
   944                                 }
   942     
   945     
   943                             MPbk2ContactEditorEventObserver::TParams params;
   946                             MPbk2ContactEditorEventObserver::TParams params;
   944                             params.iFlags = EPbk2EditorCommandId;
   947                             params.iFlags = EPbk2EditorCommandId;
   963                             {
   966                             {
   964                             // Remove empty status pane
   967                             // Remove empty status pane
   965                             if (iNaviContainer)
   968                             if (iNaviContainer)
   966                                 {
   969                                 {
   967                                 iNaviContainer->Pop();
   970                                 iNaviContainer->Pop();
       
   971                                 RestorePrevNaviDecoratorL();
   968                                 iNaviContainer = NULL;
   972                                 iNaviContainer = NULL;
   969                                 }
   973                                 }
   970     
   974     
   971                             MPbk2ContactEditorEventObserver::TParams params;
   975                             MPbk2ContactEditorEventObserver::TParams params;
   972                             params.iFlags = EPbk2EditorKeyCode;
   976                             params.iFlags = EPbk2EditorKeyCode;
  1542     {
  1546     {
  1543     CPbk2ContactEditorArrayItem* current = iUiFieldArray->Find(
  1547     CPbk2ContactEditorArrayItem* current = iUiFieldArray->Find(
  1544             IdOfFocusControl());
  1548             IdOfFocusControl());
  1545     if (iParams.iActiveView == TPbk2ContactEditorParams::EEditorView)
  1549     if (iParams.iActiveView == TPbk2ContactEditorParams::EEditorView)
  1546         {
  1550         {
  1547         DimItem(aMenuPane, EPbk2ExtensionAssignFromMapSelect);
       
  1548         DimItem(aMenuPane, EPbk2ExtensionAssignFromMap);
  1551         DimItem(aMenuPane, EPbk2ExtensionAssignFromMap);
  1549         if (current && current->ContactEditorUIField()
  1552         if (current && current->ContactEditorUIField()
  1550                 && Pbk2AddressTools::MapCtrlTypeToAddress(
  1553                 && Pbk2AddressTools::MapCtrlTypeToAddress(
  1551                         current->ContactEditorUIField()->UIField()->CtrlType())
  1554                         current->ContactEditorUIField()->UIField()->CtrlType())
  1552                         != EPbk2FieldGroupIdNone)
  1555                         != EPbk2FieldGroupIdNone)
  1559             DimItem(aMenuPane, EPbk2CmdEditorOpen);
  1562             DimItem(aMenuPane, EPbk2CmdEditorOpen);
  1560             }
  1563             }
  1561         }
  1564         }
  1562     else
  1565     else
  1563         {
  1566         {
  1564         if (!current || !current->ContactEditorUIField()
       
  1565                 || current->ContactEditorUIField()->UIField()->CtrlType()
       
  1566                         != EPbk2FieldCtrlTypeExtAssignFromMapsEditor)
       
  1567             {
       
  1568             DimItem(aMenuPane, EPbk2ExtensionAssignFromMapSelect);
       
  1569             }
       
  1570         DimItem(aMenuPane, EPbk2CmdAddItem);
  1567         DimItem(aMenuPane, EPbk2CmdAddItem);
  1571         DimItem(aMenuPane, EPbk2CmdEditorOpen);
  1568         DimItem(aMenuPane, EPbk2CmdEditorOpen);
  1572         DimItem(aMenuPane, EPbk2CmdDeleteItem); 
  1569         DimItem(aMenuPane, EPbk2CmdDeleteItem); 
  1573         }
  1570         }
  1574     }
  1571     }
  1638             {
  1635             {
  1639             // Remove empty status pane
  1636             // Remove empty status pane
  1640             if (iNaviContainer)
  1637             if (iNaviContainer)
  1641                 {
  1638                 {
  1642                  iNaviContainer->Pop();
  1639                  iNaviContainer->Pop();
       
  1640                  RestorePrevNaviDecoratorL();
  1643                  iNaviContainer = NULL;
  1641                  iNaviContainer = NULL;
  1644                  }
  1642                  }
  1645             MakeVisible( EFalse );
  1643             MakeVisible( EFalse );
  1646             MPbk2ContactEditorEventObserver::TParams params;
  1644             MPbk2ContactEditorEventObserver::TParams params;
  1647             params.iFlags = EPbk2EditorKeyCode;
  1645             params.iFlags = EPbk2EditorKeyCode;
  2482         {
  2480         {
  2483         // Create a default empty status pane, otherwise sync field will show
  2481         // Create a default empty status pane, otherwise sync field will show
  2484         iNaviContainer
  2482         iNaviContainer
  2485                 = static_cast<CAknNavigationControlContainer *> (statusPane->ControlL(
  2483                 = static_cast<CAknNavigationControlContainer *> (statusPane->ControlL(
  2486                         TUid::Uid(EEikStatusPaneUidNavi)));
  2484                         TUid::Uid(EEikStatusPaneUidNavi)));
       
  2485         
       
  2486         iPrevNaviDecorator =  iNaviContainer->Top();        
       
  2487         
  2487         iNaviContainer->PushDefaultL(ETrue);
  2488         iNaviContainer->PushDefaultL(ETrue);
  2488         }
  2489         }
  2489     }
  2490     }
  2490 
  2491 
  2491 // --------------------------------------------------------------------------
  2492 // --------------------------------------------------------------------------
  3423 // CPbk2ContactEditorDlgImpl::HandleGainingForeground
  3424 // CPbk2ContactEditorDlgImpl::HandleGainingForeground
  3424 // --------------------------------------------------------------------------
  3425 // --------------------------------------------------------------------------
  3425 //
  3426 //
  3426 void CPbk2ContactEditorDlgImpl::HandleGainingForeground() 
  3427 void CPbk2ContactEditorDlgImpl::HandleGainingForeground() 
  3427     {
  3428     {
       
  3429     /*
       
  3430      * iAppServices is provided to enable editor use outside from pbk2 context
       
  3431      * no need to disable startup monitor in that case
       
  3432      */
       
  3433     if( !iAppServices )
       
  3434         {
       
  3435         MPbk2AppUi* pbk2AppUI = NULL;
       
  3436         pbk2AppUI = Phonebook2::Pbk2AppUi();
       
  3437         
       
  3438         if ( pbk2AppUI && pbk2AppUI->Pbk2StartupMonitor() )
       
  3439             {
       
  3440             TAny* extension = pbk2AppUI->Pbk2StartupMonitor()
       
  3441                     ->StartupMonitorExtension( KPbk2StartupMonitorExtensionUid );
       
  3442     
       
  3443             if( extension )
       
  3444                 {
       
  3445                 MPbk2StartupMonitorExtension* startupMonitorExtension =
       
  3446                         static_cast<MPbk2StartupMonitorExtension*>( extension );
       
  3447     
       
  3448                 if( startupMonitorExtension )
       
  3449                     {
       
  3450                     startupMonitorExtension->DisableMonitoring();
       
  3451                     }
       
  3452                 }
       
  3453             }
       
  3454         }
       
  3455     }
       
  3456 
       
  3457 // --------------------------------------------------------------------------
       
  3458 // CPbk2ContactEditorDlgImpl::RestorePrevNaviDecoratorL
       
  3459 // --------------------------------------------------------------------------
       
  3460 //
       
  3461 void CPbk2ContactEditorDlgImpl::RestorePrevNaviDecoratorL() 
       
  3462     {
       
  3463     if ( iNaviContainer && iPrevNaviDecorator ) 
       
  3464         {                                  
       
  3465         iNaviContainer->PushL(*iPrevNaviDecorator);        
       
  3466         }
  3428     }
  3467     }
  3429 
  3468 
  3430 
  3469 
  3431 // End of File
  3470 // End of File