emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp
branchRCL_3
changeset 80 726fba06891a
parent 64 3533d4323edc
equal deleted inserted replaced
73:c8382f7b54ef 80:726fba06891a
    41 #include "cmailcpsifconsts.h"
    41 #include "cmailcpsifconsts.h"
    42 #include "FreestyleEmailUiConstants.h"
    42 #include "FreestyleEmailUiConstants.h"
    43 #include "cmailpluginproxy.h"
    43 #include "cmailpluginproxy.h"
    44 #include "cmailhandlerpluginpanic.h"
    44 #include "cmailhandlerpluginpanic.h"
    45 
    45 
    46 #include "fsemailserverpskeys.h"
       
    47 
       
    48 using namespace EmailInterface;
    46 using namespace EmailInterface;
    49 
    47 
    50 // ---------------------------------------------------------
    48 // ---------------------------------------------------------
    51 // CMailCpsHandler::CMailCpsHandler
    49 // CMailCpsHandler::CMailCpsHandler
    52 // ---------------------------------------------------------
    50 // ---------------------------------------------------------
    98 
    96 
    99     InitializeL();
    97     InitializeL();
   100     InitializeExternalAccountsL();
    98     InitializeExternalAccountsL();
   101 
    99 
   102     iSettings->StartObservingL( this );
   100     iSettings->StartObservingL( this );
   103 
       
   104     TInt err = RProperty::Define( KPSUidEmailServerCategory, 
       
   105                                   KIntMailboxCount, 
       
   106                                   RProperty::EInt );
       
   107     if ( err != KErrAlreadyExists && err != KErrNone )
       
   108         {
       
   109         User::LeaveIfError( err );
       
   110         }
       
   111     
       
   112     // set mailbox initial count 
       
   113     TInt intCount = TotalIntMailboxCount();
       
   114     User::LeaveIfError( RProperty::Set( KPSUidEmailServerCategory, KIntMailboxCount, intCount ) );
       
   115     }
   101     }
   116 
   102 
   117 // ---------------------------------------------------------
   103 // ---------------------------------------------------------
   118 // CMailCpsHandler::~CMailCpsHandler
   104 // CMailCpsHandler::~CMailCpsHandler
   119 // ---------------------------------------------------------
   105 // ---------------------------------------------------------
   482             if ( unreadCount > 0 )
   468             if ( unreadCount > 0 )
   483                 {
   469                 {
   484                 // Use localisation format when displaying also unread messages
   470                 // Use localisation format when displaying also unread messages
   485 
   471 
   486                 // Arrays must be used when loc string contains indexed parameters
   472                 // Arrays must be used when loc string contains indexed parameters
   487                 CDesCArrayFlat* strings = new( ELeave) CDesCArrayFlat( 1 );
   473                 CDesCArrayFlat* strings = new CDesCArrayFlat( 1 );
   488                 CleanupStack::PushL( strings );
   474                 CleanupStack::PushL( strings );
   489                 strings->AppendL( accountName ); // replace "%0U" with mailbox name
   475                 strings->AppendL( accountName ); // replace "%0U" with mailbox name
   490 
   476 
   491                 CArrayFix<TInt>* ints = new(ELeave) CArrayFixFlat<TInt>( 1 );
   477                 CArrayFix<TInt>* ints = new(ELeave) CArrayFixFlat<TInt>( 1 );
   492                 CleanupStack::PushL( ints );
   478                 CleanupStack::PushL( ints );
   943         }
   929         }
   944     else
   930     else
   945         {
   931         {
   946         iLiwIf->AddWidgetToHomescreenL( aMailbox );
   932         iLiwIf->AddWidgetToHomescreenL( aMailbox );
   947         }
   933         }
   948 
       
   949     // update total mailbox count. 
       
   950     TInt intCount = TotalIntMailboxCount();
       
   951     User::LeaveIfError( RProperty::Set( KPSUidEmailServerCategory, KIntMailboxCount, intCount ) );
       
   952     }
   934     }
   953 
   935 
   954 // ---------------------------------------------------------
   936 // ---------------------------------------------------------
   955 // CMailCpsHandler::HandleMailboxRenamedEventL
   937 // CMailCpsHandler::HandleMailboxRenamedEventL
   956 // ---------------------------------------------------------
   938 // ---------------------------------------------------------
   996             iSettings->RemoveMailboxL( aMailbox );
   978             iSettings->RemoveMailboxL( aMailbox );
   997             iSettings->ToggleWidgetNewMailIconL( EFalse, aMailbox );
   979             iSettings->ToggleWidgetNewMailIconL( EFalse, aMailbox );
   998             break;
   980             break;
   999             }
   981             }
  1000         }
   982         }
  1001     // update total mailbox count. 
       
  1002     TInt intCount = TotalIntMailboxCount();
       
  1003     User::LeaveIfError( RProperty::Set( KPSUidEmailServerCategory, KIntMailboxCount, intCount ) );
       
  1004     }
   983     }
  1005 
   984 
  1006 
   985 
  1007 // ---------------------------------------------------------
   986 // ---------------------------------------------------------
  1008 // CMailCpsHandler::GetUnreadCountL
   987 // CMailCpsHandler::GetUnreadCountL
  1822     iQuery->ShowNoteL(EAknGlobalConfirmationNote, str->Des());
  1801     iQuery->ShowNoteL(EAknGlobalConfirmationNote, str->Des());
  1823     CleanupStack::PopAndDestroy( str );    
  1802     CleanupStack::PopAndDestroy( str );    
  1824     }
  1803     }
  1825 
  1804 
  1826 // ----------------------------------------------------------------------------
  1805 // ----------------------------------------------------------------------------
       
  1806 // CMailCpsHandler::GetWidgetSetupBrandIconVariant()
       
  1807 // Get widget setup brand icon variant
       
  1808 // ----------------------------------------------------------------------------
       
  1809 //
       
  1810 TInt CMailCpsHandler::GetWidgetSetupBrandIconVariant()
       
  1811     {
       
  1812     FUNC_LOG;
       
  1813     return iSettings->GetWidgetSetupBrandIconVariant();
       
  1814     }
       
  1815 
       
  1816 // ----------------------------------------------------------------------------
  1827 // class CMailCpsUpdateHelper : public CTimer
  1817 // class CMailCpsUpdateHelper : public CTimer
  1828 // Used to limit the rate of updates to Homescreen widget
  1818 // Used to limit the rate of updates to Homescreen widget
  1829 // ----------------------------------------------------------------------------
  1819 // ----------------------------------------------------------------------------
  1830 //
  1820 //
  1831 
  1821