appinstaller/AppinstUi/Plugin/CommonUI/Src/CUIDetailsDialog.cpp
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
     1 /*
     1 /*
     2 * Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 
    19 
    20 // INCLUDE FILES
    20 // INCLUDE FILES
    21 //#include <aknmessagequerydialog.h>
    21 #include <aknmessagequerydialog.h>
    22 //#include <aknlistquerydialog.h> // remove
    22 #include <aknlistquerydialog.h> // remove
    23 //#include <StringLoader.h>
    23 #include <StringLoader.h>
    24 #include <bautils.h>
    24 #include <bautils.h>
    25 #include <eikenv.h>
    25 #include <eikenv.h>
    26 #include <data_caging_path_literals.hrh>
    26 #include <data_caging_path_literals.hrh>
    27 #include <SWInstCommonUI.rsg>
    27 #include <SWInstCommonUI.rsg>
    28 #include <pathinfo.h>
    28 #include <pathinfo.h>
    29 //#include <avkon.rsg>
    29 #include <avkon.rsg>
    30 #include <DRMHelper.h>
    30 #include <drmuihandling.h>                  // DRM::CDrmUiHandling
    31 
    31 
    32 #include "CUIDetailsDialog.h"
    32 #include "CUIDetailsDialog.h"
    33 #include "CUICertificateDetailsDialog.h"
    33 #include "CUICertificateDetailsDialog.h"
    34 #include "CUIUtils.h"
    34 #include "CUIUtils.h"
    35 
    35 
    47 // CCUIDetailsDialog::CCUIDetailsDialog
    47 // CCUIDetailsDialog::CCUIDetailsDialog
    48 // C++ default constructor can NOT contain any code, that might leave.
    48 // C++ default constructor can NOT contain any code, that might leave.
    49 // -----------------------------------------------------------------------------
    49 // -----------------------------------------------------------------------------
    50 //
    50 //
    51 CCUIDetailsDialog::CCUIDetailsDialog()
    51 CCUIDetailsDialog::CCUIDetailsDialog()
    52 //    : iCbaResourceId( R_AVKON_SOFTKEYS_OK_EMPTY )
    52     : iCbaResourceId( R_AVKON_SOFTKEYS_OK_EMPTY )
    53     {
    53     {
    54     }
    54     }
    55 
    55 
    56 // -----------------------------------------------------------------------------
    56 // -----------------------------------------------------------------------------
    57 // CCUIDetailsDialog::CCUIDetailsDialog
    57 // CCUIDetailsDialog::CCUIDetailsDialog
   231 // -----------------------------------------------------------------------------
   231 // -----------------------------------------------------------------------------
   232 //
   232 //
   233 TInt CCUIDetailsDialog::ShowDialogL( MCUIInfoIterator& aIterator )
   233 TInt CCUIDetailsDialog::ShowDialogL( MCUIInfoIterator& aIterator )
   234     {
   234     {
   235     TInt result( 0 );
   235     TInt result( 0 );
   236 /*
   236 
   237     CleanupStack::PushL( this );
   237     CleanupStack::PushL( this );
   238 
   238 
   239     PopulateArrayL( aIterator );
   239     PopulateArrayL( aIterator );
   240     HBufC* message = GetMessageDescriptorLC();        
   240     HBufC* message = GetMessageDescriptorLC();        
   241     
   241     
   277         dlg->SetLink( drmCallback );
   277         dlg->SetLink( drmCallback );
   278         }    
   278         }    
   279     
   279     
   280     result = dlg->RunLD();
   280     result = dlg->RunLD();
   281     CleanupStack::PopAndDestroy( 2 ); // message, this
   281     CleanupStack::PopAndDestroy( 2 ); // message, this
   282 */
   282 
   283     return result;    
   283     return result;    
   284     }
   284     }
   285 
   285 
   286 // -----------------------------------------------------------------------------
   286 // -----------------------------------------------------------------------------
   287 // CCUIDetailsDialog::SetFieldL
   287 // CCUIDetailsDialog::SetFieldL
   342 // (other items were commented in a header).
   342 // (other items were commented in a header).
   343 // -----------------------------------------------------------------------------
   343 // -----------------------------------------------------------------------------
   344 //
   344 //
   345 HBufC* CCUIDetailsDialog::GetMessageDescriptorLC()
   345 HBufC* CCUIDetailsDialog::GetMessageDescriptorLC()
   346     {
   346     {
   347     /*
       
   348     TInt size( 0 ); 
   347     TInt size( 0 ); 
   349     TInt index( 0 );
   348     TInt index( 0 );
   350 
   349 
   351     HBufC* type = StringLoader::LoadLC( R_SWCOMMON_DETAIL_TYPE );    
   350     HBufC* type = StringLoader::LoadLC( R_SWCOMMON_DETAIL_TYPE );    
   352     HBufC* typeString = HBufC::NewLC( type->Length() + 1);
   351     HBufC* typeString = HBufC::NewLC( type->Length() + 1);
   379         }    
   378         }    
   380 
   379 
   381     CleanupStack::Pop( message );
   380     CleanupStack::Pop( message );
   382     CleanupStack::PopAndDestroy( 2, type );
   381     CleanupStack::PopAndDestroy( 2, type );
   383     CleanupStack::PushL( message );    
   382     CleanupStack::PushL( message );    
   384    
   383 
   385     return message;
   384     return message;    
   386     */
       
   387     return NULL;
       
   388     }
   385     }
   389 
   386 
   390 // -----------------------------------------------------------------------------
   387 // -----------------------------------------------------------------------------
   391 // CCUIDetailsDialog::AddCertificatesLC
   388 // CCUIDetailsDialog::AddCertificatesLC
   392 // Helper to add certificate information to query text.
   389 // Helper to add certificate information to query text.
   393 // (other items were commented in a header).
   390 // (other items were commented in a header).
   394 // -----------------------------------------------------------------------------
   391 // -----------------------------------------------------------------------------
   395 //
   392 //
   396 void CCUIDetailsDialog::AddCertificatesLC( HBufC*& aMessage )
   393 void CCUIDetailsDialog::AddCertificatesLC( HBufC*& aMessage )
   397     {
   394     {
   398     /*
       
   399     HBufC* certHeading = StringLoader::LoadLC( R_SWCOMMON_DETAIL_CERTIFICATES );
   395     HBufC* certHeading = StringLoader::LoadLC( R_SWCOMMON_DETAIL_CERTIFICATES );
   400     HBufC* certificateLink = LoadLinkLC( R_SWCOMMON_DETAIL_VALUE_VIEW_CERT );
   396     HBufC* certificateLink = LoadLinkLC( R_SWCOMMON_DETAIL_VALUE_VIEW_CERT );
   401     HBufC* newString = HBufC::NewL( certHeading->Length() + 
   397     HBufC* newString = HBufC::NewL( certHeading->Length() + 
   402                                     aMessage->Length() + 
   398                                     aMessage->Length() + 
   403                                     certificateLink->Length() + 
   399                                     certificateLink->Length() + 
   413    
   409    
   414     CleanupStack::PopAndDestroy( 3, aMessage );
   410     CleanupStack::PopAndDestroy( 3, aMessage );
   415   
   411   
   416     aMessage = newString;
   412     aMessage = newString;
   417     CleanupStack::PushL( aMessage ); 
   413     CleanupStack::PushL( aMessage ); 
   418     */
       
   419     }
   414     }
   420 
   415 
   421 // -----------------------------------------------------------------------------
   416 // -----------------------------------------------------------------------------
   422 // CCUIDetailsDialog::AddDrmLC
   417 // CCUIDetailsDialog::AddDrmLC
   423 // Helper to add DRM information to query text.
   418 // Helper to add DRM information to query text.
   424 // (other items were commented in a header).
   419 // (other items were commented in a header).
   425 // -----------------------------------------------------------------------------
   420 // -----------------------------------------------------------------------------
   426 //
   421 //
   427 void CCUIDetailsDialog::AddDrmLC( HBufC*& aMessage )
   422 void CCUIDetailsDialog::AddDrmLC( HBufC*& aMessage )
   428     {
   423     {
   429     /*
       
   430     HBufC* drmHeading = StringLoader::LoadLC( R_SWCOMMON_DETAIL_DRM );
   424     HBufC* drmHeading = StringLoader::LoadLC( R_SWCOMMON_DETAIL_DRM );
   431     HBufC* drmLink = LoadLinkLC( R_SWCOMMON_DETAIL_VALUE_VIEW_DRM );
   425     HBufC* drmLink = LoadLinkLC( R_SWCOMMON_DETAIL_VALUE_VIEW_DRM );
   432     HBufC* newString = HBufC::NewL( drmHeading->Length() + 
   426     HBufC* newString = HBufC::NewL( drmHeading->Length() + 
   433                                     aMessage->Length() + 
   427                                     aMessage->Length() + 
   434                                     drmLink->Length() + 
   428                                     drmLink->Length() + 
   444     
   438     
   445     CleanupStack::PopAndDestroy( 3, aMessage );
   439     CleanupStack::PopAndDestroy( 3, aMessage );
   446   
   440   
   447     aMessage = newString;
   441     aMessage = newString;
   448     CleanupStack::PushL( aMessage ); 
   442     CleanupStack::PushL( aMessage ); 
   449     */
       
   450     }
   443     }
   451 
   444 
   452 // -----------------------------------------------------------------------------
   445 // -----------------------------------------------------------------------------
   453 // CCUIDetailsDialog::ShowCertificates
   446 // CCUIDetailsDialog::ShowCertificates
   454 // Used as a callback function in message query.
   447 // Used as a callback function in message query.
   483 // (other items were commented in a header).
   476 // (other items were commented in a header).
   484 // -----------------------------------------------------------------------------
   477 // -----------------------------------------------------------------------------
   485 //
   478 //
   486 void CCUIDetailsDialog::DoShowCertificatesL()
   479 void CCUIDetailsDialog::DoShowCertificatesL()
   487     {
   480     {
   488     /*
       
   489     if ( iCommonCertificates.Count() > 1 )
   481     if ( iCommonCertificates.Count() > 1 )
   490         {
   482         {
   491         CDesCArrayFlat *itemArray = new( ELeave ) CDesCArrayFlat( 2 );
   483         CDesCArrayFlat *itemArray = new( ELeave ) CDesCArrayFlat( 2 );
   492         CleanupStack::PushL( itemArray );
   484         CleanupStack::PushL( itemArray );
   493 
   485 
   526         {
   518         {
   527         CCUICertificateDetailsDialog* certDlg = 
   519         CCUICertificateDetailsDialog* certDlg = 
   528             CCUICertificateDetailsDialog::NewL();
   520             CCUICertificateDetailsDialog::NewL();
   529                 
   521                 
   530         certDlg->ExecuteLD( *( iCommonCertificates[0] ) );    
   522         certDlg->ExecuteLD( *( iCommonCertificates[0] ) );    
   531         }  
   523         }    
   532     */      
       
   533     }
   524     }
   534 
   525 
   535 // -----------------------------------------------------------------------------
   526 // -----------------------------------------------------------------------------
   536 // CCUIDetailsDialog::DoShowDrmL
   527 // CCUIDetailsDialog::DoShowDrmL
   537 // Show detailed drm info.
   528 // Show detailed drm info.
   538 // (other items were commented in a header).
   529 // (other items were commented in a header).
   539 // -----------------------------------------------------------------------------
   530 // -----------------------------------------------------------------------------
   540 //
   531 //
   541 void CCUIDetailsDialog::DoShowDrmL()
   532 void CCUIDetailsDialog::DoShowDrmL()
   542     {
   533     {
   543     CDRMHelper* helper = CDRMHelper::NewLC( *iCoeEnv );
   534     DRM::CDrmUiHandling *drmUiHandler = DRM::CDrmUiHandling::NewLC();
   544     helper->LaunchDetailsViewEmbeddedL( iFile );   
   535     drmUiHandler->ShowDetailsViewL( iFile );
   545     CleanupStack::PopAndDestroy( helper );    
   536     CleanupStack::PopAndDestroy( drmUiHandler );
   546     }
   537     }
   547 
   538 
   548 // -----------------------------------------------------------------------------
   539 // -----------------------------------------------------------------------------
   549 // CCUIDetailsDialog::LoadLinkLC
   540 // CCUIDetailsDialog::LoadLinkLC
   550 // Helper to construct a message query link from resource string.
   541 // Helper to construct a message query link from resource string.
   551 // (other items were commented in a header).
   542 // (other items were commented in a header).
   552 // -----------------------------------------------------------------------------
   543 // -----------------------------------------------------------------------------
   553 //
   544 //
   554 HBufC* CCUIDetailsDialog::LoadLinkLC( TInt aResourceId )
   545 HBufC* CCUIDetailsDialog::LoadLinkLC( TInt aResourceId )
   555     {
   546     {
   556     /*
       
   557     HBufC* link = StringLoader::LoadLC( aResourceId );
   547     HBufC* link = StringLoader::LoadLC( aResourceId );
   558     HBufC* tmp = link->ReAllocL( link->Length() + KLinkTagOpen().Length() + KLinkTagClose().Length() );
   548     HBufC* tmp = link->ReAllocL( link->Length() + KLinkTagOpen().Length() + KLinkTagClose().Length() );
   559     
   549     
   560     CleanupStack::Pop( link );
   550     CleanupStack::Pop( link );
   561     link = tmp;
   551     link = tmp;
   562     CleanupStack::PushL( link );
   552     CleanupStack::PushL( link );
   563     
   553     
   564     link->Des().Insert(0, KLinkTagOpen);
   554     link->Des().Insert(0, KLinkTagOpen);
   565     link->Des().Append( KLinkTagClose );   
   555     link->Des().Append( KLinkTagClose );   
   566 
   556 
   567     return link;   
   557     return link;    
   568     */ 
       
   569     return NULL;
       
   570     }
   558     }
   571 
   559 
   572 //  End of File  
   560 //  End of File