phonebookui/Phonebook2/MapExtension/src/cpmapcontacteditorextension.cpp
branchRCL_3
changeset 74 6b5524b4f673
parent 68 9da50d567e3c
child 85 38bb213f60ba
equal deleted inserted replaced
68:9da50d567e3c 74:6b5524b4f673
   111 // CPmapContactEditorExtension::ConstructL
   111 // CPmapContactEditorExtension::ConstructL
   112 // --------------------------------------------------------------------------
   112 // --------------------------------------------------------------------------
   113 //
   113 //
   114 inline void CPmapContactEditorExtension::ConstructL()
   114 inline void CPmapContactEditorExtension::ConstructL()
   115     {
   115     {
       
   116     iMapCommandFinish = ETrue;
   116     }
   117     }
   117 
   118 
   118 // --------------------------------------------------------------------------
   119 // --------------------------------------------------------------------------
   119 // CPmapContactEditorExtension::NewL
   120 // CPmapContactEditorExtension::NewL
   120 // --------------------------------------------------------------------------
   121 // --------------------------------------------------------------------------
   168 // --------------------------------------------------------------------------
   169 // --------------------------------------------------------------------------
   169 //
   170 //
   170 TBool CPmapContactEditorExtension::ProcessCommandL
   171 TBool CPmapContactEditorExtension::ProcessCommandL
   171         ( TInt aCommandId )
   172         ( TInt aCommandId )
   172     {
   173     {
       
   174     TBool result = EFalse;
       
   175     
   173     switch( aCommandId )
   176     switch( aCommandId )
   174         {
   177         {
   175         case EPbk2ExtensionShowOnMap:
   178         case EPbk2ExtensionShowOnMap:
   176         	{
   179             {
   177         	if(iCmd)
   180             // Ignore new command if the previous command is not finished
   178         	    {
   181             if ( iMapCommandFinish )
   179                 delete iCmd;
   182                 {
   180                 iCmd = NULL;
   183                 if(iCmd)
   181         	    }
   184                     {
   182         	iCmd = CPmapCmd::NewL( iEditorControl, iContact, aCommandId );
   185                     delete iCmd;
   183         	// Execute the command 
   186                     iCmd = NULL;
   184         	iCmd->ExecuteLD();
   187                     }
   185             return ETrue;
   188                 iCmd = CPmapCmd::NewL( iEditorControl, iContact, aCommandId );
       
   189                 
       
   190                 // Observer if the Map command is finished
       
   191                 iCmd->AddObserver( *this );
       
   192                 iMapCommandFinish = EFalse;
       
   193                 
       
   194                 // Execute the command 
       
   195                 iCmd->ExecuteLD();
       
   196                 }
       
   197             result = ETrue;
       
   198             break;
   186             }
   199             }
   187         case EPbk2ExtensionAssignFromMap:
   200         case EPbk2ExtensionAssignFromMap:
   188         	{
   201             {
   189         	if(iCmd)
   202             // Ignore new command if the previous command is not finished
       
   203             if ( iMapCommandFinish )
   190                 {
   204                 {
   191                 delete iCmd;
   205                 if(iCmd)
   192                 iCmd = NULL;
   206                     {
       
   207                     delete iCmd;
       
   208                     iCmd = NULL;
       
   209                     }
       
   210                 iCmd = CPmapCmd::NewL( iEditorControl, iContact, aCommandId );
       
   211                 
       
   212                 // Observer if the Map command is finished
       
   213                 iCmd->AddObserver( *this );
       
   214                 iMapCommandFinish = EFalse;
       
   215                 
       
   216                 // Execute the command
       
   217                 iCmd->ExecuteLD();
   193                 }
   218                 }
   194         	iCmd = CPmapCmd::NewL( iEditorControl, iContact, aCommandId );
   219             result = ETrue;
   195         	// Execute the command
   220             break;
   196         	iCmd->ExecuteLD();
       
   197             return ETrue;
       
   198             }
   221             }
   199         default:
   222         default:
   200             {
   223             {
   201             // Do nothing
   224             // Do nothing
   202             break;
   225             break;
   203             }
   226             }
   204         }
   227         }
   205     return EFalse;
   228     return result;
       
   229     }
       
   230 
       
   231 // --------------------------------------------------------------------------
       
   232 // CPmapContactEditorExtension::CommandFinished
       
   233 // --------------------------------------------------------------------------
       
   234 //
       
   235 void CPmapContactEditorExtension::CommandFinished(const MPbk2Command& /*aCommand*/)
       
   236     {
       
   237     iMapCommandFinish = ETrue;
   206     }
   238     }
   207 
   239 
   208 // --------------------------------------------------------------------------
   240 // --------------------------------------------------------------------------
   209 // CPmapContactEditorExtension::OkToDeleteContactL
   241 // CPmapContactEditorExtension::OkToDeleteContactL
   210 // --------------------------------------------------------------------------
   242 // --------------------------------------------------------------------------