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: Defines the interface for implementation of the Windows DRM commands for MTP |
|
15 * An implementor should derive from the class contained in this header file and |
|
16 * supply a DLL with a single export which returns a pointer to an instance of |
|
17 * the MMtpJanusDrmIf class. The ordinal 1 export may not be a leaving function |
|
18 * - all memory allocation should be done on the ConstructL() function call, |
|
19 * which may leave. |
|
20 * |
|
21 */ |
|
22 |
|
23 |
|
24 #ifndef MMTPJANUSDRMIF_H |
|
25 #define MMTPJANUSDRMIF_H |
|
26 |
|
27 #include <e32std.h> |
|
28 |
|
29 |
|
30 /** |
|
31 * Interface class of Windows DRM for MTP |
|
32 * |
|
33 * @lib MtpServer.lib |
|
34 * @since S60 3.2 |
|
35 */ |
|
36 class MMtpJanusDrmIf |
|
37 { |
|
38 public: |
|
39 |
|
40 /** |
|
41 * Second phase constructor. All allocation for the library should be performed at this call |
|
42 * |
|
43 * @since S60 3.2 |
|
44 */ |
|
45 virtual void ConstructL() = 0; |
|
46 |
|
47 /** |
|
48 * Called before the library is unloaded. All destruction and clean-up should be performed at this call |
|
49 * |
|
50 * @since S60 3.2 |
|
51 */ |
|
52 virtual void Close() = 0; |
|
53 |
|
54 /** |
|
55 * Gets a secure time challenge from the initiator |
|
56 * |
|
57 * @since S60 3.2 |
|
58 * @param aDataPhase Descriptor to populate with the challenge data (responder->initiator) |
|
59 * @param aResponseParamOne Contains the DRM_RESULT (OUT) |
|
60 * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes |
|
61 */ |
|
62 virtual TInt GetSecureTimeChallenge(TDes8& aDataPhase, TUint32& aResponseParamOne) = 0; |
|
63 |
|
64 /** |
|
65 * Sends a secure time response to the responder |
|
66 * |
|
67 * @since S60 3.2 |
|
68 * @param aDataPhase Descriptor containing the response data (initiator->responder) |
|
69 * @param aResponseParamOne Contains the DRM_RESULT (OUT) |
|
70 * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes |
|
71 */ |
|
72 virtual TInt SetSecureTimeResponse(const TDesC8& aDataPhase, TUint32& aResponseParamOne) = 0; |
|
73 |
|
74 /** |
|
75 * Sends a license response object to the responder |
|
76 * |
|
77 * @since S60 3.2 |
|
78 * @param aDataPhase Descriptor containing the license response data |
|
79 * @param aResponseParamOne Contains the DRM_RESULT (OUT) |
|
80 * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes |
|
81 */ |
|
82 virtual TInt SetLicenseResponse(const TDesC8& aDataPhase, TUint32& aResponseParamOne) = 0; |
|
83 |
|
84 /** |
|
85 * Sends a list of items to the initiator, based on the parameters in the query |
|
86 * |
|
87 * @since S60 3.2 |
|
88 * @param aDataPhase Descriptor containing the sync list requested (responder -> initiator) |
|
89 * @param aParamOne Contains the maximum remaining count value for the query (IN) and the DRM_RESULT (OUT) |
|
90 * @param aParamTwo Contains the maximum remaining song validity for the query (IN) and the next starting index (OUT) |
|
91 * @param aParamThree Contains the starting index for the data phase (IN) and the number of items processed (OUT) |
|
92 * @param aParamFour Contains the number of items that should be processed in this call (IN) |
|
93 * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes |
|
94 */ |
|
95 virtual TInt GetSyncList(TDes8& aDataPhase, TUint32& aParamOne, TUint32& aParamTwo, |
|
96 TUint32& aParamThree, TUint32 aParamFour) = 0; |
|
97 |
|
98 /** |
|
99 * Sends a meter challenge query. |
|
100 * |
|
101 * @since S60 3.2 |
|
102 * @param aDataPhase Descriptor containing the meter challenge query (initiator -> responder) |
|
103 * @param aResponseParamOne Contains the DRM_RESULT (OUT) |
|
104 * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes |
|
105 */ |
|
106 virtual TInt SendMeterChallengeQuery(const TDesC8& aDataPhase, TUint32& aResponseParamOne) = 0; |
|
107 |
|
108 /** |
|
109 * Gets a meter challenge from the initiator |
|
110 * |
|
111 * @since S60 3.2 |
|
112 * @param aDataPhase Descriptor to populate with the challenge data (responder->initiator) |
|
113 * @param aResponseParamOne Contains the DRM_RESULT (OUT) |
|
114 * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes |
|
115 */ |
|
116 virtual TInt GetMeterChallenge(TDes8& aDataPhase, TUint32& aResponseParamOne) = 0; |
|
117 |
|
118 /** |
|
119 * Sends a meter response to the responder |
|
120 * |
|
121 * @since S60 3.2 |
|
122 * @param aDataPhase Descriptor containing the response data (initiator->responder) |
|
123 * @param aResponseParamOne Contains the DRM_RESULT (OUT) |
|
124 * @param aMeterResponseFlags Contains the bit mask of flags to be passed to the initiator |
|
125 * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes |
|
126 */ |
|
127 virtual TInt SetMeterResponse(const TDesC8& aDataPhase, TUint32& aResponseParamOne, TUint32& aMeterResponseFlags) = 0; |
|
128 |
|
129 /** |
|
130 * Instructs the mobile device to clean the data store |
|
131 * |
|
132 * @since S60 3.2 |
|
133 * @param aParamOne Contains the cleaning flags bitmask (IN) and the DRM_RESULT (OUT) |
|
134 * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes |
|
135 */ |
|
136 virtual TInt CleanDataStore(TUint32& aParamOne) = 0; |
|
137 |
|
138 /** |
|
139 * Gets the state of the license requested in the data phase |
|
140 * |
|
141 * @since S60 3.2 |
|
142 * @param aDataPhase Descriptor containing the state query data |
|
143 * @param aParamOne Contains the DRM_RESULT (OUT) |
|
144 * @param aParamTwo Contains the category (OUT) |
|
145 * @param aParamThree Contains the DRM license state (OUT) |
|
146 * @param aParamFour Contains the DRM license state (OUT) |
|
147 * @param aParamFive Contains reserved data (OUT) |
|
148 * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes |
|
149 */ |
|
150 virtual TInt GetLicenseState(const TDesC8& aDataPhase, TUint32& aParamOne, TUint32& aParamTwo, |
|
151 TUint32& aParamThree, TUint32& aParamFour, TUint32& aParamFive) = 0; |
|
152 |
|
153 /** |
|
154 * Sends a WMDRM command to the portable device for processing |
|
155 * |
|
156 * @since S60 3.2 |
|
157 * @param aDataPhase Descriptor containing the command data phase (initiator -> responder) |
|
158 * @param aParamOne Contains the operation code (IN) and the DRM_RESULT (OUT) |
|
159 * @param aParamTwo Contains the first request argument (IN) and the first response result (OUT) |
|
160 * @param aParamThree Contains the second request argument (IN) and the second response result (OUT) |
|
161 * @param aParamFour Contains the third request argument (IN) and the third response result (OUT) |
|
162 * @param aParamFive Contains the fourth request argument (IN) and the fourth response result (OUT) |
|
163 * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes |
|
164 */ |
|
165 virtual TInt SendWMDRMCommand(const TDesC8& aDataPhase, TUint32& aParamOne, TUint32& aParamTwo, |
|
166 TUint32& aParamThree, TUint32& aParamFour, TUint32& aParamFive) = 0; |
|
167 |
|
168 /** |
|
169 * Sends a WMDRM request to the portable device for processing |
|
170 * |
|
171 * @since S60 3.2 |
|
172 * @param aDataPhase Descriptor containing the command data phase (responder -> initiator) |
|
173 * @param aParamOne Contains the operation code (IN) and the DRM_RESULT (OUT) |
|
174 * @param aParamTwo Contains the first request argument (IN) and the first response result (OUT) |
|
175 * @param aParamThree Contains the second request argument (IN) and the second response result (OUT) |
|
176 * @param aParamFour Contains the third request argument (IN) and the third response result (OUT) |
|
177 * @param aParamFive Contains the fourth request argument (IN) and the fourth response result (OUT) |
|
178 * @return Error state. Negative values are Symbian error codes, positive values are MTP error codes |
|
179 */ |
|
180 virtual TInt SendWMDRMRequest(TDes8& aDataPhase, TUint32& aParamOne, TUint32& aParamTwo, |
|
181 TUint32& aParamThree, TUint32& aParamFour, TUint32& aParamFive) = 0; |
|
182 |
|
183 /** |
|
184 * Get the device certificate to pass back as the device property. The descriptor returned should |
|
185 * contain the device certificate information as required by the GetDeviceProperty MTP command for |
|
186 * the MTP_PROPERTYCODE_JANUS_DEVICECERTIFICATE dataset. |
|
187 * Ownership of the descriptor is passed back |
|
188 * |
|
189 * @since S60 3.2 |
|
190 * @return A populated buffer of the device certificate dataset, or NULL in the case of an error |
|
191 */ |
|
192 virtual HBufC* DeviceCertificate() = 0; |
|
193 |
|
194 /** |
|
195 * Get the secure time of the device. |
|
196 * Ownership of the descriptor is passed back |
|
197 * |
|
198 * @since S60 3.2 |
|
199 * @return A populated buffer of the device secure time, or NULL in the case of an error |
|
200 */ |
|
201 // virtual HBufC* SecureTime() = 0; |
|
202 }; |
|
203 |
|
204 #endif // MMTPJANUSDRMIF_H |
|