emailservices/emailstore/base_plugin/src/basepluginnotifications.cpp
branchRCL_3
changeset 11 0396474f30f5
parent 8 e1b6206813b4
child 24 d189ee25cf9d
equal deleted inserted replaced
10:f5907b1a1053 11:0396474f30f5
   124 void CBasePlugin::SystemEventNotifyL( TMsgStoreSystemEvent aEvent )
   124 void CBasePlugin::SystemEventNotifyL( TMsgStoreSystemEvent aEvent )
   125     
   125     
   126     {
   126     {
   127     switch ( aEvent )
   127     switch ( aEvent )
   128         {
   128         {
   129         // A backup or restore is in progress.  The message store is unavailable.
   129         // The message store is unavailable.  This may be due to 
   130         case EMsgStoreBackupOrRestoreInProgress:
   130         // a backup or restore being in progress, a Pointsec lock being issued,
   131         // The message store has been wiped, including the password.
   131         // the disk drive being unavailable, etc.
   132         case EMsgStoreDatabaseWiped:
   132         case EMsgStoreUnavailable:
   133         // The message store has transitioned from an authenticated state to an unauthenticated state.
   133             {
   134         case EMsgStoreNotAuthenticated:
   134             // since the store is unavailabe we are unable to get 
   135             {
   135             // list of mailboxes, setting plugin id only
   136             NotifyGlobalEventL( TFSMailboxUnavailable );
   136             TFSMailMsgId id;
       
   137             id.SetPluginId( TUid::Uid( GetPluginId() ) );
       
   138             NotifyGlobalEventL( TFSMailboxUnavailable, id );
   137             }
   139             }
   138         break;
   140         break;
   139 
   141 
   140         // The backup or restore completed.  The message store is available again.   
   142         // The message store is available again.
   141         case EMsgStoreBackupOrRestoreCompleted:
   143         case EMsgStoreAvailable:
   142         // The message store has transitioned from an unauthenticated state to an authenticated state.
   144             {
   143         case EMsgStoreAuthenticated:
   145             RArray<TFSMailMsgId> mailboxes;
   144             {
   146             CleanupClosePushL( mailboxes );
   145             NotifyGlobalEventL( TFSMailboxAvailable );
   147             ListMailBoxesL( mailboxes );
       
   148 
       
   149             for ( TInt i( 0 ); i < mailboxes.Count(); i++ )
       
   150                 {
       
   151                 NotifyGlobalEventL( TFSMailboxAvailable, mailboxes[i] );
       
   152                 }
       
   153 
       
   154             CleanupStack::PopAndDestroy( &mailboxes );
   146             }
   155             }
   147         break;
   156         break;
   148 
   157 
   149         // The observer event queue has overflowed and has been reset, so events have been lost.  This
   158         // The observer event queue has overflowed and has been reset, so events have been lost.  This
   150         // shouldn't happen unless the client thread has been starved for an extended period of time, during
   159         // shouldn't happen unless the client thread has been starved for an extended period of time, during
   151         // which many message store operations have occurred.
   160         // which many message store operations have occurred.
   152         case EObserverEventQueueOverflow:
   161         case EObserverEventQueueOverflow:
   153         //don't see anything meaningful to do here.
   162         //don't see anything meaningful to do here.
       
   163         default:
   154         break;
   164         break;
   155         };
   165         };
   156     }
   166     }
   157 
   167 
   158 
   168