emailservices/emailclientapi/src/emailmailbox.cpp
changeset 0 8466d47a6819
child 4 e7aa27f58ae1
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: This file implements class CEmailMailbox.
       
    15 *
       
    16 */
       
    17 
       
    18 #include <e32cmn.h> 
       
    19 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    20 #include <viewclipartner.h>
       
    21 #include <vwsdefpartner.h>
       
    22 #else
       
    23 #include <viewcli.h>
       
    24 #include <vwsdef.h>
       
    25 #endif // SYMBIAN_ENABLE_SPLIT_HEADERS
       
    26 
       
    27 #include <mmailboxsyncobserver.h>
       
    28 #include "emailmailbox.h"
       
    29 #include "emailapiutils.h"
       
    30 #include "emailaddress.h"
       
    31 #include "emailfolder.h"
       
    32 #include "emailmessage.h"
       
    33 #include "emailmessagesearch.h"
       
    34 #include "CFSMailClient.h"
       
    35 #include "emailclientapiimpl.h"
       
    36 #include "CFSMailPlugin.h"
       
    37 #include "CFSMailbox.h"
       
    38 #include "CFSMailFolder.h"
       
    39 #include "emailclientapi.hrh"
       
    40 #include "FreestyleEmailUiConstants.h"
       
    41 
       
    42 // -----------------------------------------------------------------------------
       
    43 // 
       
    44 // -----------------------------------------------------------------------------
       
    45 CEmailMailbox* CEmailMailbox::NewL( 
       
    46     CPluginData& aPluginData,
       
    47     const TMailboxId& aMailboxId )
       
    48     {
       
    49     CEmailMailbox* self = new ( ELeave ) CEmailMailbox( aPluginData, aMailboxId );
       
    50     CleanupStack::PushL( self );
       
    51     self->ConstructL();
       
    52     CleanupStack::Pop();
       
    53     return self;
       
    54     }
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // 
       
    58 // -----------------------------------------------------------------------------
       
    59 CEmailMailbox::CEmailMailbox( 
       
    60     CPluginData& aPluginData,
       
    61     const TMailboxId& aMailboxId )
       
    62     : iPluginData( aPluginData ),
       
    63     iMailboxId( aMailboxId.iId )
       
    64     {        
       
    65     }
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // 
       
    69 // -----------------------------------------------------------------------------
       
    70 void CEmailMailbox::ConstructL()
       
    71     {
       
    72     iPlugin = iPluginData.ClaimInstanceL();
       
    73     iEventMapper = new ( ELeave ) TObserverEventMapper( 
       
    74         iPlugin, iPluginData.Uid(), iMailboxId );
       
    75     iFsMailbox = iPlugin->GetMailBoxByUidL( FsMailboxId() );
       
    76     iSyncObserver = new (ELeave) CEmailMailbox::CEmailRequestObserver();    
       
    77     }
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // 
       
    81 // -----------------------------------------------------------------------------
       
    82 CEmailMailbox::~CEmailMailbox()
       
    83     {
       
    84     delete iFsMailbox;
       
    85     delete iEventMapper;
       
    86     delete iAddress;
       
    87     iPluginData.ReleaseInstance();
       
    88     delete iSyncObserver;
       
    89     }
       
    90 
       
    91 // -----------------------------------------------------------------------------
       
    92 // 
       
    93 // -----------------------------------------------------------------------------
       
    94 TEmailTypeId CEmailMailbox::InterfaceId() const
       
    95     {
       
    96     return KEmailIFUidMailbox;
       
    97     }
       
    98 
       
    99 // -----------------------------------------------------------------------------
       
   100 // 
       
   101 // -----------------------------------------------------------------------------
       
   102 void CEmailMailbox::Release()
       
   103     {
       
   104     delete this;
       
   105     }
       
   106 
       
   107 // -----------------------------------------------------------------------------
       
   108 // 
       
   109 // -----------------------------------------------------------------------------
       
   110 TMailboxId CEmailMailbox::MailboxId() const
       
   111     {
       
   112     return iMailboxId;
       
   113     }
       
   114    
       
   115 // -----------------------------------------------------------------------------
       
   116 // 
       
   117 // -----------------------------------------------------------------------------
       
   118 MEmailAddress* CEmailMailbox::AddressL() const
       
   119     {
       
   120     if ( !iAddress )
       
   121         {        
       
   122         iAddress = CEmailAddress::NewL(
       
   123             MEmailAddress::ESender, EAPIOwns );
       
   124         iAddress->SetDisplayNameL( iFsMailbox->GetName() );
       
   125         iAddress->SetAddressL( iFsMailbox->OwnMailAddress().GetEmailAddress() );
       
   126         }
       
   127     return iAddress;
       
   128     }
       
   129 
       
   130 // -----------------------------------------------------------------------------
       
   131 // 
       
   132 // -----------------------------------------------------------------------------
       
   133 TPtrC CEmailMailbox::MailboxName() const
       
   134     {
       
   135     return iFsMailbox->GetName();
       
   136     }
       
   137 
       
   138 // -----------------------------------------------------------------------------
       
   139 // Constructs and returns type mailbox id of internal data type TFSMailMsgId
       
   140 // -----------------------------------------------------------------------------
       
   141 TFSMailMsgId CEmailMailbox::FsMailboxId() const
       
   142     {
       
   143     return FsMsgId( iPluginData, iMailboxId );
       
   144     }    
       
   145 
       
   146 // -----------------------------------------------------------------------------
       
   147 // 
       
   148 // -----------------------------------------------------------------------------
       
   149 TInt CEmailMailbox::GetFoldersL( RFolderArray& aFolders ) const
       
   150     {
       
   151     TFSMailMsgId rootId = TFSMailMsgId();
       
   152     RPointerArray<CFSMailFolder> folders;
       
   153     CleanupResetAndDestroyPushL( folders );    
       
   154     iPlugin->ListFoldersL( FsMailboxId(), rootId, folders );    
       
   155     TInt res( folders.Count() );
       
   156     for ( TInt i = 0; i < res; i++ )
       
   157         {
       
   158         const CFSMailFolder* fsfolder = folders[i]; 
       
   159         const TEntryId id = fsfolder->GetFolderId().Id();
       
   160         const TFolderId folderId( id, iMailboxId );
       
   161         CEmailFolder* folder = CEmailFolder::NewLC( iPluginData, folderId, folders[i] );        
       
   162         aFolders.AppendL( folder );
       
   163         CleanupStack::Pop();    // folder
       
   164         }
       
   165     CleanupStack::Pop();    // folders
       
   166     return res;
       
   167     }
       
   168 
       
   169 // -----------------------------------------------------------------------------
       
   170 // 
       
   171 // -----------------------------------------------------------------------------
       
   172 MEmailFolder* CEmailMailbox::FolderL( const TFolderId& aFolderId ) const
       
   173     {
       
   174     CFSMailFolder* fsFolder = iPlugin->GetFolderByUidL(
       
   175             FsMsgId( iPluginData, iMailboxId ),
       
   176             FsMsgId( iPluginData, aFolderId ) );
       
   177     CleanupStack::PushL( fsFolder );
       
   178     
       
   179     CEmailFolder* folder = CEmailFolder::NewL( iPluginData, 
       
   180                 aFolderId, fsFolder);   
       
   181     CleanupStack::Pop();    // folder
       
   182     
       
   183     return folder;             
       
   184     }
       
   185  
       
   186 // -----------------------------------------------------------------------------
       
   187 // 
       
   188 // -----------------------------------------------------------------------------
       
   189 MEmailFolder* CEmailMailbox::FolderByTypeL( 
       
   190     const TFolderType aFolderType ) const
       
   191     {   
       
   192     TFSMailMsgId fsFolderId;
       
   193     
       
   194     switch ( aFolderType )
       
   195         {                   
       
   196         case EInbox:
       
   197             fsFolderId = iPlugin->GetStandardFolderIdL( FsMailboxId(), EFSInbox ); 
       
   198         case EOutbox:
       
   199             fsFolderId = iPlugin->GetStandardFolderIdL( FsMailboxId(), EFSOutbox ); 
       
   200         case EDrafts:
       
   201             fsFolderId = iPlugin->GetStandardFolderIdL( FsMailboxId(), EFSDraftsFolder ); 
       
   202         case EDeleted:
       
   203             fsFolderId = iPlugin->GetStandardFolderIdL( FsMailboxId(), EFSDeleted ); 
       
   204         case ESent:
       
   205             fsFolderId = iPlugin->GetStandardFolderIdL( FsMailboxId(), EFSSentFolder ); 
       
   206         case EOther:
       
   207         default:
       
   208             User::Leave( KErrNotFound );
       
   209             break;
       
   210         }
       
   211     
       
   212     const TFolderId folderId( fsFolderId.Id(), iMailboxId );
       
   213     
       
   214     CFSMailFolder* fsFolder = iPlugin->GetFolderByUidL(
       
   215             FsMsgId( iPluginData, iMailboxId ),
       
   216             fsFolderId );
       
   217     CleanupStack::PushL( fsFolder );
       
   218     
       
   219     CEmailFolder* folder = CEmailFolder::NewL( iPluginData,
       
   220             folderId, 
       
   221             fsFolder );
       
   222     
       
   223     CleanupStack::Pop();
       
   224     
       
   225     return folder;    
       
   226     }
       
   227 
       
   228 // -----------------------------------------------------------------------------
       
   229 // 
       
   230 // -----------------------------------------------------------------------------
       
   231 MEmailMessage* CEmailMailbox::MessageL( const TMessageId& aMessageId )
       
   232     {    
       
   233     CFSMailMessage *fsMessage = iPlugin->GetMessageByUidL( 
       
   234             FsMsgId( iPluginData, aMessageId.iFolderId.iMailboxId ), 
       
   235             FsMsgId( iPluginData, aMessageId.iFolderId ), 
       
   236             FsMsgId( iPluginData, aMessageId ), 
       
   237             EFSMsgDataEnvelope);
       
   238 
       
   239     CleanupStack::PushL( fsMessage );    
       
   240     CEmailMessage* message = CEmailMessage::NewL( iPluginData, fsMessage, EClientOwns );
       
   241     CleanupStack::Pop();  // fsMessage
       
   242     
       
   243     return message;
       
   244     }
       
   245 
       
   246 // -----------------------------------------------------------------------------
       
   247 // 
       
   248 // -----------------------------------------------------------------------------
       
   249 MEmailMessage* CEmailMailbox::CreateDraftMessageL() const
       
   250     {
       
   251     CFSMailMessage* fsMessage = iFsMailbox->CreateMessageToSend();
       
   252     CleanupStack::PushL( fsMessage );    
       
   253     MEmailMessage* message = CEmailMessage::NewL( iPluginData, fsMessage, EClientOwns );
       
   254     CleanupStack::Pop();  // fsMessage
       
   255     
       
   256     return message;
       
   257     }
       
   258     
       
   259 // -----------------------------------------------------------------------------
       
   260 // 
       
   261 // -----------------------------------------------------------------------------
       
   262 MEmailMessage* CEmailMailbox::CreateReplyMessageL( const TMessageId& aMessageId, const TBool aReplyToAll ) const
       
   263     {
       
   264     CFSMailMessage* fsMessage = iFsMailbox->CreateReplyMessage( FsMsgId( iPluginData, aMessageId ), aReplyToAll );   
       
   265     CleanupStack::PushL( fsMessage );    
       
   266     MEmailMessage* message = CEmailMessage::NewL( iPluginData, fsMessage, EClientOwns );
       
   267     CleanupStack::Pop();  // fsMessage
       
   268 
       
   269     return message;
       
   270     }
       
   271 
       
   272 // -----------------------------------------------------------------------------
       
   273 // 
       
   274 // -----------------------------------------------------------------------------
       
   275 MEmailMessage* CEmailMailbox::CreateForwardMessageL( const TMessageId& aMessageId ) const
       
   276     {            
       
   277     CFSMailMessage* fsMessage = iFsMailbox->CreateForwardMessage( FsMsgId( iPluginData, aMessageId ) );
       
   278     CleanupStack::PushL( fsMessage );    
       
   279     MEmailMessage* message = CEmailMessage::NewL( iPluginData, fsMessage, EClientOwns );
       
   280     CleanupStack::Pop();  // fsMessage
       
   281 
       
   282     return message;
       
   283     }
       
   284 
       
   285 // -----------------------------------------------------------------------------
       
   286 // 
       
   287 // -----------------------------------------------------------------------------
       
   288 void CEmailMailbox::SynchroniseL( MMailboxSyncObserver& aObserver )
       
   289     {
       
   290     iSyncObserver->SetObserverL( &aObserver );
       
   291     iRequestId = iFsMailbox->RefreshNowL( *iSyncObserver );    
       
   292     }
       
   293     
       
   294 // -----------------------------------------------------------------------------
       
   295 // 
       
   296 // -----------------------------------------------------------------------------
       
   297 void CEmailMailbox::CancelSynchronise()
       
   298     {
       
   299     iFsMailbox->CancelSearch();
       
   300     }
       
   301 
       
   302 // -----------------------------------------------------------------------------
       
   303 // 
       
   304 // -----------------------------------------------------------------------------
       
   305 void CEmailMailbox::RegisterObserverL( MMailboxContentObserver& aObserver )
       
   306     {
       
   307     iEventMapper->AddObserverL( aObserver );
       
   308     }
       
   309         
       
   310 // -----------------------------------------------------------------------------
       
   311 // 
       
   312 // -----------------------------------------------------------------------------
       
   313 void CEmailMailbox::UnregisterObserver( MMailboxContentObserver& aObserver )
       
   314     {
       
   315     iEventMapper->RemoveObserver( aObserver );
       
   316     }
       
   317 
       
   318 // -----------------------------------------------------------------------------
       
   319 // 
       
   320 // -----------------------------------------------------------------------------
       
   321 MEmailMessageSearchAsync* CEmailMailbox::MessageSearchL()
       
   322     {
       
   323     MEmailMessageSearchAsync* searchAPI = CEmailMessageSearchAsync::NewL( iPluginData, iMailboxId );
       
   324     return searchAPI;
       
   325     }
       
   326     
       
   327 void CEmailMailbox::ShowInboxL()
       
   328     {
       
   329     TMailListActivationData mailListData;
       
   330              
       
   331     mailListData.iMailBoxId = FsMsgId(iPluginData, iMailboxId);
       
   332              
       
   333     TPckgBuf<TMailListActivationData> pkgOut( mailListData );
       
   334     CVwsSessionWrapper* viewSrvSession = CVwsSessionWrapper::NewLC();
       
   335     viewSrvSession->ActivateView(TVwsViewId(KFSEmailUiUid, MailListId), KStartListWithFolderId, pkgOut);
       
   336     CleanupStack::PopAndDestroy();    
       
   337     }
       
   338 
       
   339 void CEmailMailbox::EditNewMessageL()
       
   340     {
       
   341     TEditorLaunchParams editorLaunchData;
       
   342     editorLaunchData.iMailboxId = FsMsgId(iPluginData, iMailboxId);
       
   343     editorLaunchData.iActivatedExternally = ETrue; 
       
   344     
       
   345     TPckgBuf<TEditorLaunchParams> pckgData( editorLaunchData );
       
   346     CVwsSessionWrapper* viewSrvSession = CVwsSessionWrapper::NewLC();
       
   347     TUid command = TUid::Uid(KEditorCmdCreateNew);
       
   348     viewSrvSession->ActivateView(TVwsViewId(KFSEmailUiUid, MailEditorId), command, pckgData);
       
   349     CleanupStack::PopAndDestroy( viewSrvSession );
       
   350     }
       
   351 /*
       
   352 void CEmailMailbox::GetLatestMail()
       
   353     {
       
   354     CFSMailFolder* fsFolder = NULL;
       
   355     TFSMailMsgId fsFolderId = iPlugin->GetStandardFolderIdL( FsMailboxId(), EFSInbox );
       
   356     
       
   357     }
       
   358 */
       
   359 // -----------------------------------------------------------------------------
       
   360 // 
       
   361 // -----------------------------------------------------------------------------
       
   362 CEmailMailbox::TObserverEventMapper::TObserverEventMapper( 
       
   363     CFSMailPlugin* aPlugin, 
       
   364     TUid aPluginUid, const TMailboxId& aMailboxId )
       
   365      : iPlugin( aPlugin ), 
       
   366        iFsMailboxId( aPluginUid.iUid, aMailboxId.iId )
       
   367     {
       
   368     }
       
   369 
       
   370 // -----------------------------------------------------------------------------
       
   371 // 
       
   372 // -----------------------------------------------------------------------------
       
   373 CEmailMailbox::TObserverEventMapper::~TObserverEventMapper()
       
   374     {
       
   375     iClientObservers.Close();
       
   376     }
       
   377 
       
   378 // -----------------------------------------------------------------------------
       
   379 // Adds mailbox observer and subscribes to plugin mailbox events if there
       
   380 // were no previous observers.
       
   381 // -----------------------------------------------------------------------------
       
   382 void CEmailMailbox::TObserverEventMapper::AddObserverL( MMailboxContentObserver& aObserver )
       
   383     {
       
   384     TIdentityRelation<MMailboxContentObserver> relation( &CEmailMailbox::TObserverEventMapper::Equals );
       
   385     if ( iClientObservers.Find( &aObserver, relation ) == KErrNotFound )
       
   386         {
       
   387         const TInt count( iClientObservers.Count() );
       
   388         if  ( !count )
       
   389             {
       
   390             iPlugin->SubscribeMailboxEventsL( iFsMailboxId, *this );
       
   391             }
       
   392         iClientObservers.AppendL( &aObserver );
       
   393         }
       
   394     }
       
   395 
       
   396 // -----------------------------------------------------------------------------
       
   397 // Removes an observer and removes event subscription if the observer was
       
   398 // last in observer array.
       
   399 // -----------------------------------------------------------------------------
       
   400 void CEmailMailbox::TObserverEventMapper::RemoveObserver( MMailboxContentObserver& aObserver )
       
   401     {
       
   402     TIdentityRelation<MMailboxContentObserver> relation( &CEmailMailbox::TObserverEventMapper::Equals );
       
   403     const TInt index( iClientObservers.Find( &aObserver, relation ) );
       
   404     if ( index != KErrNotFound )
       
   405         {
       
   406         iClientObservers.Remove( index );
       
   407         const TInt count( iClientObservers.Count() );
       
   408         if  ( !count )
       
   409             {
       
   410             iPlugin->UnsubscribeMailboxEvents( iFsMailboxId, *this );
       
   411             }
       
   412         }
       
   413     }
       
   414 
       
   415 // -----------------------------------------------------------------------------
       
   416 // Maps protocol a plugin event to client event
       
   417 // -----------------------------------------------------------------------------
       
   418 void CEmailMailbox::TObserverEventMapper::EventL(
       
   419     TFSMailEvent aEvent, 
       
   420     TFSMailMsgId aMailbox, 
       
   421     TAny* aParam1, 
       
   422     TAny* aParam2, 
       
   423     TAny* aParam3 )
       
   424     {
       
   425     const TEventMapFunc KMailboxEventHandlers[] = {
       
   426     CEmailMailbox::TObserverEventMapper::IgnoreEventL,
       
   427     CEmailMailbox::TObserverEventMapper::IgnoreEventL, 
       
   428     CEmailMailbox::TObserverEventMapper::IgnoreEventL, 
       
   429     CEmailMailbox::TObserverEventMapper::IgnoreEventL,
       
   430     CEmailMailbox::TObserverEventMapper::IgnoreEventL,
       
   431     CEmailMailbox::TObserverEventMapper::IgnoreEventL,
       
   432     CEmailMailbox::TObserverEventMapper::IgnoreEventL,
       
   433     CEmailMailbox::TObserverEventMapper::IgnoreEventL,
       
   434     CEmailMailbox::TObserverEventMapper::IgnoreEventL,
       
   435     CEmailMailbox::TObserverEventMapper::IgnoreEventL,
       
   436     CEmailMailbox::TObserverEventMapper::NewMessageL, 
       
   437     CEmailMailbox::TObserverEventMapper::MessageChangedL,
       
   438     CEmailMailbox::TObserverEventMapper::MessageDeletedL,
       
   439     CEmailMailbox::TObserverEventMapper::MessageMoved,
       
   440     CEmailMailbox::TObserverEventMapper::MessageCopiedL,
       
   441     CEmailMailbox::TObserverEventMapper::NewFolderL, 
       
   442     CEmailMailbox::TObserverEventMapper::FolderChangeL,
       
   443     CEmailMailbox::TObserverEventMapper::FoldersDeletedL,
       
   444     CEmailMailbox::TObserverEventMapper::FoldersMovedL,
       
   445     CEmailMailbox::TObserverEventMapper::ExceptionL
       
   446     };
       
   447 
       
   448     TMailboxId id( aMailbox.Id() );
       
   449     // boundary check
       
   450     const TInt index( aEvent );
       
   451     if ( index < sizeof( KMailboxEventHandlers ) )
       
   452         {
       
   453         // call event handler function
       
   454         TEventMapFunc method = KMailboxEventHandlers[ index ];        
       
   455         (this->*method)(id, aParam1,aParam2,aParam3 );
       
   456         }
       
   457     }
       
   458 
       
   459 void CEmailMailbox::TObserverEventMapper::IgnoreEventL( 
       
   460     TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
       
   461     {
       
   462     }
       
   463     
       
   464 void CEmailMailbox::TObserverEventMapper::NewMessageL( 
       
   465     TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
       
   466     {
       
   467     }
       
   468     
       
   469 void CEmailMailbox::TObserverEventMapper::MessageChangedL( 
       
   470     TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
       
   471     {
       
   472     }
       
   473     
       
   474 void CEmailMailbox::TObserverEventMapper::MessageDeletedL( 
       
   475     TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
       
   476     {
       
   477     }
       
   478     
       
   479 void CEmailMailbox::TObserverEventMapper::MessageMoved( 
       
   480     TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
       
   481     {
       
   482     }
       
   483     
       
   484 void CEmailMailbox::TObserverEventMapper::MessageCopiedL( 
       
   485     TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
       
   486     {
       
   487     }
       
   488     
       
   489 void CEmailMailbox::TObserverEventMapper::NewFolderL( 
       
   490     TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
       
   491     {
       
   492     }
       
   493     
       
   494 void CEmailMailbox::TObserverEventMapper::FolderChangeL( 
       
   495     TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
       
   496     {
       
   497     }
       
   498     
       
   499 void CEmailMailbox::TObserverEventMapper::FoldersDeletedL( 
       
   500     TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
       
   501     {
       
   502     }
       
   503     
       
   504 void CEmailMailbox::TObserverEventMapper::FoldersMovedL( 
       
   505     TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
       
   506     {
       
   507     }
       
   508     
       
   509 void CEmailMailbox::TObserverEventMapper::ExceptionL( 
       
   510     TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
       
   511     {
       
   512     }
       
   513     
       
   514 
       
   515 // -----------------------------------------------------------------------------
       
   516 // 
       
   517 // -----------------------------------------------------------------------------
       
   518 TBool CEmailMailbox::TObserverEventMapper::Equals( const MMailboxContentObserver& a1, const MMailboxContentObserver& a2 )
       
   519     {
       
   520     return ( &a1 == &a2 );
       
   521     }
       
   522 
       
   523 
       
   524 CEmailMailbox::CEmailRequestObserver::CEmailRequestObserver() : iObserver( NULL )
       
   525     {    
       
   526     }
       
   527 
       
   528 
       
   529 void CEmailMailbox::CEmailRequestObserver::RequestResponseL( TFSProgress aEvent, TInt /* aRequestId */ )
       
   530 {
       
   531     if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete)
       
   532         {
       
   533         iObserver->MailboxSynchronisedL(aEvent.iError);       
       
   534         }
       
   535 }
       
   536 
       
   537 void CEmailMailbox::CEmailRequestObserver::SetObserverL( MMailboxSyncObserver* aObserver )
       
   538 {
       
   539     iObserver = aObserver;
       
   540 }
       
   541 
       
   542 // End of file.
       
   543