commondrm/drmutility/src/DrmUiHandlingImpl.cpp
changeset 49 69d8e75812b7
parent 29 3bdc3b853094
child 84 b09186059647
equal deleted inserted replaced
48:c68061d56109 49:69d8e75812b7
    36 // launching embedded details view
    36 // launching embedded details view
    37 #include <AknLaunchAppService.h>
    37 #include <AknLaunchAppService.h>
    38 #include <AiwGenericParam.h>
    38 #include <AiwGenericParam.h>
    39 #include <apgcli.h>
    39 #include <apgcli.h>
    40 
    40 
       
    41 // DCF repository
       
    42 #include <DcfRep.h>
       
    43 #include <DcfEntry.h>
       
    44 
    41 // character conversions
    45 // character conversions
    42 #include <utf.h>
    46 #include <utf.h>
    43 
       
    44 // handling urls
       
    45 #include <SchemeHandler.h>
       
    46 
    47 
    47 // resources
    48 // resources
    48 #include <data_caging_path_literals.hrh>
    49 #include <data_caging_path_literals.hrh>
    49 #include <drmutility.rsg>
    50 #include <drmutility.rsg>
    50 
    51 
    56 #include <DRMRightsClient.h>
    57 #include <DRMRightsClient.h>
    57 #include <drmutility.h>
    58 #include <drmutility.h>
    58 #include <drmutilitytypes.h>
    59 #include <drmutilitytypes.h>
    59 #include <drmasyncobserver.h>
    60 #include <drmasyncobserver.h>
    60 #include <drmhandleerrorobserver.h>
    61 #include <drmhandleerrorobserver.h>
       
    62 #include <drmbrowserlauncher.h>
    61 
    63 
    62 //connectivity logic
    64 //connectivity logic
    63 #include <cmconnectionmethod.h> // RCmConnectionMethod
    65 #include <cmconnectionmethod.h> // RCmConnectionMethod
    64 #include <cmdestination.h> // RCmDestination
    66 #include <cmdestination.h> // RCmDestination
    65 #include <cmmanager.h> // RCmManager
    67 #include <cmmanager.h> // RCmManager
    85 #include "drmsettingsplugininternalcrkeys.h"
    87 #include "drmsettingsplugininternalcrkeys.h"
    86 #include "DRMRIContext.h"
    88 #include "DRMRIContext.h"
    87 #include "DRMDomainContext.h"
    89 #include "DRMDomainContext.h"
    88 
    90 
    89 #include "DrmUtilityInternalcrkeys.h"      // Cenrep extension for OmaBased
    91 #include "DrmUtilityInternalcrkeys.h"      // Cenrep extension for OmaBased
       
    92 #include "drmuidialogids.h"
    90 
    93 
    91 // CONSTANTS
    94 // CONSTANTS
    92 const TInt KCommandHandleErrorFile( 1 );
    95 const TInt KCommandHandleErrorFile( 1 );
    93 const TInt KCommandHandleErrorData( 2 );
    96 const TInt KCommandHandleErrorData( 2 );
    94 const TInt KCommandCheckRightsAmountFile( 3 );
    97 const TInt KCommandCheckRightsAmountFile( 3 );
   117 
   120 
   118 const TInt KCenRepDataLength( 50 );
   121 const TInt KCenRepDataLength( 50 );
   119 
   122 
   120 const TInt KresOmaBasedBuf( 512 );
   123 const TInt KresOmaBasedBuf( 512 );
   121 const TInt KNameBuf( 256 );
   124 const TInt KNameBuf( 256 );
       
   125 const TInt KNoValue = -1;
       
   126 
   122 #ifdef _DEBUG
   127 #ifdef _DEBUG
   123 // debug panic
   128 // debug panic
   124 _LIT( KDRMUtilityDebugPanicMessage, "DrmUiHandlingDebugPanic" );
   129 _LIT( KDRMUtilityDebugPanicMessage, "DrmUiHandlingDebugPanic" );
   125 const TInt KDRMUtilityDebugPanicCode( 1 );
   130 const TInt KDRMUtilityDebugPanicCode( 1 );
   126 #endif
   131 #endif
   212     TRAP_IGNORE( found = HasDefaultConnectionL() );
   217     TRAP_IGNORE( found = HasDefaultConnectionL() );
   213 
   218 
   214     return found;
   219     return found;
   215     }
   220     }
   216 
   221 
       
   222 // ---------------------------------------------------------
       
   223 // UpdateDCFRepositoryL()
       
   224 // Update saved file to DCFRepository
       
   225 // ---------------------------------------------------------
       
   226 
       
   227 LOCAL_C void UpdateDCFRepositoryL( TDesC& aFullFileName )
       
   228     {
       
   229     CDcfEntry* dcfEntry( NULL );
       
   230     CDcfRep* dcfRep( NULL );
       
   231     
       
   232     dcfEntry = CDcfEntry::NewL();
       
   233     CleanupStack::PushL( dcfEntry );
       
   234 
       
   235     dcfRep = CDcfRep::NewL();
       
   236     CleanupStack::PushL( dcfRep );
       
   237 
       
   238     dcfEntry->SetLocationL( aFullFileName, 0 );
       
   239     dcfRep->UpdateL( dcfEntry );
       
   240     CleanupStack::PopAndDestroy( dcfRep );
       
   241     CleanupStack::PopAndDestroy( dcfEntry );
       
   242     }
       
   243 
       
   244 // ---------------------------------------------------------
       
   245 // FindFullFileNameAndUpdateDCFRepositoryL()
       
   246 // Find full file name for the content and update saved 
       
   247 // file to DCFRepository
       
   248 // ---------------------------------------------------------
       
   249 
       
   250 LOCAL_C void FindFullFileNameAndUpdateDCFRepositoryL(
       
   251     const RFile& aFileHandle )
       
   252     {
       
   253     HBufC* fullPath( NULL );
       
   254     TPtr fullPathPtr( NULL, 0 );
       
   255         
       
   256     fullPath = HBufC::NewLC( KUrlMaxLen );
       
   257     fullPathPtr.Set( fullPath->Des() );
       
   258     
       
   259     aFileHandle.FullName( fullPathPtr );
       
   260     UpdateDCFRepositoryL( fullPathPtr );
       
   261     CleanupStack::PopAndDestroy( fullPath );
       
   262     }
       
   263 
       
   264 // ---------------------------------------------------------
       
   265 // FindFullFileNameAndUpdateDCFRepositoryL()
       
   266 // Find full file name for the content and update saved 
       
   267 // file to DCFRepository
       
   268 // ---------------------------------------------------------
       
   269 
       
   270 LOCAL_C void FindFullFileNameAndUpdateDCFRepositoryL(
       
   271     const ContentAccess::CData& aFileData  )
       
   272     {
       
   273     HBufC* fullPath( NULL );
       
   274     TPtr fullPathPtr( NULL, 0 );
       
   275     
       
   276     fullPath = HBufC::NewLC( KUrlMaxLen );
       
   277     fullPathPtr.Set( fullPath->Des() );
       
   278                 
       
   279     aFileData.GetStringAttribute( DRM::EDrmFullName, 
       
   280         fullPathPtr );
       
   281     
       
   282     UpdateDCFRepositoryL( fullPathPtr );
       
   283     CleanupStack::PopAndDestroy( fullPath );    
       
   284     }
   217 
   285 
   218 // ============================ MEMBER FUNCTIONS ===============================
   286 // ============================ MEMBER FUNCTIONS ===============================
   219 
   287 
   220 // -----------------------------------------------------------------------------
   288 // -----------------------------------------------------------------------------
   221 // CDrmUiHandlingImpl::CDrmUiHandlingImpl
   289 // CDrmUiHandlingImpl::CDrmUiHandlingImpl
   366         }
   434         }
   367 
   435 
   368     delete iDrmUtilityCommon;
   436     delete iDrmUtilityCommon;
   369 
   437 
   370     delete iDrmUtilityUi;
   438     delete iDrmUtilityUi;
   371 
       
   372     delete iSchemeHandler;
       
   373 
   439 
   374     delete iWrapperLoader;
   440     delete iWrapperLoader;
   375 
   441 
   376     delete iOmaBasedAgentName;
   442     delete iOmaBasedAgentName;
   377 
   443 
  1453         ContentAccess::EPeek );
  1519         ContentAccess::EPeek );
  1454 
  1520 
  1455     if ( ( !agent.Compare( DRM::KDrmOmaAgentName ) ) || ( iOmaBasedAgentName
  1521     if ( ( !agent.Compare( DRM::KDrmOmaAgentName ) ) || ( iOmaBasedAgentName
  1456         && !agent.Compare( *iOmaBasedAgentName ) ) )
  1522         && !agent.Compare( *iOmaBasedAgentName ) ) )
  1457         {
  1523         {
       
  1524         // To embed Domain RO in superdistribution case, register the content
       
  1525         TRAP_IGNORE( FindFullFileNameAndUpdateDCFRepositoryL( *aData.iFile ) );
       
  1526         
  1458         HandleOmaErrorL( *content, aData.iIntent, aData.iError,
  1527         HandleOmaErrorL( *content, aData.iIntent, aData.iError,
  1459             aData.iErrorObserver, aData.iOperationId );
  1528             aData.iErrorObserver, aData.iOperationId );
  1460         }
  1529         }
  1461 
  1530 
  1462     else if ( !agent.Compare( DRM::KDrmWMAgentName ) && iWmClient )
  1531     else if ( !agent.Compare( DRM::KDrmWMAgentName ) && iWmClient )
  1474 // -----------------------------------------------------------------------------
  1543 // -----------------------------------------------------------------------------
  1475 //
  1544 //
  1476 void DRM::CDrmUiHandlingImpl::PerformHandleErrorDataL(
  1545 void DRM::CDrmUiHandlingImpl::PerformHandleErrorDataL(
  1477     DRM::CDrmUiHandlingData& aData )
  1546     DRM::CDrmUiHandlingData& aData )
  1478     {
  1547     {
       
  1548     
  1479     DRM::TDrmAgentUid agentUid( DRM::EDrmOmaAgent );
  1549     DRM::TDrmAgentUid agentUid( DRM::EDrmOmaAgent );
  1480     IsProtectedL( aData.iFileData, agentUid );
  1550     IsProtectedL( aData.iFileData, agentUid );
  1481     IsProperErrorL( aData.iError );
  1551     IsProperErrorL( aData.iError );
  1482 
  1552 
  1483     // *** WMDRM
  1553     // *** WMDRM
  1484     switch ( agentUid )
  1554     switch ( agentUid )
  1485         {
  1555         {
  1486         case DRM::EDrmOmaAgent:
  1556         case DRM::EDrmOmaAgent:
  1487 
  1557             
       
  1558             // To embed Domain RO in superdistribution case, register the content
       
  1559             TRAP_IGNORE( FindFullFileNameAndUpdateDCFRepositoryL( 
       
  1560                 *aData.iFileData ) );
       
  1561             
  1488             HandleOmaErrorL( *aData.iFileData, aData.iIntent, aData.iError,
  1562             HandleOmaErrorL( *aData.iFileData, aData.iIntent, aData.iError,
  1489                 aData.iErrorObserver, aData.iOperationId );
  1563                 aData.iErrorObserver, aData.iOperationId );
  1490 
  1564 
  1491             break;
  1565             break;
  1492 
  1566 
  1590     HBufC8* contentId( NULL );
  1664     HBufC8* contentId( NULL );
  1591     HBufC8* silentUrl( NULL );
  1665     HBufC8* silentUrl( NULL );
  1592     HBufC* riUrl( NULL );
  1666     HBufC* riUrl( NULL );
  1593     HBufC* domainRiUrl( NULL );
  1667     HBufC* domainRiUrl( NULL );
  1594     DRM::TDrmUiUrlType urlType( DRM::EUHRightsIssuerUrl );
  1668     DRM::TDrmUiUrlType urlType( DRM::EUHRightsIssuerUrl );
  1595 
  1669             
       
  1670     // To embed Domain RO in superdistribution case, register the content
       
  1671     TRAP_IGNORE( FindFullFileNameAndUpdateDCFRepositoryL( aContent ) );
       
  1672     
  1596     User::LeaveIfError( GetContentIdLC( aContent, contentId ) );
  1673     User::LeaveIfError( GetContentIdLC( aContent, contentId ) );
  1597     GetOmaSilentRightsUrlLC( aContent, silentUrl );
  1674     GetOmaSilentRightsUrlLC( aContent, silentUrl );
  1598     GetOmaRightsIssuerLC( aContent, riUrl );
  1675     GetOmaRightsIssuerLC( aContent, riUrl );
  1599     GetOmaDomainRightsIssuerLC( aContent, domainRiUrl );
  1676     GetOmaDomainRightsIssuerLC( aContent, domainRiUrl );
  1600     SelectOmaRightsUrlL( aContent, domainRiUrl, urlType );
  1677     SelectOmaRightsUrlL( aContent, domainRiUrl, urlType );
  1747     DRM::TDrmRightsInfo rightsStatus( DRM::EURightsInfoValid );
  1824     DRM::TDrmRightsInfo rightsStatus( DRM::EURightsInfoValid );
  1748     DRM::TDrmUiUrlType urlType( DRM::EUHRightsIssuerUrl );
  1825     DRM::TDrmUiUrlType urlType( DRM::EUHRightsIssuerUrl );
  1749     TInt previewType( ContentAccess::ENoPreview );
  1826     TInt previewType( ContentAccess::ENoPreview );
  1750     TUint32 reason( 0 );
  1827     TUint32 reason( 0 );
  1751     TBool handled( EFalse );
  1828     TBool handled( EFalse );
  1752 
  1829     
  1753     User::LeaveIfError( GetContentIdLC( aContent, contentId ) );
  1830     User::LeaveIfError( GetContentIdLC( aContent, contentId ) );
  1754 
  1831 
  1755     // Check that this really is an error situation
  1832     // Check that this really is an error situation
  1756     omaError = iOmaClient.CheckRights( aIntent, *contentId, reason );
  1833     omaError = iOmaClient.CheckRights( aIntent, *contentId, reason );
  1757 
  1834 
  1758     // Show that only reason for error was rejected metering.
  1835     // Show that only reason for error was rejected metering.
  1759     TBool onlyMeteringRejection( reason == DRM::EURejectionMetering );
  1836     TBool onlyMeteringRejection( reason == DRM::EURejectionMetering );
  1760     if ( onlyMeteringRejection )
  1837     if ( onlyMeteringRejection )
  1761         {
  1838         {
  1762         iDrmUtilityUi->DisplayQueryWithIdL( R_DRM_QUERY_METERING_DISABLED,
  1839         // Qt dialog not implemented yet
  1763             R_DRMUTILITY_WAITING_RIGHTS_CONFIRMATION_QUERY );
  1840         iDrmUtilityUi->DisplayNoteL( EConfUnableToOpen );
  1764 
  1841 
  1765         CleanupStack::PopAndDestroy( contentId );
  1842         CleanupStack::PopAndDestroy( contentId );
  1766         return;
  1843         return;
  1767         }
  1844         }
  1768 
  1845 
  2889         case DRM::EUHCheckRightsActionDefault:
  2966         case DRM::EUHCheckRightsActionDefault:
  2890             {
  2967             {
  2891             if ( RejectReason( aReason ) == DRM::EURejectionMetering )
  2968             if ( RejectReason( aReason ) == DRM::EURejectionMetering )
  2892                 {
  2969                 {
  2893                 // Show that only reason for error was rejected metering.
  2970                 // Show that only reason for error was rejected metering.
  2894                 iDrmUtilityUi->DisplayQueryWithIdL(
  2971                 // Qt dialog not implemented yet
  2895                     R_DRM_QUERY_METERING_DISABLED,
  2972                 iDrmUtilityUi->DisplayNoteL( EConfUnableToOpen );
  2896                     R_DRMUTILITY_WAITING_RIGHTS_CONFIRMATION_QUERY );
       
  2897                 }
  2973                 }
  2898             else
  2974             else
  2899                 {
  2975                 {
  2900                 if ( !GetSilentAndCallL( aObserver, aOperationId, aIntent,
  2976                 if ( !GetSilentAndCallL( aObserver, aOperationId, aIntent,
  2901                     aContentUri, aSilentUrl, ETrue ) )
  2977                     aContentUri, aSilentUrl, ETrue ) )
  3412     TInt aError )
  3488     TInt aError )
  3413     {
  3489     {
  3414     HBufC* etaBuf( NULL );
  3490     HBufC* etaBuf( NULL );
  3415     TBool isRegistered( EFalse );
  3491     TBool isRegistered( EFalse );
  3416     TBool isJoined( EFalse );
  3492     TBool isJoined( EFalse );
  3417     TInt ret( 0 );
  3493     TInt ret( ECancelled );
  3418     TInt err( KErrNone );
  3494     TInt err( KErrNone );
  3419     TInt eta( 0 );
  3495     TInt eta( 0 );
  3420     TFileName fileName;
  3496     TFileName fileName;
  3421     TBool rightsRenewalWanted( EFalse );
  3497     TBool rightsRenewalWanted( EFalse );
  3422 
  3498 
  3438         if ( !err && aError == EPendingRights && eta == -1 )
  3514         if ( !err && aError == EPendingRights && eta == -1 )
  3439             {
  3515             {
  3440             // rights should have come already
  3516             // rights should have come already
  3441             if ( aRightsUrl )
  3517             if ( aRightsUrl )
  3442                 {
  3518                 {
  3443                 ret = iDrmUtilityUi->DisplayQueryWithIdL(
  3519                 ret = iDrmUtilityUi->DisplayQueryL( EQueryGetNewLicence, KNoValue );
  3444                     R_DRMUTILITY_RIGHTS_SHOULD_HAVE_COME,
       
  3445                     R_DRMUTILITY_CONFIRMATION_QUERY );
       
  3446                 }
  3520                 }
  3447             else
  3521             else
  3448                 {
  3522                 {
  3449                 // no rights issuer
  3523                 // no rights issuer
  3450                 iDrmUtilityUi->DisplayQueryWithIdL(
  3524                 // Qt dialog not implemented yet
  3451                     R_DRMUTILITY_RIGHTS_SHOULD_HAVE_COME_NO_RI,
  3525                 iDrmUtilityUi->DisplayNoteL( EConfLicenceNotReceived );
  3452                     R_DRMUTILITY_WAITING_RIGHTS_CONFIRMATION_QUERY );
       
  3453                 }
  3526                 }
  3454             }
  3527             }
  3455         else if ( !eta || err || eta == -1 )
  3528         else if ( !eta || err || eta == -1 )
  3456             {
  3529             {
  3457             // rights not expected to arrive
  3530             // rights not expected to arrive
  3461                     isJoined );
  3534                     isJoined );
  3462                 }
  3535                 }
  3463 
  3536 
  3464             if ( aRightsUrl && isRegistered && !isJoined ) // Domain ro case
  3537             if ( aRightsUrl && isRegistered && !isJoined ) // Domain ro case
  3465                 {
  3538                 {
  3466                 ret = iDrmUtilityUi->DisplayQueryWithIdL(
  3539                 ret = iDrmUtilityUi->DisplayQueryL( EQueryAccountUpdate, KNoValue );
  3467                     R_DRMUTILITY_ACTIVATE_ACCOUNT,
       
  3468                     R_DRMUTILITY_CONFIRMATION_QUERY );
       
  3469                 }
  3540                 }
  3470             else if ( aRightsUrl ) // Device ro case
  3541             else if ( aRightsUrl ) // Device ro case
  3471                 {
  3542                 {
  3472                 if ( aReason & EConstraintIndividual )
  3543                 if ( aReason & EConstraintIndividual )
  3473                     {
  3544                     {
  3474                     ret = iDrmUtilityUi->DisplayQueryWithIdL(
  3545                     ret = iDrmUtilityUi->DisplayQueryL( EQueryFileLockedForSim, KNoValue );
  3475                         R_DRMUTILITY_INVALID_SIM,
       
  3476                         R_DRMUTILITY_CONFIRMATION_QUERY );
       
  3477                     }
  3546                     }
  3478                 else
  3547                 else
  3479                     {
  3548                     {
  3480                     // get filename
  3549                     // get filename
  3481                     User::LeaveIfError( aContent.GetStringAttribute(
  3550                     User::LeaveIfError( aContent.GetStringAttribute(
  3482                         EFileName, fileName ) );
  3551                         EFileName, fileName ) );
  3483 
  3552 
  3484                     ret = iDrmUtilityUi->DisplayQueryL(
  3553                     // Qt dialog not implemented yet
  3485                         R_DRM_QUERY_EXPIRED_OR_NO_RO, fileName );
  3554                     ret = iDrmUtilityUi->DisplayQueryL( EQueryFileWithNoRightsObj, fileName );
  3486                     }
  3555                     }
  3487                 }
  3556                 }
  3488             else // no rights issuer
  3557             else // no rights issuer
  3489                 {
  3558                 {
  3490                 if ( aReason & EConstraintIndividual )
  3559                 if ( aReason & EConstraintIndividual )
  3491                     {
  3560                     {
  3492                     iDrmUtilityUi->DisplayNoteL( R_DRM_INFO_SIM_NOT_ALLOWED );
  3561                     // Qt dialog not implemented yet
       
  3562                     iDrmUtilityUi->DisplayNoteL( EConfFileLockedForSim );
  3493                     }
  3563                     }
  3494                 else
  3564                 else
  3495                     {
  3565                     {
  3496                     iDrmUtilityUi->DisplayNoteL( R_DRM_INFO_EXPIRED_OR_NO_RO );
  3566                     iDrmUtilityUi->DisplayNoteL( EConfLicenceExpired );
  3497                     }
  3567                     }
  3498                 }
  3568                 }
  3499             }
  3569             }
  3500         else
  3570         else
  3501             {
  3571             {
  3502             // rights expected to arrive
  3572             // rights expected to arrive
  3503             if ( eta != KErrCAPendingRights )
  3573             if ( eta != KErrCAPendingRights )
  3504                 {
  3574                 {
  3505                 // rights expected to arrive in eta seconds
  3575                 // rights expected to arrive in eta seconds
  3506                 iDrmUtilityUi->DisplayQueryWithIdL(
  3576                 iDrmUtilityUi->DisplayNoteL( EConfWaitingForLicence );
  3507                     R_DRMUTILITY_WAITING_FOR_RIGHTS,
       
  3508                     R_DRMUTILITY_WAITING_RIGHTS_CONFIRMATION_QUERY );
       
  3509                 }
  3577                 }
  3510             else
  3578             else
  3511                 {
  3579                 {
  3512                 // rights should have come
  3580                 // rights should have come
  3513                 if ( aRightsUrl )
  3581                 if ( aRightsUrl )
  3514                     {
  3582                     {
  3515                     ret = iDrmUtilityUi->DisplayQueryWithIdL(
  3583                     ret = iDrmUtilityUi->DisplayQueryL( EQueryGetNewLicence, KNoValue );
  3516                         R_DRMUTILITY_RIGHTS_SHOULD_HAVE_COME,
       
  3517                         R_DRMUTILITY_CONFIRMATION_QUERY );
       
  3518                     }
  3584                     }
  3519                 else
  3585                 else
  3520                     {
  3586                     {
  3521                     // no rights issuer
  3587                     // no rights issuer
  3522                     iDrmUtilityUi->DisplayQueryWithIdL(
  3588                     // Qt dialog not implemented yet
  3523                         R_DRMUTILITY_RIGHTS_SHOULD_HAVE_COME_NO_RI,
  3589                     iDrmUtilityUi->DisplayNoteL( EConfLicenceNotReceived );
  3524                         R_DRMUTILITY_WAITING_RIGHTS_CONFIRMATION_QUERY );
       
  3525                     }
  3590                     }
  3526                 }
  3591                 }
  3527             }
  3592             }
  3528         }
  3593         }
  3529 
  3594     if ( ret == EOk )
  3530     if ( ret == EAknSoftkeyYes || ret == EAknSoftkeyOk )
       
  3531         {
  3595         {
  3532         rightsRenewalWanted = ETrue;
  3596         rightsRenewalWanted = ETrue;
  3533         }
  3597         }
  3534     return rightsRenewalWanted;
  3598     return rightsRenewalWanted;
  3535     }
  3599     }
  4004         ptr.Append( KHttp );
  4068         ptr.Append( KHttp );
  4005         ptr.Append( *aUrl );
  4069         ptr.Append( *aUrl );
  4006         ptrc.Set( *newUrl );
  4070         ptrc.Set( *newUrl );
  4007         }
  4071         }
  4008 
  4072 
  4009     CSchemeHandler* schemeHandler( CSchemeHandler::NewL( ptrc ) );
  4073     CDrmBrowserLauncher* browserLauncher = CDrmBrowserLauncher::NewLC();
  4010     CleanupStack::PushL( schemeHandler );
  4074     	
  4011     if ( iCoeEnv )
  4075     browserLauncher->LaunchUrlL(ptrc);
  4012         {
  4076     
  4013         embeddedLaunch = ETrue;
  4077     CleanupStack::PopAndDestroy(); // browserLauncher
  4014         // launch embedded
       
  4015         schemeHandler->Observer( this );
       
  4016         schemeHandler->HandleUrlEmbeddedL();
       
  4017         CleanupStack::Pop( schemeHandler );
       
  4018         iSchemeHandler = schemeHandler;
       
  4019         iWait.Start();
       
  4020         }
       
  4021     else
       
  4022         {
       
  4023         // no CoeEnv, launch standalone with scheme app
       
  4024         schemeHandler->HandleUrlStandaloneL();
       
  4025         CleanupStack::PopAndDestroy( schemeHandler );
       
  4026         }
       
  4027     schemeHandler = NULL;
       
  4028 
  4078 
  4029     // delete newUrl if needed
  4079     // delete newUrl if needed
  4030     if ( newUrl )
  4080     if ( newUrl )
  4031         {
  4081         {
  4032         CleanupStack::PopAndDestroy( newUrl );
  4082         CleanupStack::PopAndDestroy( newUrl );
  4041 TInt DRM::CDrmUiHandlingImpl::GetSilentRightsL(
  4091 TInt DRM::CDrmUiHandlingImpl::GetSilentRightsL(
  4042     const TDesC8& aUrl,
  4092     const TDesC8& aUrl,
  4043     const TBool aShowNotes )
  4093     const TBool aShowNotes )
  4044     {
  4094     {
  4045     TInt r( KErrCancel );
  4095     TInt r( KErrCancel );
  4046     TInt buttonCode( EAknSoftkeyYes );
  4096     TInt buttonCode( EOk );
  4047     HBufC8* url( NULL );
  4097     HBufC8* url( NULL );
  4048 
  4098 
  4049     if ( !SilentRightsAllowedL() )
  4099     if ( !SilentRightsAllowedL() )
  4050         {
  4100         {
  4051         buttonCode = EAknSoftkeyNo;
  4101         buttonCode = ECancelled;
  4052         if ( aShowNotes )
  4102         if ( aShowNotes )
  4053             {
  4103             {
  4054             buttonCode = iDrmUtilityUi->DisplayQueryWithIdL(
  4104             // Qt dialog not implemented yet
  4055                 R_DRM_QRY_CONNECT_TO_ACTIVATE,
  4105             buttonCode = iDrmUtilityUi->DisplayQueryL( EQueryConnectToActivate, KNoValue );
  4056                 R_DRMUTILITY_CONFIRMATION_QUERY );
       
  4057             }
  4106             }
  4058         }
  4107         }
  4059     else if ( !(HasDefConn()) )
  4108     else if ( !(HasDefConn()) )
  4060         {
  4109         {
  4061         buttonCode = EAknSoftkeyNo;
  4110         buttonCode = ECancelled;
  4062         if ( aShowNotes )
  4111         if ( aShowNotes )
  4063             {
  4112             {
  4064             buttonCode = iDrmUtilityUi->DisplayQueryWithIdL(
  4113             // Qt dialog not implemented yet
  4065                 R_DRM_QRY_CONNECT_TO_ACTIVATE,
  4114             buttonCode = iDrmUtilityUi->DisplayQueryL( EQueryConnectToActivate, KNoValue );
  4066                 R_DRMUTILITY_CONFIRMATION_QUERY );
  4115             }
  4067             }
  4116         }
  4068         }
  4117 
  4069 
  4118     if ( buttonCode == EOk )
  4070     if ( buttonCode == EAknSoftkeyYes || buttonCode == EAknSoftkeyOk )
       
  4071         {
  4119         {
  4072         TBool APs( HasAccessPointsL() );
  4120         TBool APs( HasAccessPointsL() );
  4073         if ( !APs )
  4121         if ( !APs )
  4074             {
  4122             {
  4075             // No AP defined
  4123             // No AP defined
  4076             if ( aShowNotes )
  4124             if ( aShowNotes )
  4077                 {
  4125                 {
  4078                 iDrmUtilityUi->DisplayNoteL( R_DRM_WARN_NO_CONN_DEFINED );
  4126                 // Qt dialog not implemented yet
       
  4127                 iDrmUtilityUi->DisplayNoteL( EConfNoAccessPoint );
  4079                 }
  4128                 }
  4080             r = KErrCANoRights;
  4129             r = KErrCANoRights;
  4081             }
  4130             }
  4082         else
  4131         else
  4083             {
  4132             {
  4107                     if ( r == KErrCouldNotConnect )
  4156                     if ( r == KErrCouldNotConnect )
  4108                         {
  4157                         {
  4109                         // Connection failed with selected AP
  4158                         // Connection failed with selected AP
  4110                         if ( aShowNotes )
  4159                         if ( aShowNotes )
  4111                             {
  4160                             {
  4112                             iDrmUtilityUi->DisplayNoteL(
  4161                             // Qt dialog not implemented yet
  4113                                 R_DRM_WARN_INVALID_OR_NO_AP );
  4162                             iDrmUtilityUi->DisplayNoteL( EConfConnectionFailed );
  4114                             }
  4163                             }
  4115                         r = KErrCANoRights;
  4164                         r = KErrCANoRights;
  4116                         }
  4165                         }
  4117                     else
  4166                     else
  4118                         {
  4167                         {
  4125                             // error url is got only if temporary roap error
  4174                             // error url is got only if temporary roap error
  4126 
  4175 
  4127                             if ( errorUrl )
  4176                             if ( errorUrl )
  4128                                 {
  4177                                 {
  4129                                 // ask user whether error url should be opened
  4178                                 // ask user whether error url should be opened
  4130                                 buttonCode
  4179                                 // Qt dialog not implemented yet
  4131                                     = iDrmUtilityUi->DisplayQueryWithIdL(
  4180                                 buttonCode = iDrmUtilityUi->DisplayQueryL( EQueryOpenErrorUrl, KNoValue );
  4132                                         R_DRM_QUERY_OPEN_ERROR_URL,
  4181 
  4133                                         R_DRMUTILITY_CONFIRMATION_QUERY );
  4182                                 if ( buttonCode == EOk )
  4134 
       
  4135                                 if ( buttonCode == EAknSoftkeyYes
       
  4136                                     || buttonCode == EAknSoftkeyOk )
       
  4137                                     {
  4183                                     {
  4138                                     // Launch browser
  4184                                     // Launch browser
  4139                                     LaunchBrowserL( errorUrl );
  4185                                     LaunchBrowserL( errorUrl );
  4140                                     }
  4186                                     }
  4141                                 }
  4187                                 }
  4142                             else
  4188                             else
  4143                                 {
  4189                                 {
  4144                                 iDrmUtilityUi->DisplayNoteL(
  4190                                 // Qt dialog not implemented yet
  4145                                     R_DRM_ERR_OPENING_FAIL_PERM );
  4191                                 iDrmUtilityUi->DisplayNoteL( EConfUnableToUnlock );
  4146                                 }
  4192                                 }
  4147                             CleanupStack::PopAndDestroy( errorUrl );
  4193                             CleanupStack::PopAndDestroy( errorUrl );
  4148                             }
  4194                             }
  4149                         }
  4195                         }
  4150                     }
  4196                     }
  4172 // CDrmUiHandlingImpl::HandleServerAppExit
  4218 // CDrmUiHandlingImpl::HandleServerAppExit
  4173 // -----------------------------------------------------------------------------
  4219 // -----------------------------------------------------------------------------
  4174 //
  4220 //
  4175 void DRM::CDrmUiHandlingImpl::HandleServerAppExit( TInt aReason )
  4221 void DRM::CDrmUiHandlingImpl::HandleServerAppExit( TInt aReason )
  4176     {
  4222     {
  4177     if ( aReason == EAknCmdExit && !iSchemeHandler )
  4223     if ( aReason == EAknCmdExit)
  4178         {
  4224         {
  4179         CAknEnv::RunAppShutter();
  4225         CAknEnv::RunAppShutter();
  4180         }
       
  4181 
       
  4182     if ( iSchemeHandler )
       
  4183         {
       
  4184         delete iSchemeHandler;
       
  4185         iSchemeHandler = NULL;
       
  4186         }
  4226         }
  4187 
  4227 
  4188     if ( iWait.IsStarted() )
  4228     if ( iWait.IsStarted() )
  4189         {
  4229         {
  4190         iWait.AsyncStop();
  4230         iWait.AsyncStop();