1 /* |
|
2 * Copyright (c) 2008 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: Interface class for WMDRM DLA functionality |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_WMDRMDLAHANDLER_H |
|
20 #define C_WMDRMDLAHANDLER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <f32file.h> |
|
24 |
|
25 class CWmDrmDlaHandlerImpl; |
|
26 |
|
27 /** |
|
28 * WMDRM DLA Interface |
|
29 * |
|
30 * @lib wmdrmdla.lib |
|
31 * @since S60 v9.1 |
|
32 */ |
|
33 NONSHARABLE_CLASS( CWmDrmDlaHandler ) : public CBase |
|
34 { |
|
35 |
|
36 public: |
|
37 |
|
38 IMPORT_C static CWmDrmDlaHandler* NewL(); |
|
39 IMPORT_C static CWmDrmDlaHandler* NewLC(); |
|
40 |
|
41 /** |
|
42 * Destructor. |
|
43 */ |
|
44 virtual ~CWmDrmDlaHandler(); |
|
45 |
|
46 /** |
|
47 * Checks if license acquisition for file is silent |
|
48 * |
|
49 * @param aFile wmdrm file |
|
50 * @return ETrue if license acquisition is silent |
|
51 * @leave KErrNotFound if there is no handler for the file |
|
52 */ |
|
53 IMPORT_C TBool SilentL( const RFile& aFile ); |
|
54 |
|
55 /** |
|
56 * Acquire license based on the file handle |
|
57 * |
|
58 * @param aFile wmdrm file |
|
59 * @param aContentUrl contains content URL on return. Can be NULL. |
|
60 * If it's not NULL, it must be freed by caller. |
|
61 * @param aHtmlData contains HTML data returned by license server on |
|
62 * return. Can be NULL. |
|
63 * If it's not NULL, it must be freed by caller. |
|
64 * @leave KErrNotFound if there is no handler for the file |
|
65 */ |
|
66 IMPORT_C void AcquireLicenseL( const RFile& aFile, HBufC*& aContentUrl, |
|
67 HBufC*& aHtmlData ); |
|
68 |
|
69 /** |
|
70 * Acquire license based on the file handle, asynchronous version |
|
71 * |
|
72 * @param aFile wmdrm file |
|
73 * @param aContentUrl contains content URL on completion. Can be NULL. |
|
74 * If it's not NULL, it must be freed by caller. |
|
75 * @param aHtmlData contains HTML data returned by license server on |
|
76 * completion. Can be NULL. |
|
77 * If it's not NULL, it must be freed by caller. |
|
78 * @param aStatus Request status. On completion contains the error code. |
|
79 */ |
|
80 IMPORT_C void AcquireLicense( const RFile& aFile, HBufC*& aContentUrl, |
|
81 HBufC*& aHtmlData, TRequestStatus& aStatus ); |
|
82 |
|
83 /** |
|
84 * Acquire license based on the DRM Header |
|
85 * |
|
86 * @param aDrmHeader DRM Header |
|
87 * @param aErrorUrl URL where error code is sent. Can be NULL. |
|
88 * @param aContentUrl contains content URL on return. Can be NULL. |
|
89 * If it's not NULL, it must be freed by caller. |
|
90 * @param aHtmlData contains HTML data returned by license server on |
|
91 * return. Can be NULL. |
|
92 * If it's not NULL, it must be freed by caller. |
|
93 * @leave KErrNotFound if there is no handler for the file |
|
94 */ |
|
95 IMPORT_C void AcquireLicenseFromDrmHeaderL( const TDesC8& aDrmHeader, |
|
96 HBufC* aErrorUrl, |
|
97 HBufC*& aContentUrl, |
|
98 HBufC*& aHtmlData ); |
|
99 |
|
100 /** |
|
101 * Acquire license based on the DRM Header, asynchronous version |
|
102 * |
|
103 * @param aDrmHeader DRM Header |
|
104 * @param aErrorUrl URL where error code is sent. Can be NULL. |
|
105 * @param aContentUrl contains content URL on completion. Can be NULL. |
|
106 * If it's not NULL, it must be freed by caller. |
|
107 * @param aHtmlData contains HTML data returned by license server on |
|
108 * completion. Can be NULL. |
|
109 * If it's not NULL, it must be freed by caller. |
|
110 * @param aStatus Request status. On completion contains the error code. |
|
111 */ |
|
112 IMPORT_C void AcquireLicenseFromDrmHeader( const TDesC8& aDrmHeader, |
|
113 HBufC* aErrorUrl, |
|
114 HBufC*& aContentUrl, |
|
115 HBufC*& aHtmlData, |
|
116 TRequestStatus& aStatus ); |
|
117 |
|
118 /** |
|
119 * Cancels ongoing license acquisition |
|
120 * |
|
121 */ |
|
122 IMPORT_C void CancelLicenseAcquisition(); |
|
123 |
|
124 /** |
|
125 * Handles metering certificate OTA |
|
126 * |
|
127 * @param aCertificate metering certificate |
|
128 */ |
|
129 IMPORT_C void ProcessMeteringCertificateL( const TDesC8& aCertificate ); |
|
130 |
|
131 /** |
|
132 * Handles metering certificate OTA, asynchronous version |
|
133 * |
|
134 * @param aCertificate metering certificate |
|
135 * @param aStatus Request status. On completion contains the error code. |
|
136 */ |
|
137 IMPORT_C void ProcessMeteringCertificate( const TDesC8& aCertificate, |
|
138 TRequestStatus& aStatus ); |
|
139 |
|
140 /** |
|
141 * Cancels ongoing metering |
|
142 * |
|
143 */ |
|
144 IMPORT_C void CancelMetering(); |
|
145 |
|
146 /** |
|
147 * Sets the IAP to be used in the HTTP transactions |
|
148 * |
|
149 * @param aIapId Internet Access Point id |
|
150 */ |
|
151 IMPORT_C void SetIapId( TInt aIapId ); |
|
152 |
|
153 protected: |
|
154 |
|
155 private: |
|
156 |
|
157 CWmDrmDlaHandler(); |
|
158 |
|
159 void ConstructL(); |
|
160 |
|
161 private: // data |
|
162 |
|
163 /** |
|
164 * Implementation class |
|
165 * Own. |
|
166 */ |
|
167 CWmDrmDlaHandlerImpl* iImpl; |
|
168 |
|
169 }; |
|
170 |
|
171 #endif // C_WMDRMDLAHANDLER_H |
|