os/security/contentmgmt/contentaccessfwfordrm/source/caf/content.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/contentmgmt/contentaccessfwfordrm/source/caf/content.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,513 @@
     1.4 +/*
     1.5 +* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#include <caf/content.h>
    1.23 +#include "resolver.h"
    1.24 +#include <caf/data.h>
    1.25 +#include <caf/agentfactory.h>
    1.26 +#include "agentinfo.h"
    1.27 +#include <caf/agentinterface.h>
    1.28 +#include <caf/attributeset.h>
    1.29 +#include <caf/agent.h>
    1.30 +#include <caf/virtualpath.h>
    1.31 +#include <caf/agentfactory.h>
    1.32 +#include <caf/caferr.h>
    1.33 +
    1.34 +#ifndef REMOVE_CAF1
    1.35 +#include <caf/attribute.h>
    1.36 +#include <caf/bitset.h>
    1.37 +#endif
    1.38 +
    1.39 +using namespace ContentAccess;
    1.40 +
    1.41 +EXPORT_C CContent* CContent::NewLC(const TDesC& aURI) 
    1.42 +	{
    1.43 +	return CContent::NewLC(aURI, EContentShareReadOnly);
    1.44 +	}
    1.45 +
    1.46 +EXPORT_C CContent* CContent::NewL(const TDesC& aURI)  
    1.47 +	{
    1.48 +	return CContent::NewL(aURI, EContentShareReadOnly);
    1.49 +	}
    1.50 +
    1.51 +EXPORT_C CContent* CContent::NewLC(const TDesC& aURI, TContentShareMode aShareMode) 
    1.52 +	{
    1.53 +	CContent* self = new(ELeave) CContent();
    1.54 +	CleanupStack::PushL(self);
    1.55 +	self->ConstructL(aURI, aShareMode);
    1.56 +	return self;
    1.57 +	}
    1.58 +
    1.59 +EXPORT_C CContent* CContent::NewL(const TDesC& aURI, TContentShareMode aShareMode)  
    1.60 +	{
    1.61 +	CContent* self=CContent::NewLC(aURI, aShareMode);
    1.62 +	CleanupStack::Pop(self);
    1.63 +	return self;
    1.64 +	}
    1.65 +
    1.66 +EXPORT_C CContent* CContent::NewLC(RFile& aFile) 
    1.67 +	{
    1.68 +	CContent* self = new(ELeave) CContent();
    1.69 +	CleanupStack::PushL(self);
    1.70 +	self->ConstructL(aFile);
    1.71 +	return self;
    1.72 +	}
    1.73 +
    1.74 +EXPORT_C CContent* CContent::NewL(RFile& aFile) 
    1.75 +	{
    1.76 +	CContent* self=CContent::NewLC(aFile);
    1.77 +	CleanupStack::Pop(self);
    1.78 +	return self;
    1.79 +	}
    1.80 +
    1.81 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
    1.82 +
    1.83 +EXPORT_C CContent* CContent::NewLC(const TDesC8& aHeaderData) 
    1.84 +	{
    1.85 +	CContent* self = new(ELeave) CContent();
    1.86 +	CleanupStack::PushL(self);
    1.87 +	self->ConstructL(aHeaderData);
    1.88 +	return self;
    1.89 +	}
    1.90 +
    1.91 +EXPORT_C CContent* CContent::NewL(const TDesC8& aHeaderData) 
    1.92 +	{
    1.93 +	CContent* self=CContent::NewLC(aHeaderData);
    1.94 +	CleanupStack::Pop(self);
    1.95 +	return self;
    1.96 +	}
    1.97 +	
    1.98 +#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
    1.99 +
   1.100 +CContent::CContent() : iDefaultVirtualPath(KNullDesC(), KDefaultContentObject())
   1.101 +	{ 
   1.102 +	}
   1.103 +
   1.104 +CContent::~CContent() 
   1.105 +	{ 
   1.106 +	delete iAgentContent;
   1.107 +	iFile.Close();
   1.108 +	
   1.109 +	if(iVirtualPath)
   1.110 +		{
   1.111 +		delete iVirtualPath;
   1.112 +		}
   1.113 +	
   1.114 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   1.115 +	delete iHeaderData;
   1.116 +#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   1.117 +	
   1.118 +	// Finished with agent, this closes ECOM handle
   1.119 +	delete iAgentFactory;
   1.120 +	REComSession::FinalClose();
   1.121 +	}
   1.122 +
   1.123 +
   1.124 +void CContent::ConstructL(RFile &aFile) 
   1.125 +	{
   1.126 +	// Make our own copy of the file handle
   1.127 +	User::LeaveIfError(iFile.Duplicate(aFile));
   1.128 +	
   1.129 +	// Rewind the file pointer
   1.130 +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   1.131 +	TInt64 pos = 0;
   1.132 +#else
   1.133 +	TInt pos = 0;
   1.134 +#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   1.135 +
   1.136 +	iFile.Seek(ESeekStart, pos);
   1.137 +	
   1.138 +	// For case where CAF is built with an RFile
   1.139 +	CAgentResolver* resolver = CAgentResolver::NewLC(EFalse);
   1.140 +	
   1.141 +	// Find the agent who handles the file
   1.142 +	CAgentInfo& agentInfo = resolver->ResolveFileL(iFile);
   1.143 +
   1.144 +	// copy the agent name and Uid
   1.145 +	iAgent = agentInfo.Agent();
   1.146 +
   1.147 +	// Construct the agent factory (ECOM handle)
   1.148 +	iAgentFactory = CAgentFactory::NewL(iAgent.ImplementationUid());
   1.149 +
   1.150 +	// Construct the CAgentContent object
   1.151 +	iAgentContent = iAgentFactory->CreateContentBrowserL(iFile);
   1.152 +
   1.153 +	// Finished with resolver (and the agentInfo object it owns)
   1.154 +	CleanupStack::PopAndDestroy(resolver); 
   1.155 +	}
   1.156 +
   1.157 +void CContent::ConstructL(const TDesC& aURI, TContentShareMode aShareMode) 
   1.158 +	{
   1.159 +	iShareMode = aShareMode;
   1.160 +
   1.161 +	// Create the agent resolver which will contains a reference to
   1.162 +	// the agent responsible for this piece of content
   1.163 +	CAgentResolver* resolver = CAgentResolver::NewLC(EFalse);
   1.164 +	
   1.165 +	// Create a temporary buffer used to store the translated version of the URI
   1.166 +	HBufC* actualUri = HBufC::NewLC(aURI.Length() + KMaxSIDLength);
   1.167 +	TPtr uri = actualUri->Des();
   1.168 +	
   1.169 +	// Set the TVirtualPathPtr to point to the URI supplied, 
   1.170 +	// this will decode any combined URI into the actual URI and uniqueId
   1.171 +	// for use in subsequent functions
   1.172 +	TVirtualPathPtr contentVirtualPath = aURI;
   1.173 +
   1.174 +	// Find the agent who handles the file and translate the URI if it is pointing to a private directory 
   1.175 +	CAgentInfo& agentInfo = resolver->ResolveFileL(contentVirtualPath.URI(), uri, iShareMode);
   1.176 +
   1.177 +	// Set the iVirtualPath to point to the translated URI and the uniqueId
   1.178 +	iVirtualPath = CVirtualPath::NewL(*actualUri, contentVirtualPath.UniqueId());
   1.179 +	
   1.180 +	iDefaultVirtualPath = *iVirtualPath;
   1.181 +	
   1.182 +	// Copy the agent name and Uid
   1.183 +	iAgent = agentInfo.Agent();
   1.184 +
   1.185 +	// Construct the agent factory (ECOM handle)
   1.186 +	iAgentFactory = CAgentFactory::NewL(iAgent.ImplementationUid());
   1.187 +
   1.188 +	// Construct the agent content browser 
   1.189 +	iAgentContent = iAgentFactory->CreateContentBrowserL(uri, iShareMode);	
   1.190 +	
   1.191 +	// Finished with resolver and the CAgentInfo object it owns
   1.192 +	CleanupStack::PopAndDestroy(2, resolver); // actualUri
   1.193 +	}
   1.194 +
   1.195 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   1.196 +
   1.197 +void CContent::ConstructL(const TDesC8& aHeaderData) 
   1.198 +	{
   1.199 +	if(aHeaderData.Length() <= 0)
   1.200 +		{
   1.201 +		User::Leave(KErrMissingWmdrmHeaderData);
   1.202 +		}
   1.203 +	
   1.204 +	iHeaderData = aHeaderData.AllocL();
   1.205 +	
   1.206 +	CAgentResolver* resolver = CAgentResolver::NewLC(EFalse);
   1.207 +	
   1.208 +	// Find the agent who handles the file
   1.209 +	CAgentInfo& agentInfo = resolver->ResolveFileL(aHeaderData);
   1.210 +
   1.211 +	// copy the agent name and Uid
   1.212 +	iAgent = agentInfo.Agent();
   1.213 +
   1.214 +	// Construct the agent factory (ECOM handle)
   1.215 +	iAgentFactory = CAgentFactory::NewL(iAgent.ImplementationUid());
   1.216 +	// Construct the CAgentContent object
   1.217 +	iAgentContent = iAgentFactory->CreateContentBrowserL(aHeaderData);
   1.218 +
   1.219 +	// Finished with resolver (and the agentInfo object it owns)
   1.220 +	CleanupStack::PopAndDestroy(resolver); 
   1.221 +	}
   1.222 +
   1.223 +#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   1.224 +
   1.225 +EXPORT_C TInt CContent::OpenContainer(const TDesC &aUniqueId) 
   1.226 +	{
   1.227 +	return iAgentContent->OpenContainer(aUniqueId);
   1.228 +	}
   1.229 +
   1.230 +EXPORT_C TInt CContent::CloseContainer ()
   1.231 +	{
   1.232 +	return iAgentContent->CloseContainer();
   1.233 +	}
   1.234 +
   1.235 +EXPORT_C void CContent::GetEmbeddedObjectsL (RStreamablePtrArray<CEmbeddedObject>& aArray) const
   1.236 +	{
   1.237 +	iAgentContent->GetEmbeddedObjectsL(aArray);
   1.238 +	}
   1.239 +
   1.240 +EXPORT_C void CContent::GetEmbeddedObjectsL (RStreamablePtrArray<CEmbeddedObject>& aArray, TEmbeddedType aType) const
   1.241 +	{
   1.242 +	iAgentContent->GetEmbeddedObjectsL(aArray, aType);
   1.243 +	}
   1.244 +
   1.245 +EXPORT_C TInt  CContent::Search (RStreamablePtrArray<CEmbeddedObject>& aArray, const TDesC8 &aMimeType, TBool aRecursive) 
   1.246 +	{
   1.247 +	return iAgentContent->Search(aArray, aMimeType, aRecursive);
   1.248 +	}
   1.249 +
   1.250 +EXPORT_C TInt CContent::GetAttribute (TInt aAttribute, TInt &aValue) const
   1.251 +	{
   1.252 +	return GetAttribute(aAttribute, aValue, iDefaultVirtualPath.UniqueId());
   1.253 +	}
   1.254 +
   1.255 +EXPORT_C TInt CContent::GetAttribute (TInt aAttribute, TInt& aValue, const TDesC &aUniqueId) const
   1.256 +	{
   1.257 +	return iAgentContent->GetAttribute(aAttribute, aValue, aUniqueId);
   1.258 +	}
   1.259 +
   1.260 +EXPORT_C TInt CContent::GetAttributeSet(RAttributeSet& aAttributeSet) const
   1.261 +	{
   1.262 +	return GetAttributeSet(aAttributeSet, iDefaultVirtualPath.UniqueId());
   1.263 +	}
   1.264 +
   1.265 +EXPORT_C TInt CContent::GetAttributeSet(RAttributeSet& aAttributeSet, const TDesC& aUniqueId) const
   1.266 +	{
   1.267 +	return iAgentContent->GetAttributeSet(aAttributeSet, aUniqueId);
   1.268 +	}
   1.269 +
   1.270 +EXPORT_C TInt CContent::GetStringAttribute (TInt aAttribute, TDes &aValue) const
   1.271 +	{
   1.272 +	return GetStringAttribute(aAttribute, aValue, iDefaultVirtualPath.UniqueId());
   1.273 +	}
   1.274 +
   1.275 +EXPORT_C TInt CContent::GetStringAttribute (TInt aAttribute, TDes &aValue, const TDesC &aUniqueId) const
   1.276 +	{
   1.277 +	return iAgentContent->GetStringAttribute(aAttribute, aValue, aUniqueId);
   1.278 +	}
   1.279 +
   1.280 +EXPORT_C TInt CContent::GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet) const
   1.281 +	{
   1.282 +	return GetStringAttributeSet(aStringAttributeSet, iDefaultVirtualPath.UniqueId());
   1.283 +	}
   1.284 +
   1.285 +EXPORT_C TInt CContent::GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet, const TDesC& aUniqueId) const
   1.286 +	{
   1.287 +	return iAgentContent->GetStringAttributeSet(aStringAttributeSet, aUniqueId);
   1.288 +	}
   1.289 +
   1.290 +EXPORT_C TInt CContent::AgentSpecificCommand (TInt aCommand, const TDesC8 &aInputBuffer, TDes8 &aOutputBuffer) 
   1.291 +	{
   1.292 +	return iAgentContent->AgentSpecificCommand(aCommand, aInputBuffer, aOutputBuffer);
   1.293 +	}
   1.294 +
   1.295 +EXPORT_C void CContent::AgentSpecificCommand (TInt aCommand, const TDesC8 &aInputBuffer, TDes8 &aOutputBuffer, TRequestStatus &aStatus) 
   1.296 +	{
   1.297 +	iAgentContent->AgentSpecificCommand(aCommand, aInputBuffer, aOutputBuffer, aStatus);
   1.298 +	}
   1.299 +
   1.300 +EXPORT_C void CContent::NotifyStatusChange(TEventMask aMask, TRequestStatus &aStatus) 
   1.301 +	{
   1.302 +	NotifyStatusChange(aMask, aStatus, iDefaultVirtualPath.UniqueId());
   1.303 +	}
   1.304 +
   1.305 +EXPORT_C void CContent::NotifyStatusChange(TEventMask aMask, TRequestStatus &aStatus, const TDesC &aUniqueId) 
   1.306 +	{
   1.307 +	iAgentContent->NotifyStatusChange(aMask, aStatus, aUniqueId);
   1.308 +	}
   1.309 +
   1.310 +EXPORT_C TInt CContent::CancelNotifyStatusChange(TRequestStatus &aStatus) 
   1.311 +	{
   1.312 +	return CancelNotifyStatusChange(aStatus, iDefaultVirtualPath.UniqueId());
   1.313 +	}
   1.314 +
   1.315 +EXPORT_C TInt CContent::CancelNotifyStatusChange(TRequestStatus &aStatus, const TDesC &aUniqueId) 
   1.316 +	{
   1.317 +	return iAgentContent->CancelNotifyStatusChange(aStatus, aUniqueId);
   1.318 +	}
   1.319 +
   1.320 +EXPORT_C void  CContent::RequestRights(TRequestStatus &aStatus) 
   1.321 +	{
   1.322 +	RequestRights(aStatus, iDefaultVirtualPath.UniqueId());
   1.323 +	}
   1.324 +
   1.325 +EXPORT_C void  CContent::RequestRights(TRequestStatus &aStatus, const TDesC &aUniqueId) 
   1.326 +	{
   1.327 +	iAgentContent->RequestRights(aStatus, aUniqueId);
   1.328 +	}
   1.329 +
   1.330 +EXPORT_C TInt CContent::CancelRequestRights(TRequestStatus &aStatus)
   1.331 +	{
   1.332 +	return CancelRequestRights(aStatus, iDefaultVirtualPath.UniqueId());
   1.333 +	}
   1.334 +
   1.335 +EXPORT_C TInt CContent::CancelRequestRights(TRequestStatus &aStatus, const TDesC& aUniqueId)
   1.336 +	{
   1.337 +	return iAgentContent->CancelRequestRights(aStatus, aUniqueId);
   1.338 +	}
   1.339 +
   1.340 +EXPORT_C void CContent::DisplayInfoL(TDisplayInfo aInfo) const
   1.341 +	{
   1.342 +	DisplayInfoL(aInfo, iDefaultVirtualPath.UniqueId());
   1.343 +	}
   1.344 +
   1.345 +EXPORT_C void CContent::DisplayInfoL(TDisplayInfo aInfo, const TDesC& aUniqueId) const
   1.346 +	{
   1.347 +	iAgentContent->DisplayInfoL(aInfo, aUniqueId);
   1.348 +	}
   1.349 +
   1.350 +EXPORT_C TInt CContent::SetProperty(TAgentProperty aProperty, TInt aValue) 
   1.351 +	{
   1.352 +	return iAgentContent->SetProperty(aProperty, aValue);
   1.353 +	}
   1.354 +
   1.355 +EXPORT_C CData* CContent::OpenContentL(TIntent aIntent)
   1.356 +	{
   1.357 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   1.358 +	if(iHeaderData != NULL)
   1.359 +		return OpenContentL(aIntent, *iHeaderData);
   1.360 +    else
   1.361 +		return OpenContentL(aIntent, iDefaultVirtualPath.UniqueId());
   1.362 +#else
   1.363 +	return OpenContentL(aIntent, iDefaultVirtualPath.UniqueId());
   1.364 +#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   1.365 +	}
   1.366 +
   1.367 +EXPORT_C CData* CContent::OpenContentLC(TIntent aIntent)
   1.368 +	{
   1.369 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   1.370 +	if(iHeaderData != NULL)
   1.371 +		return OpenContentLC(aIntent, *iHeaderData);
   1.372 +	else
   1.373 +		return OpenContentLC(aIntent, iDefaultVirtualPath.UniqueId());
   1.374 +#else
   1.375 +	return OpenContentLC(aIntent, iDefaultVirtualPath.UniqueId());
   1.376 +#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   1.377 +	}
   1.378 +
   1.379 +EXPORT_C CData* CContent::OpenContentL(TIntent aIntent, const TDesC &aUniqueId)
   1.380 +	{
   1.381 +	CData* data = OpenContentLC(aIntent, aUniqueId);
   1.382 +	CleanupStack::Pop(data);
   1.383 +	return data;
   1.384 +	}
   1.385 +
   1.386 +EXPORT_C CData* CContent::OpenContentLC(TIntent aIntent, const TDesC &aUniqueId)
   1.387 +	{
   1.388 +	// Open the content object specified by the Unique Id
   1.389 +	if(iVirtualPath)
   1.390 +		{
   1.391 +		// create a CData based upon the URI supplied when this CContent was created
   1.392 +		return CData::NewLC(iAgent.ImplementationUid(), TVirtualPathPtr(iDefaultVirtualPath.URI(), aUniqueId), aIntent, iShareMode);
   1.393 +		}
   1.394 +	else
   1.395 +		{
   1.396 +		// create a CData based upon the file handle supplied when this CContent was created
   1.397 +		return CData::NewLC(iAgent.ImplementationUid(), iFile, aUniqueId, aIntent);
   1.398 +		}
   1.399 +	}
   1.400 +	
   1.401 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   1.402 +
   1.403 +CData* CContent::OpenContentL(TIntent aIntent, const TDesC8& aHeaderData)
   1.404 +	{
   1.405 +	CData* data = OpenContentLC(aIntent, aHeaderData);
   1.406 +	CleanupStack::Pop(data);
   1.407 +	return data;
   1.408 +	}
   1.409 +
   1.410 +CData* CContent::OpenContentLC(TIntent aIntent, const TDesC8& aHeaderData)
   1.411 +	{
   1.412 +	return CData::NewLC(iAgent.ImplementationUid(), aHeaderData, aIntent);
   1.413 +	}
   1.414 +	
   1.415 +#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   1.416 +
   1.417 +EXPORT_C const TAgent& CContent::Agent() const
   1.418 +	{
   1.419 +	// The agent handling this content
   1.420 +	return iAgent;
   1.421 +	}
   1.422 +
   1.423 +#ifndef REMOVE_CAF1 
   1.424 +// Deprecated functions
   1.425 +
   1.426 +EXPORT_C CData* CContent::OpenContentL(TIntent aIntent, TContentShareMode aShareMode)
   1.427 +	{
   1.428 +	CData* data = NULL;
   1.429 +	// Open the content object specified by the Unique Id
   1.430 +	if(iVirtualPath)
   1.431 +		{
   1.432 +		// create a CData based upon the URI supplied when this CContent was created
   1.433 +		data = CData::NewLC(iAgent.ImplementationUid(), iDefaultVirtualPath, aIntent, aShareMode);
   1.434 +		}
   1.435 +	else
   1.436 +		{
   1.437 +		// create a CData based upon the file handle supplied when this CContent was created
   1.438 +		data = CData::NewLC(iAgent.ImplementationUid(), iFile, iDefaultVirtualPath.UniqueId(), aIntent);
   1.439 +		}
   1.440 +	CleanupStack::Pop(data);
   1.441 +	return data;
   1.442 +	}
   1.443 +
   1.444 +EXPORT_C CAttribute* CContent::NewAttributeL(TBool aPreloaded)
   1.445 +	{
   1.446 +	return NewAttributeL(aPreloaded, EContentShareReadOnly);
   1.447 +	}
   1.448 +
   1.449 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   1.450 +EXPORT_C CAttribute* CContent::NewAttributeL(TBool aPreloaded, TContentShareMode aShareMode)
   1.451 +	{
   1.452 +	CAttribute* attr = NULL;
   1.453 +	
   1.454 +	if(iVirtualPath)
   1.455 +		{
   1.456 +		// if we were opened with a file name
   1.457 +		attr = CAttribute::NewLC(iAgent.ImplementationUid(), iDefaultVirtualPath.URI(), aShareMode);
   1.458 +		}
   1.459 +	else if(iHeaderData)
   1.460 +		{
   1.461 +		attr = CAttribute::NewLC(iAgent.ImplementationUid(), *iHeaderData);
   1.462 +		}
   1.463 +	else
   1.464 +		{
   1.465 +		// if we were opened with a file handle 
   1.466 +		attr = CAttribute::NewLC(iAgent.ImplementationUid(), iFile);
   1.467 +		}
   1.468 +
   1.469 +	// If aPreloaded is set, query the agent immediately for all the attributes
   1.470 +	if (aPreloaded)
   1.471 +		{
   1.472 +		attr->QuerySet().SetAll();
   1.473 +		attr->GetL();
   1.474 +		}
   1.475 +
   1.476 +	CleanupStack::Pop(attr);
   1.477 +	return attr;
   1.478 +	}
   1.479 +
   1.480 +#else
   1.481 +
   1.482 +EXPORT_C CAttribute* CContent::NewAttributeL(TBool aPreloaded, TContentShareMode aShareMode)
   1.483 +	{
   1.484 +	CAttribute* attr = NULL;
   1.485 +	
   1.486 +	if(iVirtualPath)
   1.487 +		{
   1.488 +		// if we were opened with a file name
   1.489 +		attr = CAttribute::NewLC(iAgent.ImplementationUid(), iDefaultVirtualPath.URI(), aShareMode);
   1.490 +		}
   1.491 +	else
   1.492 +		{
   1.493 +		// if we were opened with a file handle 
   1.494 +		attr = CAttribute::NewLC(iAgent.ImplementationUid(), iFile);
   1.495 +		}
   1.496 +
   1.497 +	// If aPreloaded is set, query the agent immediately for all the attributes
   1.498 +	if (aPreloaded)
   1.499 +		{
   1.500 +		attr->QuerySet().SetAll();
   1.501 +		attr->GetL();
   1.502 +		}
   1.503 +
   1.504 +	CleanupStack::Pop(attr);
   1.505 +	return attr;
   1.506 +	}
   1.507 +
   1.508 +#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
   1.509 +
   1.510 +#endif // REMOVE_CAF1
   1.511 +
   1.512 +// DLL entry point - only for EKA1
   1.513 +
   1.514 +
   1.515 +
   1.516 +