|
1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * wmdrmaccess.cpp |
|
16 * |
|
17 */ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <ecom.h> |
|
21 |
|
22 #include <wmdrmaccess.h> |
|
23 #include <wmdrmaccessecominterface.h> |
|
24 |
|
25 // --------------------------------------------------------------------------- |
|
26 // CWmDrmAccess::NewL |
|
27 // --------------------------------------------------------------------------- |
|
28 EXPORT_C CWmDrmAccess* CWmDrmAccess::NewL() |
|
29 { |
|
30 CWmDrmAccess* self(CWmDrmAccess::NewLC()); |
|
31 CleanupStack::Pop(self); |
|
32 return self; |
|
33 } |
|
34 |
|
35 |
|
36 // --------------------------------------------------------------------------- |
|
37 // CWmDrmAccess::NewLC |
|
38 // --------------------------------------------------------------------------- |
|
39 EXPORT_C CWmDrmAccess* CWmDrmAccess::NewLC() |
|
40 { |
|
41 CWmDrmAccess* self(new (ELeave) CWmDrmAccess); |
|
42 CleanupStack::PushL(self); |
|
43 self->ConstructL(); |
|
44 return self; |
|
45 } |
|
46 |
|
47 |
|
48 // --------------------------------------------------------------------------- |
|
49 // CWmDrmAccess::ConstructL |
|
50 // --------------------------------------------------------------------------- |
|
51 void CWmDrmAccess::ConstructL() |
|
52 { |
|
53 iWmDrmAccessEcomInterface = CWmDrmAccessEcomInterface::NewL(); |
|
54 } |
|
55 |
|
56 |
|
57 // --------------------------------------------------------------------------- |
|
58 // CWmDrmAccess::CWmDrmAccess |
|
59 // --------------------------------------------------------------------------- |
|
60 CWmDrmAccess::CWmDrmAccess() |
|
61 { |
|
62 } |
|
63 |
|
64 |
|
65 // --------------------------------------------------------------------------- |
|
66 // CWmDrmAccess::~CWmDrmAccess |
|
67 // --------------------------------------------------------------------------- |
|
68 EXPORT_C CWmDrmAccess::~CWmDrmAccess() |
|
69 { |
|
70 if (iWmDrmAccessEcomInterface) |
|
71 { |
|
72 delete iWmDrmAccessEcomInterface; |
|
73 } |
|
74 REComSession::FinalClose(); |
|
75 } |
|
76 |
|
77 |
|
78 // --------------------------------------------------------------------------- |
|
79 // CWmDrmAccess::Initialize |
|
80 // --------------------------------------------------------------------------- |
|
81 EXPORT_C TInt CWmDrmAccess::Initialize(const TDesC8& aHeader) |
|
82 { |
|
83 TInt retCode(KErrNotReady); |
|
84 if (iWmDrmAccessEcomInterface) |
|
85 { |
|
86 retCode = iWmDrmAccessEcomInterface->Initialize(aHeader); |
|
87 } |
|
88 return retCode; |
|
89 } |
|
90 |
|
91 |
|
92 // --------------------------------------------------------------------------- |
|
93 // CWmDrmAccess::Decrypt |
|
94 // --------------------------------------------------------------------------- |
|
95 EXPORT_C TInt CWmDrmAccess::Decrypt(TDes8& aBuffer) |
|
96 { |
|
97 TInt retCode = KErrNotReady; |
|
98 if (iWmDrmAccessEcomInterface) |
|
99 { |
|
100 retCode = iWmDrmAccessEcomInterface->Decrypt(aBuffer); |
|
101 } |
|
102 return retCode; |
|
103 } |
|
104 |
|
105 |
|
106 // --------------------------------------------------------------------------- |
|
107 // CWmDrmAccess::Close |
|
108 // --------------------------------------------------------------------------- |
|
109 EXPORT_C TInt CWmDrmAccess::Close() |
|
110 { |
|
111 TInt retCode(KErrNotReady); |
|
112 if (iWmDrmAccessEcomInterface) |
|
113 { |
|
114 retCode = iWmDrmAccessEcomInterface->Close(); |
|
115 } |
|
116 return retCode; |
|
117 } |
|
118 |