1 /* |
1 /* |
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2006-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". |
25 #include <sacls.h> |
25 #include <sacls.h> |
26 #include <utf.h> |
26 #include <utf.h> |
27 |
27 |
28 // publish & subscribe |
28 // publish & subscribe |
29 #include <e32property.h> |
29 #include <e32property.h> |
30 #include <psvariables.h> |
30 #include <PSVariables.h> |
31 #include <centralrepository.h> |
31 #include <centralrepository.h> |
32 |
32 |
33 // coeenv |
33 // coeenv |
34 #include <coemain.h> |
34 #include <coemain.h> |
35 #include <apgtask.h> |
35 #include <apgtask.h> |
36 #include <avkon.hrh> |
36 #include <avkon.hrh> |
37 #include <aknenv.h> |
37 #include <aknenv.h> |
38 |
38 |
39 // browser |
39 // browser |
40 #ifdef __SERIES60_NATIVE_BROWSER |
40 #ifdef __SERIES60_NATIVE_BROWSER |
41 #include <browseruisdkcrkeys.h> |
41 #include <BrowserUiSDKCRKeys.h> |
42 #endif |
42 #endif |
43 |
43 |
44 // caf |
44 // caf |
45 #include <caf/data.h> |
45 #include <caf/data.h> |
46 #include <caf/caftypes.h> |
46 #include <caf/caftypes.h> |
47 |
47 |
48 // launching embedded details view |
48 // launching embedded details view |
49 #include <aknlaunchappservice.h> |
49 #include <AknLaunchAppService.h> |
50 #include <aiwgenericparam.h> |
50 #include <AiwGenericParam.h> |
51 #include <apgcli.h> |
51 #include <apgcli.h> |
52 |
52 |
53 // character conversions |
53 // character conversions |
54 #include <utf.h> |
54 #include <utf.h> |
55 |
55 |
56 // handling urls |
56 // handling urls |
57 #include <schemehandler.h> |
57 #include <SchemeHandler.h> |
58 |
58 |
59 // resources |
59 // resources |
60 #include <data_caging_path_literals.hrh> |
60 #include <data_caging_path_literals.hrh> |
61 #include <drmutility.rsg> |
61 #include <drmutility.rsg> |
62 |
62 |
63 // drm |
63 // drm |
64 #include <oma2agent.h> |
64 #include <Oma2Agent.h> |
65 #include <drmagents.h> |
65 #include <drmagents.h> |
66 #include <drmpermission.h> |
66 #include <DrmPermission.h> |
67 #include <drmconstraint.h> |
67 #include <DrmConstraint.h> |
68 #include <drmrightsclient.h> |
68 #include <DRMRightsClient.h> |
69 #include <drmutility.h> |
69 #include <drmutility.h> |
70 #include <drmutilitytypes.h> |
70 #include <drmutilitytypes.h> |
71 #include <drmasyncobserver.h> |
71 #include <drmasyncobserver.h> |
72 #include <drmhandleerrorobserver.h> |
72 #include <drmhandleerrorobserver.h> |
73 |
73 |
75 #include <e32debug.h> |
75 #include <e32debug.h> |
76 #endif |
76 #endif |
77 |
77 |
78 #include "drmutilitycommon.h" |
78 #include "drmutilitycommon.h" |
79 #include "drmutilityui.h" |
79 #include "drmutilityui.h" |
80 #include "drmuihandlingimpl.h" |
80 #include "DrmUiHandlingImpl.h" |
81 #include "drmuihandlingdata.h" |
81 #include "drmuihandlingdata.h" |
82 #include "drmutilitydownloadmanager.h" |
82 #include "DrmUtilityDownloadManager.h" |
83 #include "drmutilityinternaltypes.h" |
83 #include "drmutilityinternaltypes.h" |
84 #include "drmuicheckrightsobserver.h" |
84 #include "drmuicheckrightsobserver.h" |
85 #include "drmutilitywmdrm.h" |
85 #include "drmutilitywmdrm.h" |
86 #include "drmutilitywmdrmwrapper.h" |
86 #include "drmutilitywmdrmwrapper.h" |
87 |
87 |
88 #include "roapstorageclient.h" |
88 #include "RoapStorageClient.h" |
89 #include "drmtypes.h" |
89 #include "DRMTypes.h" |
90 #include "drmsettingsplugininternalcrkeys.h" |
90 #include "drmsettingsplugininternalcrkeys.h" |
91 #include "drmricontext.h" |
91 #include "DRMRIContext.h" |
92 #include "drmdomaincontext.h" |
92 #include "DRMDomainContext.h" |
93 |
93 |
94 #include "drmutilityinternalcrkeys.h" // Cenrep extension for OmaBased |
94 #include "DrmUtilityInternalcrkeys.h" // Cenrep extension for OmaBased |
95 |
95 |
96 // CONSTANTS |
96 // CONSTANTS |
97 const TInt KCommandHandleErrorFile( 1 ); |
97 const TInt KCommandHandleErrorFile( 1 ); |
98 const TInt KCommandHandleErrorData( 2 ); |
98 const TInt KCommandHandleErrorData( 2 ); |
99 const TInt KCommandCheckRightsAmountFile( 3 ); |
99 const TInt KCommandCheckRightsAmountFile( 3 ); |
1610 // valid rights |
1610 // valid rights |
1611 if ( !omaError ) |
1611 if ( !omaError ) |
1612 { |
1612 { |
1613 permission = iOmaClient.GetActiveRightsL( aIntent, *aContentUri, |
1613 permission = iOmaClient.GetActiveRightsL( aIntent, *aContentUri, |
1614 reason ); |
1614 reason ); |
1615 |
1615 |
1616 if( !permission ) |
1616 if( !permission ) |
1617 { |
1617 { |
1618 User::Leave( KErrCANoPermission); //coverity check |
1618 User::Leave( KErrCANoPermission); //coverity check |
1619 } |
1619 } |
1620 |
1620 |
1621 CleanupStack::PushL( permission ); |
1621 CleanupStack::PushL( permission ); |
1622 |
1622 |
1623 toplevel = permission->TopLevelConstraint(); |
1623 toplevel = permission->TopLevelConstraint(); |
1624 constraint = permission->ConstraintForIntent( aIntent ); |
1624 constraint = permission->ConstraintForIntent( aIntent ); |
1625 |
1625 |
3824 const HBufC* aFullPath ) |
3824 const HBufC* aFullPath ) |
3825 { |
3825 { |
3826 __ASSERT_DEBUG( !aLaunchParam && aUrl && aFullPath, |
3826 __ASSERT_DEBUG( !aLaunchParam && aUrl && aFullPath, |
3827 User::Panic( KDRMUtilityDebugPanicMessage, |
3827 User::Panic( KDRMUtilityDebugPanicMessage, |
3828 KDRMUtilityDebugPanicCode ) ); |
3828 KDRMUtilityDebugPanicCode ) ); |
3829 _LIT( KSpace, " " ); |
3829 _LIT( KMarker, "\x00" ); |
3830 |
3830 |
3831 RPointerArray<CDRMPermission> uriList; |
3831 RPointerArray<CDRMPermission> uriList; |
3832 TPtr ptr( NULL, 0 ); |
3832 TPtr ptr( NULL, 0 ); |
3833 |
3833 |
3834 TInt localId( 0 ); |
3834 TInt localId( 0 ); |
3848 HBufC* localIDBuf( HBufC::NewLC( KIntegerMaxLen ) ); |
3848 HBufC* localIDBuf( HBufC::NewLC( KIntegerMaxLen ) ); |
3849 ptr.Set( localIDBuf->Des() ); |
3849 ptr.Set( localIDBuf->Des() ); |
3850 ptr.AppendNum( localId ); |
3850 ptr.AppendNum( localId ); |
3851 |
3851 |
3852 // length of startparam and drm protection scheme are always 1 and |
3852 // length of startparam and drm protection scheme are always 1 and |
3853 // 4 spaces are needed |
3853 // 5 markers are needed |
3854 const TInt KSpacesBetweenParams( 4 ); |
3854 const TInt KMarkersForParams( 5 ); |
3855 TInt length( 1 + aUrl->Length() + ptr.Length() + aFullPath->Length() |
3855 TInt length( 1 + aUrl->Length() + ptr.Length() + aFullPath->Length() |
3856 + KSpacesBetweenParams + 1 ); |
3856 + KMarkersForParams + 1 ); |
3857 |
3857 |
3858 aLaunchParam = HBufC::NewLC( length ); |
3858 aLaunchParam = HBufC::NewLC( length ); |
3859 ptr.Set( aLaunchParam->Des() ); |
3859 ptr.Set( aLaunchParam->Des() ); |
3860 |
3860 |
3861 // Start parameter is 3 or 4 for launching details view embedded or standalone from |
3861 // Start parameter is 3 or 4 for launching details view embedded or standalone from |
3867 } |
3867 } |
3868 else |
3868 else |
3869 { |
3869 { |
3870 ptr.AppendNum( EDrmLaunchParamStandAloneUtility ); |
3870 ptr.AppendNum( EDrmLaunchParamStandAloneUtility ); |
3871 } |
3871 } |
3872 ptr.Append( KSpace ); |
3872 ptr.Append( KMarker ); |
3873 ptr.Append( *localIDBuf ); |
3873 ptr.Append( *localIDBuf ); |
3874 ptr.Append( KSpace ); |
3874 ptr.Append( KMarker ); |
3875 |
3875 |
3876 HBufC* contentUrl( CnvUtfConverter::ConvertToUnicodeFromUtf8L( *aUrl ) ); |
3876 HBufC* contentUrl( CnvUtfConverter::ConvertToUnicodeFromUtf8L( *aUrl ) ); |
3877 |
3877 |
3878 ptr.Append( *contentUrl ); |
3878 ptr.Append( *contentUrl ); |
3879 ptr.Append( KSpace ); |
3879 ptr.Append( KMarker ); |
3880 |
3880 |
3881 // OMA DRM protection scheme |
3881 // OMA DRM protection scheme |
3882 ptr.AppendNum( EDrmSchemeOmaDrm ); |
3882 ptr.AppendNum( EDrmSchemeOmaDrm ); |
3883 ptr.Append( KSpace ); |
3883 ptr.Append( KMarker ); |
3884 |
3884 |
3885 ptr.Append( *aFullPath ); |
3885 ptr.Append( *aFullPath ); |
|
3886 ptr.Append( KMarker ); |
3886 |
3887 |
3887 delete contentUrl; |
3888 delete contentUrl; |
3888 |
3889 |
3889 CleanupStack::Pop( aLaunchParam ); |
3890 CleanupStack::Pop( aLaunchParam ); |
3890 CleanupStack::PopAndDestroy( localIDBuf ); |
3891 CleanupStack::PopAndDestroy( localIDBuf ); |
3900 { |
3901 { |
3901 __ASSERT_DEBUG( !aLaunchParam && aUrl, |
3902 __ASSERT_DEBUG( !aLaunchParam && aUrl, |
3902 User::Panic( KDRMUtilityDebugPanicMessage, |
3903 User::Panic( KDRMUtilityDebugPanicMessage, |
3903 KDRMUtilityDebugPanicCode ) ); |
3904 KDRMUtilityDebugPanicCode ) ); |
3904 _LIT( KZero, "0" ); |
3905 _LIT( KZero, "0" ); |
3905 _LIT( KSpace, " " ); |
3906 _LIT( KMarker, "\x00" ); |
3906 |
3907 |
3907 TPtr ptr( NULL, 0 ); |
3908 TPtr ptr( NULL, 0 ); |
3908 |
3909 |
3909 // Length of startparam and drm protection scheme and zero local id |
3910 // Length of startparam and drm protection scheme and zero local id |
3910 // are always 1 and total of 3 spaces are needed |
3911 // are always 1 and total of 4 markers are needed |
3911 TInt length( 1 + aUrl->Length() + 1 + 3 + 1 ); |
3912 TInt length( 1 + aUrl->Length() + 1 + 4 + 1 ); |
3912 |
3913 |
3913 aLaunchParam = HBufC::NewLC( length ); |
3914 aLaunchParam = HBufC::NewLC( length ); |
3914 ptr.Set( aLaunchParam->Des() ); |
3915 ptr.Set( aLaunchParam->Des() ); |
3915 |
3916 |
3916 // Start parameter is 3 or 4 for launching details view embedded or standalone from |
3917 // Start parameter is 3 or 4 for launching details view embedded or standalone from |
3922 } |
3923 } |
3923 else |
3924 else |
3924 { |
3925 { |
3925 ptr.AppendNum( EDrmLaunchParamStandAloneUtility ); |
3926 ptr.AppendNum( EDrmLaunchParamStandAloneUtility ); |
3926 } |
3927 } |
3927 ptr.Append( KSpace ); |
3928 ptr.Append( KMarker ); |
3928 // Default value 0 for localId in case of WM DRM file |
3929 // Default value 0 for localId in case of WM DRM file |
3929 ptr.Append( KZero ); |
3930 ptr.Append( KZero ); |
3930 ptr.Append( KSpace ); |
3931 ptr.Append( KMarker ); |
3931 ptr.Append( *aUrl ); |
3932 ptr.Append( *aUrl ); |
3932 ptr.Append( KSpace ); |
3933 ptr.Append( KMarker ); |
3933 // WM DRM protection scheme |
3934 // WM DRM protection scheme |
3934 ptr.AppendNum( EDrmSchemeWmDrm ); |
3935 ptr.AppendNum( EDrmSchemeWmDrm ); |
|
3936 ptr.Append( KMarker ); |
3935 |
3937 |
3936 CleanupStack::Pop( aLaunchParam ); |
3938 CleanupStack::Pop( aLaunchParam ); |
3937 } |
3939 } |
3938 |
3940 |
3939 // ----------------------------------------------------------------------------- |
3941 // ----------------------------------------------------------------------------- |