40 #include <apgcli.h> |
40 #include <apgcli.h> |
41 #include <glxappui.h> |
41 #include <glxappui.h> |
42 #include <aknViewAppUi.h> |
42 #include <aknViewAppUi.h> |
43 #include <caf/content.h> |
43 #include <caf/content.h> |
44 #include <caf/attributeset.h> |
44 #include <caf/attributeset.h> |
|
45 #include <caf/caferr.h> |
45 #include <DRMHelper.h> |
46 #include <DRMHelper.h> |
46 |
47 |
47 #ifdef USE_S60_TNM |
48 #ifdef USE_S60_TNM |
48 #include <thumbnaildata.h> |
49 #include <thumbnaildata.h> |
49 const TInt KMaxGridThumbnailWidth = 200; |
50 const TInt KMaxGridThumbnailWidth = 200; |
810 TMPXAttribute attrib = iRequestedAttrs[i]; |
811 TMPXAttribute attrib = iRequestedAttrs[i]; |
811 TTime time; |
812 TTime time; |
812 time.HomeTime(); |
813 time.HomeTime(); |
813 if (errInImage == KErrNone) |
814 if (errInImage == KErrNone) |
814 { |
815 { |
815 RFs fs; |
816 if (iImageViewerInstance->IsPrivate()) |
816 CleanupClosePushL(fs); |
|
817 TInt err = fs.Connect(); |
|
818 if (err == KErrNone) |
|
819 { |
817 { |
820 TEntry entry; |
818 RFile64 & imageHandle = |
821 fs.Entry(fileName, entry); |
819 iImageViewerInstance->ImageFileHandle(); |
822 time = entry.iModified; |
820 if (imageHandle.SubSessionHandle() |
|
821 != KNullHandle) |
|
822 { |
|
823 imageHandle.Modified(time); |
|
824 } |
823 } |
825 } |
824 CleanupStack::PopAndDestroy(&fs); |
826 else |
|
827 { |
|
828 RFs fs; |
|
829 CleanupClosePushL(fs); |
|
830 TInt err = fs.Connect(); |
|
831 if (err == KErrNone) |
|
832 { |
|
833 TEntry entry; |
|
834 fs.Entry(fileName, entry); |
|
835 time = entry.iModified; |
|
836 } |
|
837 CleanupStack::PopAndDestroy(&fs); |
|
838 } |
825 } |
839 } |
826 iMPXMedia->SetTObjectValueL(attrib, |
840 iMPXMedia->SetTObjectValueL(attrib, |
827 time.Int64()); |
841 time.Int64()); |
828 } |
842 } |
829 else if ( iRequestedAttrs[i] == KMPXMediaGeneralSize ) |
843 else if ( iRequestedAttrs[i] == KMPXMediaGeneralSize ) |
924 if(errInImage == KErrNone) |
938 if(errInImage == KErrNone) |
925 { |
939 { |
926 protection = iReader->GetDRMRightsL |
940 protection = iReader->GetDRMRightsL |
927 (ContentAccess::EIsProtected); |
941 (ContentAccess::EIsProtected); |
928 } |
942 } |
929 iMPXMedia->SetTObjectValueL(KMPXMediaDrmProtected, protection); |
943 else if (errInImage == KErrCANoRights |
|
944 || errInImage == KErrCAPendingRights |
|
945 || errInImage == KErrCACorruptRights) |
|
946 { |
|
947 protection = ETrue; |
|
948 } |
|
949 iMPXMedia->SetTObjectValueL( |
|
950 KMPXMediaDrmProtected, protection); |
930 } |
951 } |
931 else if ( iRequestedAttrs[i] == KGlxMediaGeneralDRMRightsValid ) |
952 else if ( iRequestedAttrs[i] == KGlxMediaGeneralDRMRightsValid ) |
932 { |
953 { |
933 TInt rightsValid = EGlxDrmRightsValidityUnknown; |
954 TInt rightsValid = EGlxDrmRightsValidityUnknown; |
934 if(errInImage == KErrNone) |
955 if(errInImage == KErrNone) |
935 { |
956 { |
936 TBool canView = iReader->GetDRMRightsL(ContentAccess::ECanView); |
957 TBool canView = iReader->GetDRMRightsL( |
937 rightsValid = canView ? |
958 ContentAccess::ECanView); |
938 EGlxDrmRightsValid : EGlxDrmRightsInvalid; |
959 rightsValid |
|
960 = canView |
|
961 ? EGlxDrmRightsValid |
|
962 : EGlxDrmRightsInvalid; |
939 } |
963 } |
940 iMPXMedia->SetTObjectValueL(KGlxMediaGeneralDRMRightsValid, |
964 else if (errInImage == KErrCANoRights |
941 rightsValid); |
965 || errInImage == KErrCACorruptRights) |
|
966 { |
|
967 rightsValid = EGlxDrmRightsInvalid; |
|
968 } |
|
969 iMPXMedia->SetTObjectValueL( |
|
970 KGlxMediaGeneralDRMRightsValid, |
|
971 rightsValid); |
942 } |
972 } |
943 else if ( iRequestedAttrs[i] == KMPXMediaGeneralCount ) |
973 else if ( iRequestedAttrs[i] == KMPXMediaGeneralCount ) |
944 { |
974 { |
945 iMPXMedia->SetTObjectValueL(KMPXMediaGeneralCount, 1); |
975 iMPXMedia->SetTObjectValueL(KMPXMediaGeneralCount, 1); |
946 } |
976 } |