1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of the CFLDDRMImplementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "CFLDDRMImplementation.h" |
|
22 |
|
23 #include <DRMCommon.h> |
|
24 #include <e32svr.h> |
|
25 |
|
26 // ============================ MEMBER FUNCTIONS =============================== |
|
27 |
|
28 // ----------------------------------------------------------------------------- |
|
29 // CFLDDRMImplementation::ConstructL |
|
30 // Empty implementation |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 void CFLDDRMImplementation::ConstructL() |
|
34 { |
|
35 iDRMCommon = DRMCommon::NewL(); |
|
36 User::LeaveIfError( iDRMCommon->Connect() ); |
|
37 } |
|
38 |
|
39 // Destructor |
|
40 CFLDDRMImplementation::~CFLDDRMImplementation() |
|
41 { |
|
42 if( iDRMCommon ) |
|
43 { |
|
44 iDRMCommon->Disconnect(); // ignore possible error |
|
45 delete iDRMCommon; |
|
46 } |
|
47 } |
|
48 |
|
49 // ----------------------------------------------------------------------------- |
|
50 // CFLDDRMImplementation::IsFileValidL |
|
51 // Empty implementation |
|
52 // ----------------------------------------------------------------------------- |
|
53 // |
|
54 TBool CFLDDRMImplementation::IsFileValidL( |
|
55 const TDesC& aFileName, TIntention aIntention ) |
|
56 { |
|
57 TBool isValidUnprotected( ETrue ); |
|
58 |
|
59 if( aFileName.Compare( KNullDesC ) != 0 ) |
|
60 { |
|
61 TBool isProtected( EFalse ); |
|
62 iDRMCommon->IsProtectedFile( aFileName, isProtected ); |
|
63 if( !isProtected ) |
|
64 { |
|
65 // The file in question is not a DCF file. |
|
66 // Return ETrue if file is also Ok unprotected, otherwise EFalse. |
|
67 isValidUnprotected = |
|
68 IsFileValidUnprotectedL( aFileName, aIntention ); |
|
69 } |
|
70 } |
|
71 |
|
72 return isValidUnprotected; |
|
73 } |
|
74 |
|
75 // End of File |
|