pushmtm/MtmUiSrc/PushMessageInfoDialog.cpp
branchRCL_3
changeset 35 5c11946e75b3
parent 25 92a061761a7b
equal deleted inserted replaced
34:5dedbccec665 35:5c11946e75b3
    37 #include <FeatMgr.h>
    37 #include <FeatMgr.h>
    38 #include <data_caging_path_literals.hrh>
    38 #include <data_caging_path_literals.hrh>
    39 #include <f32file.h>
    39 #include <f32file.h>
    40 #include <AknUtils.h>
    40 #include <AknUtils.h>
    41 #include <AknBidiTextUtils.h>
    41 #include <AknBidiTextUtils.h>
    42 
    42 #include "PushMtmPrivateCRKeys.h"
       
    43 #include <centralrepository.h> 
    43 // CONSTANTS
    44 // CONSTANTS
    44 
       
    45 LOCAL_D const TInt KNoResource = 0;
    45 LOCAL_D const TInt KNoResource = 0;
    46 LOCAL_D const TInt KArrayGranularity = 16;
    46 LOCAL_D const TInt KArrayGranularity = 16;
    47 LOCAL_D const TReal KReal1024 = 1024.0;
    47 LOCAL_D const TReal KReal1024 = 1024.0;
    48 _LIT( KTab, "\t" );
    48 _LIT( KTab, "\t" );
    49 _LIT( KSpace, " " );
    49 _LIT( KSpace, " " );
    89 // ---------------------------------------------------------
    89 // ---------------------------------------------------------
    90 //
    90 //
    91 void CPushMessageInfoDialog::ConstructL( CMsvSession& aMsvSession, TMsvId aId )
    91 void CPushMessageInfoDialog::ConstructL( CMsvSession& aMsvSession, TMsvId aId )
    92     {
    92     {
    93     PUSHLOG_ENTERFN("CPushMessageInfoDialog::ConstructL");
    93     PUSHLOG_ENTERFN("CPushMessageInfoDialog::ConstructL");
    94 
       
    95     __ASSERT_DEBUG( !iListBox &&
    94     __ASSERT_DEBUG( !iListBox &&
    96                     !iListBoxModel,
    95                     !iListBoxModel,
    97                     UiPanic( EPushMtmUiPanAlreadyInitialized ) );
    96                     UiPanic( EPushMtmUiPanAlreadyInitialized ) );
    98 
    97 
    99     FeatureManager::InitializeLibL();
    98     FeatureManager::InitializeLibL();
       
    99     
       
   100     CRepository* PushSL = CRepository::NewL( KCRUidPushMtm );
       
   101     CleanupStack::PushL( PushSL );
       
   102     User::LeaveIfError( PushSL->Get( KPushMtmServiceEnabled , iPushSLEnabled ) );
       
   103     PUSHLOG_WRITE_FORMAT(" iPushSLEnabled: <%d>",iPushSLEnabled);
       
   104     CleanupStack::PopAndDestroy( PushSL ); 
   100 
   105 
   101     // Add resource file.
   106     // Add resource file.
   102     TParse* fileParser = new (ELeave) TParse;
   107     TParse* fileParser = new (ELeave) TParse;
   103     // Unnecessary to call CleanupStack::PushL( fileParser );
   108     // Unnecessary to call CleanupStack::PushL( fileParser );
   104     fileParser->Set( KPushMtmUiResourceFileAndDrive, &KDC_MTM_RESOURCE_DIR, NULL );
   109     fileParser->Set( KPushMtmUiResourceFileAndDrive, &KDC_MTM_RESOURCE_DIR, NULL );
   297     if ( bioType == KUidWapPushMsgSI.iUid )
   302     if ( bioType == KUidWapPushMsgSI.iUid )
   298         {
   303         {
   299         msg = CSIPushMsgEntry::NewL();
   304         msg = CSIPushMsgEntry::NewL();
   300         PUSHLOG_WRITE(" SI");
   305         PUSHLOG_WRITE(" SI");
   301         }
   306         }
   302 #ifdef __SERIES60_PUSH_SL
   307     else if(iPushSLEnabled && bioType == KUidWapPushMsgSL.iUid)
   303     else if ( bioType == KUidWapPushMsgSL.iUid )
       
   304         {
   308         {
   305         msg = CSLPushMsgEntry::NewL();
   309         msg = CSLPushMsgEntry::NewL();
   306         PUSHLOG_WRITE(" SL");
   310         PUSHLOG_WRITE(" SL");
   307         }
   311         }
   308 #endif // __SERIES60_PUSH_SL
       
   309 #ifdef __SERIES60_PUSH_SP
   312 #ifdef __SERIES60_PUSH_SP
   310     else if ( bioType == KUidWapPushMsgUnknown.iUid )
   313     else if ( bioType == KUidWapPushMsgUnknown.iUid )
   311         {
   314         {
   312         msg = CUnknownPushMsgEntry::NewL();
   315         msg = CUnknownPushMsgEntry::NewL();
   313         PUSHLOG_WRITE(" Unknown");
   316         PUSHLOG_WRITE(" Unknown");
   363             PUSHLOG_WRITE(" URL added");
   366             PUSHLOG_WRITE(" URL added");
   364             //
   367             //
   365             CleanupStack::PopAndDestroy( convertedUrl );
   368             CleanupStack::PopAndDestroy( convertedUrl );
   366             }
   369             }
   367         }
   370         }
   368 #ifdef __SERIES60_PUSH_SL
   371     else if ( iPushSLEnabled && msg->PushMsgType() == KUidWapPushMsgSL.iUid )
   369     else if ( msg->PushMsgType() == KUidWapPushMsgSL.iUid )
       
   370         {
   372         {
   371         CSLPushMsgEntry* sl = STATIC_CAST( CSLPushMsgEntry*, msg );
   373         CSLPushMsgEntry* sl = STATIC_CAST( CSLPushMsgEntry*, msg );
   372         const TPtrC url = sl->Url();
   374         const TPtrC url = sl->Url();
   373         if ( url.Length() )
   375         if ( url.Length() )
   374             {
   376             {
   381             PUSHLOG_WRITE(" URL added");
   383             PUSHLOG_WRITE(" URL added");
   382             //
   384             //
   383             CleanupStack::PopAndDestroy( convertedUrl );
   385             CleanupStack::PopAndDestroy( convertedUrl );
   384             }
   386             }
   385         }
   387         }
   386 #endif // __SERIES60_PUSH_SL
       
   387 
   388 
   388     // ************************************************************************
   389     // ************************************************************************
   389     // Information item: Message body/text (SI specific).
   390     // Information item: Message body/text (SI specific).
   390     // ************************************************************************
   391     // ************************************************************************
   391     if ( msg->PushMsgType() == KUidWapPushMsgSI.iUid )
   392     if ( msg->PushMsgType() == KUidWapPushMsgSI.iUid )
   494     if ( msg->PushMsgType() == KUidWapPushMsgSI.iUid )
   495     if ( msg->PushMsgType() == KUidWapPushMsgSI.iUid )
   495         {
   496         {
   496         CSIPushMsgEntry* si = STATIC_CAST( CSIPushMsgEntry*, msg );
   497         CSIPushMsgEntry* si = STATIC_CAST( CSIPushMsgEntry*, msg );
   497         messageSize = (TReal)si->Text().Size() / KReal1024;
   498         messageSize = (TReal)si->Text().Size() / KReal1024;
   498         }
   499         }
   499 #ifdef __SERIES60_PUSH_SL
   500     else if ( iPushSLEnabled && msg->PushMsgType() == KUidWapPushMsgSL.iUid )
   500     else if ( msg->PushMsgType() == KUidWapPushMsgSL.iUid )
       
   501         {
   501         {
   502         CSLPushMsgEntry* sl = STATIC_CAST( CSLPushMsgEntry*, msg );
   502         CSLPushMsgEntry* sl = STATIC_CAST( CSLPushMsgEntry*, msg );
   503         messageSize = (TReal)sl->Url().Size() / KReal1024;
   503         messageSize = (TReal)sl->Url().Size() / KReal1024;
   504         }
   504         }
   505 #endif // __SERIES60_PUSH_SL
       
   506 #ifdef __SERIES60_PUSH_SP
   505 #ifdef __SERIES60_PUSH_SP
   507     else if ( msg->PushMsgType() == KUidWapPushMsgUnknown.iUid )
   506     else if ( msg->PushMsgType() == KUidWapPushMsgUnknown.iUid )
   508         {
   507         {
   509         CUnknownPushMsgEntry* sp = STATIC_CAST( CUnknownPushMsgEntry*, msg );
   508         CUnknownPushMsgEntry* sp = STATIC_CAST( CUnknownPushMsgEntry*, msg );
   510         messageSize = (TReal)sp->MessageData().Size() / KReal1024;
   509         messageSize = (TReal)sp->MessageData().Size() / KReal1024;