231 EXPORT_C TInt RRtaData::GetAttributeSet (RAttributeSet &aAttributeSet) const |
231 EXPORT_C TInt RRtaData::GetAttributeSet (RAttributeSet &aAttributeSet) const |
232 { |
232 { |
233 TRAPD( err, GetAttributeSetL(aAttributeSet) ); |
233 TRAPD( err, GetAttributeSetL(aAttributeSet) ); |
234 return err; |
234 return err; |
235 } |
235 } |
236 |
236 |
|
237 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
|
238 void RRtaData::GetAttributeSetL (RAttributeSet &aAttributeSet, TBool aWmdrmFlag) const |
|
239 #else |
237 void RRtaData::GetAttributeSetL (RAttributeSet &aAttributeSet) const |
240 void RRtaData::GetAttributeSetL (RAttributeSet &aAttributeSet) const |
|
241 #endif // SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
238 { |
242 { |
239 TInt err = KErrOverflow; |
243 TInt err = KErrOverflow; |
240 TInt length = 0; |
244 TInt length = 0; |
241 TPckg <TInt> lengthPckg(length); |
245 TPckg <TInt> lengthPckg(length); |
242 |
246 |
261 { |
265 { |
262 HBufC8* transferBuffer = HBufC8::NewLC(length); |
266 HBufC8* transferBuffer = HBufC8::NewLC(length); |
263 transferBuffer->Des().Copy(bufPtr); |
267 transferBuffer->Des().Copy(bufPtr); |
264 TPtr8 transferPtr = transferBuffer->Des(); |
268 TPtr8 transferPtr = transferBuffer->Des(); |
265 |
269 |
|
270 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
|
271 if(aWmdrmFlag) |
|
272 err = SendReceive(EWMDRMGetAttributeSet, TIpcArgs(&transferPtr)); |
|
273 else |
|
274 err = SendReceive(EGetAttributeSet, TIpcArgs(&transferPtr)); |
|
275 #else |
266 // attempt to retrieve the attributes |
276 // attempt to retrieve the attributes |
267 err = SendReceive(EGetAttributeSet, TIpcArgs(&transferPtr)); |
277 err = SendReceive(EGetAttributeSet, TIpcArgs(&transferPtr)); |
|
278 #endif // SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
268 if(err == KErrOverflow) |
279 if(err == KErrOverflow) |
269 { |
280 { |
270 // Find out the length required to receive the resulting attribute set |
281 // Find out the length required to receive the resulting attribute set |
271 lengthPckg.Copy(transferPtr.Left(lengthPckg.MaxLength())); |
282 lengthPckg.Copy(transferPtr.Left(lengthPckg.MaxLength())); |
272 } |
283 } |
293 EXPORT_C TInt RRtaData::GetStringAttributeSet (RStringAttributeSet &aStringAttributeSet) const |
304 EXPORT_C TInt RRtaData::GetStringAttributeSet (RStringAttributeSet &aStringAttributeSet) const |
294 { |
305 { |
295 TRAPD( err, GetStringAttributeSetL(aStringAttributeSet) ); |
306 TRAPD( err, GetStringAttributeSetL(aStringAttributeSet) ); |
296 return err; |
307 return err; |
297 } |
308 } |
298 |
309 |
|
310 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
|
311 void RRtaData::GetStringAttributeSetL (RStringAttributeSet &aStringAttributeSet, TBool aWmdrmFlag) const |
|
312 #else |
299 void RRtaData::GetStringAttributeSetL (RStringAttributeSet &aStringAttributeSet) const |
313 void RRtaData::GetStringAttributeSetL (RStringAttributeSet &aStringAttributeSet) const |
|
314 #endif // SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
300 { |
315 { |
301 TInt err = KErrOverflow; |
316 TInt err = KErrOverflow; |
302 TInt length = 0; |
317 TInt length = 0; |
303 TPckg <TInt> lengthPckg(length); |
318 TPckg <TInt> lengthPckg(length); |
304 |
319 |
322 while(err == KErrOverflow) |
337 while(err == KErrOverflow) |
323 { |
338 { |
324 HBufC8* transferBuffer = HBufC8::NewLC(length); |
339 HBufC8* transferBuffer = HBufC8::NewLC(length); |
325 transferBuffer->Des().Copy(bufPtr); |
340 transferBuffer->Des().Copy(bufPtr); |
326 TPtr8 transferPtr = transferBuffer->Des(); |
341 TPtr8 transferPtr = transferBuffer->Des(); |
327 |
342 |
|
343 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
|
344 if(aWmdrmFlag) |
|
345 err = SendReceive(EWMDRMGetStringAttributeSet, TIpcArgs(&transferPtr)); |
|
346 else |
|
347 err = SendReceive(EGetStringAttributeSet, TIpcArgs(&transferPtr)); |
|
348 #else |
328 // attempt to retrieve the attributes |
349 // attempt to retrieve the attributes |
329 err = SendReceive(EGetStringAttributeSet, TIpcArgs(&transferPtr)); |
350 err = SendReceive(EGetStringAttributeSet, TIpcArgs(&transferPtr)); |
|
351 #endif // SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
330 if(err == KErrOverflow) |
352 if(err == KErrOverflow) |
331 { |
353 { |
332 // Find out the length required to receive the resulting attribute set |
354 // Find out the length required to receive the resulting attribute set |
333 lengthPckg.Copy(transferPtr.Left(lengthPckg.MaxLength())); |
355 lengthPckg.Copy(transferPtr.Left(lengthPckg.MaxLength())); |
334 } |
356 } |
359 { |
381 { |
360 err = SendReceive(ENoEnforceDataSetProperty, TIpcArgs(&agentPropertyPckg, &valuePckg)); |
382 err = SendReceive(ENoEnforceDataSetProperty, TIpcArgs(&agentPropertyPckg, &valuePckg)); |
361 } |
383 } |
362 return err; |
384 return err; |
363 } |
385 } |
|
386 |
|
387 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
|
388 |
|
389 EXPORT_C TInt RRtaData::Open(const TDesC8& aHeaderData) |
|
390 { |
|
391 TInt err = RRtaClient::Connect(); |
|
392 if(err != KErrNone) |
|
393 { |
|
394 return err; |
|
395 } |
|
396 |
|
397 if(IsDrmCapabilityEnforced()) |
|
398 { |
|
399 err = SendReceive(ECreateDataMessageHandler, TIpcArgs()); |
|
400 if(err != KErrNone) |
|
401 return err; |
|
402 |
|
403 err = SendReceive(EReadWMDRMHeaderData, TIpcArgs(&aHeaderData)); |
|
404 } |
|
405 |
|
406 else |
|
407 { |
|
408 err = SendReceive(ENoEnforceCreateDataMessageHandler, TIpcArgs()); |
|
409 if(err != KErrNone) |
|
410 return err; |
|
411 |
|
412 err = SendReceive(ENoEnforceReadWMDRMHeaderData, TIpcArgs(&aHeaderData)); |
|
413 } |
|
414 |
|
415 return err; |
|
416 } |
|
417 |
|
418 EXPORT_C TInt RRtaData::Read(const TDesC8& aEncryptedInputPacket, TDes8& aDecryptedOutputPacket) |
|
419 { |
|
420 TInt err = 0; |
|
421 if(IsDrmCapabilityEnforced()) |
|
422 { |
|
423 err = SendReceive(EReadWMDRMDataPacket, TIpcArgs(&aEncryptedInputPacket, &aDecryptedOutputPacket)); |
|
424 } |
|
425 else |
|
426 { |
|
427 err = SendReceive(ENoEnforceReadWMDRMDataPacket, TIpcArgs(&aEncryptedInputPacket, &aDecryptedOutputPacket)); |
|
428 } |
|
429 |
|
430 return err; |
|
431 } |
|
432 |
|
433 |
|
434 EXPORT_C TInt RRtaData::GetWmdrmAttribute(TInt aAttribute, TInt& aValue) const |
|
435 { |
|
436 TPckg<TInt> valuePkg(aValue); |
|
437 TInt err = SendReceive(EWMDRMGetAttribute, TIpcArgs(aAttribute, &valuePkg)); |
|
438 return err; |
|
439 } |
|
440 |
|
441 EXPORT_C TInt RRtaData::GetWmdrmAttributeSet(ContentAccess::RAttributeSet& aAttributeSet) const |
|
442 { |
|
443 TRAPD( err, GetAttributeSetL(aAttributeSet, ETrue)); |
|
444 return err; |
|
445 } |
|
446 |
|
447 EXPORT_C TInt RRtaData::GetWmdrmStringAttribute(TInt aAttribute, TDes& aValue) const |
|
448 { |
|
449 return SendReceive(EWMDRMGetStringAttribute, TIpcArgs(aAttribute, &aValue)); |
|
450 } |
|
451 |
|
452 EXPORT_C TInt RRtaData::GetWmdrmStringAttributeSet(ContentAccess::RStringAttributeSet& aStringAttributeSet) const |
|
453 { |
|
454 TRAPD( err, GetStringAttributeSetL(aStringAttributeSet, ETrue)); |
|
455 return err; |
|
456 } |
|
457 |
|
458 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
|
459 |
|
460 |