emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp
branchRCL_3
changeset 17 67369d1b217f
parent 14 b13141f05c3d
child 18 6b8f3b30d0ec
equal deleted inserted replaced
16:b5fbb9b25d57 17:67369d1b217f
    24 #include <centralrepository.h>
    24 #include <centralrepository.h>
    25 #include <emailobserverinterface.hrh>
    25 #include <emailobserverinterface.hrh>
    26 #include <emailobserverplugin.h>
    26 #include <emailobserverplugin.h>
    27 #include <memaildata.h>
    27 #include <memaildata.h>
    28 #include <memailmailboxdata.h>
    28 #include <memailmailboxdata.h>
    29 
    29 #include <e32property.h>
       
    30 #include <connect/sbdefs.h>
    30 #include <scs/cleanuputils.h> // CleanupResetAndDestroyPushL
    31 #include <scs/cleanuputils.h> // CleanupResetAndDestroyPushL
    31 
    32 
    32 #include "emailtrace.h"
    33 #include "emailtrace.h"
    33 #include "cfsmailclient.h"
    34 #include "cfsmailclient.h"
    34 #include "cfsmailbox.h"
    35 #include "cfsmailbox.h"
   332     TInt count = iSettings->WidgetCountByMailbox( aMailbox.Id() );
   333     TInt count = iSettings->WidgetCountByMailbox( aMailbox.Id() );
   333     for (TInt i = 0; i < count; i++ )
   334     for (TInt i = 0; i < count; i++ )
   334         {
   335         {
   335         TBuf<KMaxDescLen> cid;
   336         TBuf<KMaxDescLen> cid;
   336         iSettings->GetContentId( aMailbox.Id(), i + 1, cid );
   337         iSettings->GetContentId( aMailbox.Id(), i + 1, cid );
   337         iLiwIf->SetUpdateNeeded( iLiwIf->GetWidgetInstanceId( cid ), ETrue );
   338         TInt widgetInstance = iLiwIf->GetWidgetInstanceId( cid );
       
   339         if ( widgetInstance != KErrNotFound )
       
   340             {
       
   341             iLiwIf->SetUpdateNeeded( widgetInstance, ETrue );
       
   342             }
   338         }
   343         }
   339     }
   344     }
   340 
   345 
   341 // ---------------------------------------------------------
   346 // ---------------------------------------------------------
   342 // CMailCpsHandler::UpdateFullL
   347 // CMailCpsHandler::UpdateFullL
   837     TAny* aParam2,
   842     TAny* aParam2,
   838     TAny* /*aParam3*/ )
   843     TAny* /*aParam3*/ )
   839     {
   844     {
   840     FUNC_LOG;
   845     FUNC_LOG;
   841 
   846 
   842     // Is the mailbox in our list
   847     // If backup or restore is ongoing ignore all events
       
   848     if ( BackupOrRestoreMode() )
       
   849         {
       
   850         return;
       
   851         }
       
   852     
   843     switch ( aEvent )
   853     switch ( aEvent )
   844         {
   854         {
   845         case TFSEventNewMailbox:
   855         case TFSEventNewMailbox:
   846             {
   856             {
   847             HandleNewMailboxEventL( aMailbox );
   857             HandleNewMailboxEventL( aMailbox );
  1941     HBufC* str( NULL );
  1951     HBufC* str( NULL );
  1942     str = StringLoader::LoadLC( R_EMAILWIDGET_TEXT_HS_PAGE_FULL );
  1952     str = StringLoader::LoadLC( R_EMAILWIDGET_TEXT_HS_PAGE_FULL );
  1943     iQuery->ShowNoteL(EAknGlobalConfirmationNote, str->Des());
  1953     iQuery->ShowNoteL(EAknGlobalConfirmationNote, str->Des());
  1944     CleanupStack::PopAndDestroy( str );    
  1954     CleanupStack::PopAndDestroy( str );    
  1945     }
  1955     }
       
  1956 
       
  1957 // ----------------------------------------------------------------------------
       
  1958 // CMailCpsHandler::BackupOrRestoreMode()
       
  1959 // Check if phone is in backup/restore mode
       
  1960 // ----------------------------------------------------------------------------
       
  1961 //
       
  1962 TBool CMailCpsHandler::BackupOrRestoreMode()
       
  1963     {
       
  1964     FUNC_LOG;
  1946     
  1965     
       
  1966     TBool backupOrRestore = EFalse;
       
  1967     
       
  1968     // Get the back-up restore key, return EFalse if we can't get the key
       
  1969     TInt keyVal = 0;
       
  1970     const TInt error = RProperty::Get(  KUidSystemCategory, conn::KUidBackupRestoreKey, keyVal );
       
  1971     if( error == KErrNone )
       
  1972         {
       
  1973         const conn::TBURPartType partType = 
       
  1974                 static_cast< conn::TBURPartType >( keyVal & conn::KBURPartTypeMask );
       
  1975                 
       
  1976         if ( keyVal != 0 )
       
  1977             {
       
  1978             switch( partType )
       
  1979                 {
       
  1980                 case conn::EBURBackupFull:
       
  1981                 case conn::EBURBackupPartial:
       
  1982                 case conn::EBURRestoreFull:
       
  1983                 case conn::EBURRestorePartial:
       
  1984                     backupOrRestore = ETrue;
       
  1985                     break;
       
  1986                 case conn::EBURUnset:
       
  1987                 case conn::EBURNormal:
       
  1988                 default:
       
  1989                     break;                
       
  1990                 }
       
  1991             }
       
  1992         }
       
  1993     return backupOrRestore;
       
  1994     }