1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/contentmgmt/contentaccessfwfordrm/inc/content.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,1065 @@
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 +/**
1.23 +@file
1.24 +
1.25 +@publishedAll
1.26 +@released
1.27 +*/
1.28 +
1.29 +
1.30 +#ifndef __CONTENT_H__
1.31 +#define __CONTENT_H__
1.32 +
1.33 +#include <e32base.h>
1.34 +#include <f32file.h>
1.35 +
1.36 +#include <caf/caftypes.h>
1.37 +#include <caf/agent.h>
1.38 +#include <caf/streamableptrarray.h>
1.39 +#include <caf/virtualpathptr.h>
1.40 +
1.41 +namespace ContentAccess
1.42 + {
1.43 + class CAgentResolver;
1.44 + class CAgentFactory;
1.45 + class CAgentContent;
1.46 + class CData;
1.47 + class CEmbeddedObject;
1.48 + class RAttributeSet;
1.49 + class RStringAttributeSet;
1.50 +
1.51 +
1.52 +
1.53 +#ifndef REMOVE_CAF1
1.54 + class CAttribute;
1.55 +#endif
1.56 +
1.57 +
1.58 +/**
1.59 + CContent allows applications to browse the content objects contained within a
1.60 + single file and construct a CData object for reading that content.
1.61 +
1.62 + Applications will use an object of this type rather than the traditional
1.63 + RFile mechanisms. They will, however, be required to indicate
1.64 + <i>DRM Intent</i> - something that determines whether (and how) access to
1.65 + the content should be permitted by a Content-Access agent.
1.66 +
1.67 + CContent allows direct access to meta-data such as the attributes of
1.68 + the content and indirect access to the plaintext data itself through
1.69 + the CData class.
1.70 +
1.71 + Applications can use CContent to browse the hierarchy of content objects
1.72 + within a file containing several content objects.
1.73 +
1.74 + During construction CContent loads the correct CAF Agent plugin to handle
1.75 + the file specified by the URI.
1.76 + */
1.77 + class CContent : public CBase
1.78 + {
1.79 + public:
1.80 +
1.81 + /**
1.82 + Constructs a new CContent object with a given URI. The URI can be in the same format as a virtual path for more information see CVirtualPath and TVirtualPathPtr
1.83 +
1.84 + @param aURI The filename, URI or virtual path of the DRM file.
1.85 + @return a new CContent object.
1.86 + @leave KErrNotFound If the file at the given URI does not exist or if an invalid URI or virtual path have been supplied.
1.87 + @leave KErrPermissionDenied If the access to the protected content is not permitted by the CAF Agent.
1.88 + @leave ... One of the CAF error codes defined in \c caferr.h or one of the
1.89 + other system-wide error codes for any other errors.
1.90 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.91 + */
1.92 + IMPORT_C static CContent* NewLC(const TDesC& aURI);
1.93 +
1.94 + /**
1.95 + Constructs a new CContent object with a given URI. The URI can be in the same format as a virtual path for more information see CVirtualPath and TVirtualPathPtr
1.96 +
1.97 + @param aURI The filename, URI or virtual path of the DRM file.
1.98 + @return a new CContent object.
1.99 + @leave KErrNotFound If the file at the given URI does not exist or if an invalid URI or virtual path have been supplied.
1.100 + @leave KErrPermissionDenied If the access to the protected content is not permitted by the CAF Agent.
1.101 + @leave ... One of the CAF error codes defined in \c caferr.h or one of the
1.102 + other system-wide error codes for any other errors.
1.103 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.104 + */
1.105 + IMPORT_C static CContent* NewL(const TDesC& aURI);
1.106 +
1.107 + /**
1.108 + Constructs a new CContent object with a given URI. The URI can be in the same format as a virtual path for more information see CVirtualPath and TVirtualPathPtr
1.109 +
1.110 + @param aURI The filename, URI or virtual path of the DRM file.
1.111 + @param aShareMode The sharing mode used when accessing the content.
1.112 + @return a new CContent object.
1.113 + @leave KErrNotFound If the file at the given URI does not exist or if an invalid URI or virtual path have been supplied.
1.114 + @leave KErrAccessDenied If the file is already open with a different share mode.
1.115 + @leave KErrPermissionDenied If the access to the protected content is not permitted by the CAF Agent.
1.116 + @leave ... One of the CAF error codes defined in \c caferr.h or one of the
1.117 + other system-wide error codes for any other errors.
1.118 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.119 + */
1.120 + IMPORT_C static CContent* NewLC(const TDesC& aURI, TContentShareMode aShareMode);
1.121 +
1.122 + /**
1.123 + Constructs a new CContent object with a given URI. The URI can be in the same format as a virtual path for more information see CVirtualPath and TVirtualPathPtr
1.124 +
1.125 + @param aURI The filename, URI or virtual path of the DRM file.
1.126 + @param aShareMode The sharing mode used when accessing the content.
1.127 + @return a new CContent object.
1.128 + @leave KErrNotFound If the file at the given URI does not exist or if an invalid URI or virtual path have been supplied.
1.129 + @leave KErrAccessDenied If the file is already open with a different share mode.
1.130 + @leave KErrPermissionDenied If the access to the protected content is not permitted by the CAF Agent.
1.131 + @leave ... One of the CAF error codes defined in \c caferr.h or one of the
1.132 + other system-wide error codes for any other errors.
1.133 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.134 + */
1.135 + IMPORT_C static CContent* NewL(const TDesC& aURI, TContentShareMode aShareMode);
1.136 +
1.137 + /**
1.138 + Constructs a new CContent object with an open file handle.
1.139 +
1.140 + CContent will use a duplicate of this file handle, the client is
1.141 + free to close its file handle any time after creating the CContent
1.142 + object.
1.143 +
1.144 + @param aFile The file handle. The file must already be open before calling NewLC.
1.145 + The underlying RFs session should be shared for transfer to other processes using RFs::ShareProtected(), since the agent may use transfer this handle to its own or one of the system servers.
1.146 + @return a new CContent object.
1.147 + @leave KErrPermissionDenied If the access to the protected content is not permitted by the CAF Agent.
1.148 + @leave ... One of the CAF error codes defined in \c caferr.h or one of the
1.149 + other system-wide error codes for any other errors.
1.150 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.151 + */
1.152 + IMPORT_C static CContent* NewLC(RFile& aFile);
1.153 +
1.154 + /**
1.155 + Constructs a new CContent object with an open file handle.
1.156 +
1.157 + CContent will use a duplicate of this file handle, the client is
1.158 + free to close its file handle any time after creating the CContent
1.159 + object.
1.160 +
1.161 + @param aFile The file handle. The file must already be open before calling this method.
1.162 + The underlying RFs session should be shared for transfer to other processes using RFs::ShareProtected(), since the agent may use transfer this handle to its own or one of the system servers.
1.163 + @return a new CContent object.
1.164 + @leave KErrPermissionDenied If the access to the protected content is not permitted by the CAF Agent.
1.165 + @leave ... One of the CAF error codes defined in \c caferr.h or one of the
1.166 + other system-wide error codes for any other errors.
1.167 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.168 + */
1.169 + IMPORT_C static CContent* NewL(RFile& aFile);
1.170 +
1.171 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.172 + /**
1.173 + Constructs a new CContent object.
1.174 +
1.175 + @param aHeaderData Header data of WMDRM file/stream content.
1.176 + @return CContent object.
1.177 + @leave KErrMissingHeaderData if the header data is NULL or one of the CAF error codes defined in caferr.h
1.178 + or one of the system-wide error codes for any other errors.
1.179 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.180 + */
1.181 + IMPORT_C static CContent* NewL(const TDesC8& aHeaderData);
1.182 +
1.183 + /**
1.184 + Constructs a new CContent object.
1.185 +
1.186 + @param aHeaderData Header data of WMDRM file/stream content.
1.187 + @return CContent object.
1.188 + @leave KErrMissingHeaderData if the header data is NULL or one of the CAF error codes defined in caferr.h or one of the
1.189 + system-wide error codes for any other errors.
1.190 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.191 + */
1.192 + IMPORT_C static CContent* NewLC(const TDesC8& aHeaderData);
1.193 +
1.194 +#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.195 +
1.196 + /** destructor */
1.197 + virtual ~CContent();
1.198 +
1.199 + /** Open a Container object within the file.
1.200 +
1.201 + Allows an application to access the content objects and
1.202 + any nested container objects within the specified container.
1.203 +
1.204 + @param aUniqueId The container object's unique ID.
1.205 + @return Whether the container was opened.
1.206 + @return KErrNone if the container was opened successfully.
1.207 + @return KErrNotFound if the container does not exist.
1.208 + @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
1.209 + @return Otherwise one of the CAF error codes defined in \c caferr.h or one of the
1.210 + other system-wide error codes for any other errors.
1.211 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.212 + */
1.213 + IMPORT_C TInt OpenContainer(const TDesC& aUniqueId);
1.214 +
1.215 + /** Close the current container object and go back to previous enclosing
1.216 + container within the file.
1.217 +
1.218 + Allows an application to access the content objects and
1.219 + any nested container objects within parent container.
1.220 +
1.221 + @return Whether the container was closed.
1.222 + @return KErrNone if the container was closed.
1.223 + @return KErrNotFound if there is no enclosing container.
1.224 + @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
1.225 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.226 + */
1.227 + IMPORT_C TInt CloseContainer();
1.228 +
1.229 + /** List all the embedded container objects and content objects within the
1.230 + current container
1.231 +
1.232 + The UniqueId() member of CEmbeddedObject can be used to refer directly to
1.233 + a particular object within the file.
1.234 +
1.235 + @code
1.236 + // Create a ccontent object for the file of interest
1.237 + CContent* content = CContent::NewLC(uri);
1.238 +
1.239 + // Define an array to store the results
1.240 + RStreamablePtrArray <CEmbeddedObject> array;
1.241 + CleanupClosePushL(array);
1.242 +
1.243 + // Find all the content and container objects within the current container
1.244 + content->GetEmbeddedObjectsL(array);
1.245 +
1.246 + // Do something with the array
1.247 + ....
1.248 +
1.249 + // Finished
1.250 + CleanupStack::PopAndDestroy(2);
1.251 + @endcode
1.252 +
1.253 + @param aArray The array to be populated with the embedded objects.
1.254 + @leave KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
1.255 + @leave ... One of the CAF error codes defined in \c caferr.h or one of the
1.256 + other system-wide error codes for any other errors.
1.257 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.258 + */
1.259 + IMPORT_C void GetEmbeddedObjectsL(RStreamablePtrArray<CEmbeddedObject>& aArray) const;
1.260 +
1.261 + /** List all the embedded objects within the current container that
1.262 + are of the specified type
1.263 +
1.264 + @code
1.265 + // Create a ccontent object for the file of interest
1.266 + CContent* content = CContent::NewLC(uri);
1.267 +
1.268 + // Define an array to store the results
1.269 + RStreamablePtrArray <CEmbeddedObject> array;
1.270 + CleanupClosePushL(array);
1.271 +
1.272 + // Find all the content objects within the current container
1.273 + content->GetEmbeddedObjectsL(array, EContentObject);
1.274 +
1.275 + // Do something with the array
1.276 + ....
1.277 +
1.278 + // Finished
1.279 + CleanupStack::PopAndDestroy(2);
1.280 + @endcode
1.281 +
1.282 + @param aArray The array to be populated with the embedded objects.
1.283 + @param aType The type of objects to list.
1.284 + @leave KErrPermissionDenied If the access to the protected content is not permitted by the CAF Agent.
1.285 + @leave ... One of the CAF error codes defined in \c caferr.h or one of the
1.286 + other system-wide error codes for any other errors.
1.287 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.288 + */
1.289 + IMPORT_C void GetEmbeddedObjectsL(RStreamablePtrArray<CEmbeddedObject>& aArray, TEmbeddedType aType) const;
1.290 +
1.291 + /** Search the current container for content objects with a particular mime type
1.292 +
1.293 + @code
1.294 + _LIT8(KTextPlainMimeType, "text/plain");
1.295 +
1.296 + // Create a ccontent object for the file of interest
1.297 + CContent* content = CContent::NewLC(uri);
1.298 +
1.299 + // Define an array to store the results
1.300 + RStreamablePtrArray <CEmbeddedObject> array;
1.301 + CleanupClosePushL(array);
1.302 +
1.303 + // Recursively search for all the content objects with the
1.304 + // specified mime type
1.305 + User::LeaveIfError(content->Search(array, KTextPlainMimeType(), ETrue));
1.306 +
1.307 + // Do something with the array
1.308 + ....
1.309 +
1.310 + // Finished
1.311 + CleanupStack::PopAndDestroy(2);
1.312 + @endcode
1.313 +
1.314 + @param aArray The array to store the results of the search. The agent will add CEmbeddedObject objects to the supplied array.
1.315 + @param aMimeType The mime type to search for.
1.316 + @param aRecursive ETrue to search inside containers embedded within the current container, EFalse to search only the current container.
1.317 + @return The result of the search.
1.318 + @return KErrNone if the search was successful, even if no content objects were found.
1.319 + @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
1.320 + @return Otherwise one of the CAF error codes defined in \c caferr.h or one of the
1.321 + other system-wide error codes for any other errors.
1.322 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.323 + */
1.324 + IMPORT_C TInt Search(RStreamablePtrArray<CEmbeddedObject>& aArray, const TDesC8& aMimeType, TBool aRecursive);
1.325 +
1.326 +
1.327 + /** Get an attribute for the default content object within the file
1.328 +
1.329 + @see ContentAccess::TAttribute
1.330 +
1.331 + @code
1.332 + TInt value = 0;
1.333 + CContent* c = CContent::NewL(uri);
1.334 + TInt err =c->GetAttribute(EIsProtected, value);
1.335 + if(err == KErrNone && value)
1.336 + {
1.337 + DisplayPadLock();
1.338 + }
1.339 + @endcode
1.340 +
1.341 + @param aAttribute The attribute to query, from ContentAccess::TAttribute.
1.342 + @param aValue Used to return the attribute value.
1.343 + @return Whether the attribute value was updated.
1.344 + @return KErrNone if the value of the attribute was updated.
1.345 + @return KErrNotFound if the object with the given UniqueId was not found.
1.346 + @return KErrCANotSupported if the requested attribute does not exist.
1.347 + @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
1.348 + @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1.349 + other system-wide error codes for any other errors.
1.350 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1.351 + */
1.352 + IMPORT_C TInt GetAttribute(TInt aAttribute, TInt& aValue) const;
1.353 +
1.354 + /** Get an attribute for an object within the file
1.355 +
1.356 + @see ContentAccess::TAttribute
1.357 +
1.358 + @code
1.359 + TInt value = 0;
1.360 + CContent* c = CContent::NewL(uri);
1.361 + TInt err =c->GetAttribute(EIsProtected, value, uniqueId);
1.362 + if(err == KErrNone && value)
1.363 + {
1.364 + DisplayPadLock();
1.365 + }
1.366 + @endcode
1.367 +
1.368 + @param aAttribute The attribute to query, from ContentAccess::TAttribute.
1.369 + @param aValue Used to return the attribute value.
1.370 + @param aUniqueId The UniqueId of the object within the file.
1.371 + @return Whether the attribute value was updated.
1.372 + @return KErrNone if the value of the attribute was updated.
1.373 + @return KErrNotFound if the object with the given UniqueId was not found.
1.374 + @return KErrCANotSupported if the requested attribute does not exist.
1.375 + @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
1.376 + @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1.377 + other system-wide error codes for any other errors.
1.378 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1.379 + */
1.380 + IMPORT_C TInt GetAttribute(TInt aAttribute, TInt& aValue, const TDesC& aUniqueId) const;
1.381 +
1.382 +
1.383 + /** Get a set of attributes for the default content object within the file
1.384 +
1.385 + @see ContentAccess::TAttribute
1.386 +
1.387 + The following example determines whether the default content object
1.388 + is protected and has rights that will enable it to be viewed by the
1.389 + user
1.390 +
1.391 + @code
1.392 + CContent* content = CContent::NewLC(uri);
1.393 +
1.394 + RAttributeSet attributeSet;
1.395 + CleanupClosePushL(attributeSet);
1.396 + attributeSet->AddL(EProtected);
1.397 + attributeSet->AddL(ECanView);
1.398 +
1.399 + User::LeaveIfError(content->GetAttributeSet(attributeSet);
1.400 +
1.401 + TInt err = attributeSet.GetValue(EProtected, value);
1.402 + if(err == KErrNone && value)
1.403 + {
1.404 + // file is DRM protected
1.405 + }
1.406 +
1.407 + err = attributeSet.GetValue(ECanView, value);
1.408 + if(err == KErrNone && value)
1.409 + {
1.410 + // File has rights that allow it to be displayed on screen
1.411 + }
1.412 +
1.413 + // Finished
1.414 + CleanupStack::PopAndDestroy(2); // content, attributeSet.Close()
1.415 + @endcode
1.416 +
1.417 +
1.418 + @param aAttributeSet The set of attributes to query and update.
1.419 + @return Whether the attribute set was updated.
1.420 + @return KErrNone if the attributes were retrieved successfully.
1.421 + @return KErrNotFound if the default content object was not found.
1.422 + @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
1.423 + @return Otherwise one of the CAF error codes defined in \c caferr.h or one of the
1.424 + other system-wide error codes for any other errors.
1.425 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1.426 + */
1.427 + IMPORT_C TInt GetAttributeSet(RAttributeSet& aAttributeSet) const;
1.428 +
1.429 + /** Get a set of attributes from an object within the file
1.430 +
1.431 + @see ContentAccess::TAttribute
1.432 +
1.433 + The following example determines whether the default content object
1.434 + is protected and has rights that will enable it to be viewed by the
1.435 + user
1.436 +
1.437 + @code
1.438 + CContent* content = CContent::NewLC(uri);
1.439 +
1.440 + RAttributeSet attributeSet;
1.441 + CleanupClosePushL(attributeSet);
1.442 + attributeSet->AddL(EProtected);
1.443 + attributeSet->AddL(ECanView);
1.444 +
1.445 + User::LeaveIfError(content->GetAttributeSet(attributeSet, uniqueId);
1.446 +
1.447 + TInt err = attributeSet.GetValue(EProtected, value);
1.448 + if(err == KErrNone && value)
1.449 + {
1.450 + // file is DRM protected
1.451 + }
1.452 +
1.453 + err = attributeSet.GetValue(ECanView, value);
1.454 + if(err == KErrNone && value)
1.455 + {
1.456 + // File has rights that allow it to be displayed on screen
1.457 + }
1.458 +
1.459 + // Finished
1.460 + CleanupStack::PopAndDestroy(2); // content, attributeSet.Close()
1.461 + @endcode
1.462 +
1.463 +
1.464 + @param aAttributeSet The set of attributes to query and update.
1.465 + @param aUniqueId The unique ID of the object within the file.
1.466 + @return Whether that attribute set was updated.
1.467 + @return KErrNone if the attributes were retrieved successfully.
1.468 + @return KErrNotFound if the default content object was not found.
1.469 + @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
1.470 + @return Otherwise one of the CAF error codes defined in \c caferr.h or one of the
1.471 + other system-wide error codes for any other errors.
1.472 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1.473 + */
1.474 + IMPORT_C TInt GetAttributeSet(RAttributeSet& aAttributeSet, const TDesC& aUniqueId) const;
1.475 +
1.476 + /** Get text string attributes or meta-data for the default content object within the file
1.477 +
1.478 + @see ContentAccess::TStringAttribute
1.479 +
1.480 + @code
1.481 + TInt err = KErrNone;
1.482 +
1.483 + CContent* c = CContent::NewL(uri);
1.484 + TBuf <MAX_PATH> previewUri;
1.485 + err = c->GetStringAttribute(EPreviewURI, previewUri);
1.486 + if(err == KErrNone)
1.487 + {
1.488 + DisplayPreview(previewUri);
1.489 + }
1.490 + @endcode
1.491 +
1.492 + @param aAttribute The attribute to query, from ContentAccess::TStringAttribute.
1.493 + @param aValue Returns the value of the attribute.
1.494 + @return Whether the attribute value was updated.
1.495 + @return KErrNone if the attribute was retrieved.
1.496 + @return KErrNotFound if the default content object was not found.
1.497 + @return KErrOverflow if the buffer was not large enough to return the result.
1.498 + @return KErrCANotSupported if the requested attribute does not exist.
1.499 + @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
1.500 + @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1.501 + other system-wide error codes for any other errors.
1.502 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1.503 + */
1.504 + IMPORT_C TInt GetStringAttribute(TInt aAttribute, TDes& aValue) const;
1.505 +
1.506 + /** Get text string attributes or meta-data for an object within the file
1.507 +
1.508 + @see ContentAccess::TStringAttribute
1.509 +
1.510 + @code
1.511 + TInt err = KErrNone;
1.512 +
1.513 + CContent* c = CContent::NewL(uri);
1.514 + TBuf <MAX_PATH> previewUri;
1.515 + err = c->GetStringAttribute(EPreviewURI, previewUri, uniqueId);
1.516 + if(err == KErrNone)
1.517 + {
1.518 + DisplayPreview(previewUri);
1.519 + }
1.520 + @endcode
1.521 +
1.522 + @param aAttribute The attribute to query, from ContentAccess::TStringAttribute.
1.523 + @param aValue Returns the value of the attribute.
1.524 + @param aUniqueId The UniqueId of the object within the file.
1.525 + @return Whether the attribute value was updated.
1.526 + @return KErrNone if the attribute was retrieved.
1.527 + @return KErrNotFound if the object with the given UniqueId was not found.
1.528 + @return KErrOverflow if the buffer was not large enough to return the result.
1.529 + @return KErrCANotSupported if the requested attribute does not exist.
1.530 + @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
1.531 + @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1.532 + other system-wide error codes for any other errors.
1.533 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1.534 + */
1.535 + IMPORT_C TInt GetStringAttribute(TInt aAttribute, TDes& aValue, const TDesC& aUniqueId) const;
1.536 +
1.537 + /** Obtain a set of string attributes for the default content object within the file
1.538 +
1.539 + @see ContentAccess::TStringAttribute
1.540 +
1.541 + @code
1.542 + CContent* content = CContent::NewLC(uri);
1.543 +
1.544 + // create the attribute set, add the attributes we are interested in
1.545 + RStringAttributeSet stringAttributeSet;
1.546 + CleanupClosePushL(stringAttributeSet);
1.547 + stringAttributeSet.AddL(EPreviewURI);
1.548 + stringAttributeSet.AddL(ETitle);
1.549 +
1.550 + User::LeaveIfError(content->GetStringAttributeSet(stringAttributeSet));
1.551 +
1.552 + // Pass the value of the string attribute to DisplayPreview()
1.553 + TFileName previewUri;
1.554 + TInt err = stringAttributeSet.GetValue(EPreviewURI, previewUri);
1.555 + if(err == KErrNone)
1.556 + {
1.557 + DisplayPreview(previewUri);
1.558 + }
1.559 +
1.560 + CleanupStack::PopAndDestroy(2); // content, stringAttributeSet.Close()
1.561 + @endcode
1.562 +
1.563 +
1.564 + @param aStringAttributeSet The set of attributes to query and update.
1.565 + @return Whether the attribute set was updated.
1.566 + @return KErrNone if the attributes were retrieved successfully.
1.567 + @return KErrNotFound if the default content object was not found.
1.568 + @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
1.569 + @return Otherwise one of the CAF error codes defined in \c caferr.h or one of the
1.570 + other system-wide error codes for any other errors.
1.571 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1.572 + */
1.573 + IMPORT_C TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet) const;
1.574 +
1.575 + /** Used to obtain a set of string attributes for an object within the file
1.576 +
1.577 + @see ContentAccess::TStringAttribute
1.578 +
1.579 + @code
1.580 + CContent* content = CContent::NewLC(uri);
1.581 +
1.582 + // create the attribute set, add the attributes we are interested in
1.583 + RStringAttributeSet stringAttributeSet;
1.584 + CleanupClosePushL(stringAttributeSet);
1.585 + stringAttributeSet.AddL(EPreviewURI);
1.586 + stringAttributeSet.AddL(ETitle);
1.587 +
1.588 + User::LeaveIfError(content->GetStringAttributeSet(stringAttributeSet, uniqueId));
1.589 +
1.590 + // Pass the value of the string attribute to DisplayPreview()
1.591 + TFileName previewUri;
1.592 + TInt err = stringAttributeSet.GetValue(EPreviewURI, previewUri);
1.593 + if(err == KErrNone)
1.594 + {
1.595 + DisplayPreview(previewUri);
1.596 + }
1.597 +
1.598 + CleanupStack::PopAndDestroy(2); // content, stringAttributeSet.Close()
1.599 + @endcode
1.600 +
1.601 +
1.602 + @param aStringAttributeSet The set of attributes to query and update.
1.603 + @param aUniqueId The UniqueId of the container or content.
1.604 + @return Whether the attribute set was updated.
1.605 + @return KErrNone if the attributes were retrieved successfully.
1.606 + @return KErrNotFound if the object with the given UniqueId was not found.
1.607 + @return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
1.608 + @return Otherwise one of the CAF error codes defined in \c caferr.h or one of the
1.609 + other system-wide error codes for any other errors.
1.610 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1.611 + */
1.612 + IMPORT_C TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet, const TDesC& aUniqueId) const;
1.613 +
1.614 + /** Allows extended synchronous calls to the CAF agent handling this file
1.615 +
1.616 + Applications familiar with the agent can pass objects in and out using serialization.
1.617 +
1.618 + @param aCommand The agent defined command.
1.619 + @param aInputBuffer Non modifyable input data buffer.
1.620 + @param aOutputBuffer Modifyable output buffer to hold the result of the command.
1.621 + @return The outcome of the agent specific command.
1.622 + @return KErrCANotSupported if the agent does not recognize the command.
1.623 + @return KErrOverflow if the output buffer supplied is too small.
1.624 + @return KErrPermissionDenied if the agent does not allow the client to execute the command.
1.625 + @return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
1.626 + other system-wide error codes for any other errors.
1.627 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.628 + */
1.629 + IMPORT_C TInt AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer);
1.630 +
1.631 + /** Allows extended synchronous calls to the CAF agent handling this file
1.632 + Applications familiar with the agent can pass objects in and out using serialization.
1.633 + NB: It is important that the descriptor passed to
1.634 + aOutputBuffer remains in scope until the request has completed.
1.635 +
1.636 + @param aCommand The agent defined command.
1.637 + @param aInputBuffer Non modifyable input data buffer.
1.638 + @param aOutputBuffer Modifyable output buffer to hold the result of the command.
1.639 + @param aStatus Asynchronous request status. On completion this will contain
1.640 + one of the following error codes:
1.641 + KErrNone if the command was successfully executed.
1.642 + KErrCANotSupported if the agent does not recognize the command.
1.643 + KErrOverflow if the output buffer supplied is too small.
1.644 + KErrPermissionDenied if the agent does not allow the client
1.645 + to execute the command. Otherwise one of the other CAF error codes defined
1.646 + in \c caferr.h or one of the other system-wide error codes
1.647 + for any other errors.
1.648 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.649 + */
1.650 + IMPORT_C void AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer, TRequestStatus& aStatus);
1.651 +
1.652 +
1.653 + /** Request notification for an event for the default content object within the file
1.654 +
1.655 + @see ContentAccess::TEventMask
1.656 +
1.657 + @param aMask Bitmask of events the caller is interested in.
1.658 + @param aStatus The TRequestStatus object to complete if the event occurs.
1.659 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.660 + */
1.661 + IMPORT_C void NotifyStatusChange(TEventMask aMask, TRequestStatus& aStatus);
1.662 +
1.663 + /** Request notification for an event for an object within the file
1.664 +
1.665 + @see ContentAccess::TEventMask
1.666 +
1.667 + @param aMask Bitmask of events the caller is interested in.
1.668 + @param aStatus The TRequestStatus object to complete if the event occurs.
1.669 + @param aUniqueId The UniqueId of the container or content.
1.670 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.671 + */
1.672 + IMPORT_C void NotifyStatusChange(TEventMask aMask, TRequestStatus& aStatus, const TDesC& aUniqueId);
1.673 +
1.674 + /** Cancel a previous notification request for the default content object
1.675 +
1.676 + @param aStatus The TRequestStatus supplied in the call to NotifyStatusChange().
1.677 + @return The outcome of the cancel request.
1.678 + @return KErrNone if the request was cancelled.
1.679 + @return KErrNotFound if there was no matching request outstanding.
1.680 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.681 + */
1.682 + IMPORT_C TInt CancelNotifyStatusChange(TRequestStatus& aStatus);
1.683 +
1.684 + /** Cancel a previous notification request
1.685 +
1.686 + @param aStatus The TRequestStatus supplied in the call to NotifyStatusChange().
1.687 + @param aUniqueId The UniqueId of the content object within the file.
1.688 + @return The outcome of the cancel request.
1.689 + @return KErrNone if the request was cancelled.
1.690 + @return KErrNotFound if there was no matching request outstanding.
1.691 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.692 + */
1.693 + IMPORT_C TInt CancelNotifyStatusChange(TRequestStatus& aStatus, const TDesC& aUniqueId);
1.694 +
1.695 + /** Request the agent to obtain rights for the default content object
1.696 +
1.697 + This request may be handled differently by different agents.
1.698 + Some agents may open a browser and direct the user to a URL. Others may
1.699 + download and install the rights in the background.
1.700 +
1.701 + The call should not block execution, applications can wait for a notification
1.702 + if they are interested in the outcome.
1.703 +
1.704 + @param aStatus Asynchronous request status. On completion this will contain
1.705 + one of the following error codes:
1.706 + KErrNone if the rights request was successful.
1.707 + KErrCANotSupported if the agent does not allow rights requests.
1.708 + Otherwise one of the other CAF error codes defined in \c caferr.h
1.709 + or one of the other system-wide error codes
1.710 + for any other errors.
1.711 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1.712 + */
1.713 + IMPORT_C void RequestRights(TRequestStatus& aStatus);
1.714 +
1.715 + /** Request the agent to obtain rights for a protected content object
1.716 +
1.717 + This request may be handled differently by different agents.
1.718 + Some agents may open a browser and direct the user to a URL. Others may
1.719 + download and install the rights in the background.
1.720 +
1.721 + The call should not block execution, applications can wait for a notification
1.722 + if they are interested in the outcome.
1.723 +
1.724 + @param aStatus Asynchronous request status. On completion this will contain
1.725 + one of the following error codes:
1.726 + KErrNone if the rights request was successful.
1.727 + KErrCANotSupported if the agent does not allow rights requests.
1.728 + Otherwise one of the other CAF error codes defined in \c caferr.h
1.729 + or one of the other system-wide error codes
1.730 + for any other errors.
1.731 +
1.732 + @param aUniqueId The unique id of the object within the file.
1.733 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1.734 + */
1.735 + IMPORT_C void RequestRights(TRequestStatus& aStatus, const TDesC& aUniqueId);
1.736 +
1.737 +
1.738 + /** Cancel a previous RequestRights() request for the default content object
1.739 +
1.740 + @param aStatus The TRequestStatus that was supplied to the RequestRights() function.
1.741 + @return The result of the cancel rights request.
1.742 + @return KErrNone if the rights request was cancelled.
1.743 + @return KErrNotFound if there was no matching rights request outstanding.
1.744 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.745 + */
1.746 + IMPORT_C TInt CancelRequestRights(TRequestStatus& aStatus);
1.747 +
1.748 + /** Cancel a previous RequestRights() request
1.749 +
1.750 + @param aStatus The TRequestStatus that was supplied to the RequestRights() function.
1.751 + @param aUniqueId The objects Unique Id that was supplied to the RequestRights() function.
1.752 + @return The result of the cancel rights request.
1.753 + @return KErrNone if the rights request was cancelled.
1.754 + @return KErrNotFound if there was no matching rights request outstanding.
1.755 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.756 + */
1.757 + IMPORT_C TInt CancelRequestRights(TRequestStatus& aStatus, const TDesC& aUniqueId);
1.758 +
1.759 + /** View information associated with the default content object
1.760 +
1.761 + This call blocks execution and only returns once the display is dismissed
1.762 + by the user.
1.763 +
1.764 + @see ContentAccess::TDisplayInfo
1.765 +
1.766 + @param aInfo The information to display.
1.767 + @leave KErrCANotSupported if information cannot be displayed or does not exist.
1.768 + @leave ... One of the other CAF error codes defined in \c caferr.h
1.769 + or one of the system-wide error codes for
1.770 + any other errors.
1.771 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1.772 + */
1.773 + IMPORT_C void DisplayInfoL(TDisplayInfo aInfo) const;
1.774 +
1.775 + /** View information associated with a single content object
1.776 +
1.777 + This call blocks execution and only returns once the display is dismissed
1.778 + by the user.
1.779 +
1.780 + @see ContentAccess::TDisplayInfo
1.781 +
1.782 + @param aInfo The information to display.
1.783 + @param aUniqueId The unique id of the object within the file.
1.784 + @leave KErrCANotSupported if information cannot be displayed or does not exist.
1.785 + @leave ... One of the other CAF error codes defined in \c caferr.h
1.786 + or one of the system-wide error codes for
1.787 + any other errors.
1.788 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1.789 + */
1.790 + IMPORT_C void DisplayInfoL(TDisplayInfo aInfo, const TDesC& aUniqueId) const;
1.791 +
1.792 +
1.793 + /** Request the agent handling this content to set a property value. If
1.794 + the property is set it is only set for this CContent session and does not
1.795 + impact other CAF users and is not set for CData products created by the
1.796 + CContent.
1.797 +
1.798 + @see ContentAccess::TAgentProperty
1.799 +
1.800 + @param aProperty The property to set.
1.801 + @param aValue The value of the property.
1.802 + @return Whether the property was set.
1.803 + @return KErrNone if the property was set.
1.804 + @return KErrCANotSupported if the agent does not support the property or value.
1.805 + @return KErrAccessDenied if the agent does not permit the property to be changed.
1.806 + @return KErrPermissionDenied if the application does not have the necessary capability to change the property.
1.807 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.808 + */
1.809 + IMPORT_C TInt SetProperty(TAgentProperty aProperty, TInt aValue);
1.810 +
1.811 + /**
1.812 + Grants read access to the default content object based on
1.813 + evaluation of the supplied intent information.
1.814 +
1.815 + Note that the intent is simply evaluated and not executed.
1.816 + To force the intent to be executed, clients must use the call
1.817 + ContentAccess::CData::ExecuteIntent().
1.818 +
1.819 + A CData object can be obtained as follows:
1.820 + @code
1.821 + CData* MyData = myContent->OpenContentL(ChosenIntent);
1.822 + ...
1.823 + delete MyData; // when finished accessing plaintext content
1.824 + @endcode
1.825 +
1.826 + @see ContentAccess::TIntent
1.827 +
1.828 + @param aIntent The intent indicator.
1.829 + @return A CData instance. The caller gets ownership of this object.
1.830 +
1.831 + @leave KErrNotFound The content object with the given UniqueId does not exist.
1.832 + @leave KErrCAPendingRights The rights have not yet arrived but are expected soon.
1.833 + @leave KErrCANoPermission Rights exist but the specified intent is not permitted.
1.834 + @leave KErrCANoRights No rights exist for the content object.
1.835 + @leave KErrCANotSupported Unable to open the object with the specified UniqueId, it may be a container object.
1.836 + @leave KErrPermissionDenied The agent does not allow the client to access the content object.
1.837 + @leave KErrAccessDenied The content is already in use.
1.838 + @leave ... One of the other CAF error codes defined in \c caferr.h
1.839 + or one of the other system-wide error codes for any other
1.840 + errors.
1.841 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.842 + */
1.843 + IMPORT_C CData* OpenContentL(TIntent aIntent);
1.844 +
1.845 + /**
1.846 + Grants read access to the default content object based on
1.847 + evaluation of the supplied intent information.
1.848 +
1.849 + Note that the intent is simply evaluated and not executed.
1.850 + To force the intent to be executed, clients must use the call
1.851 + ContentAccess::CData::ExecuteIntent().
1.852 +
1.853 + A CData object can be obtained as follows:
1.854 + @code
1.855 + CData* myData = myContent->OpenContentLC(ChosenIntent);
1.856 + ...
1.857 + // when finished accessing plaintext content
1.858 + CleanupStack::PopAndDestroy(myData);
1.859 + @endcode
1.860 +
1.861 + @see ContentAccess::TIntent
1.862 +
1.863 + @param aIntent The intent indicator.
1.864 + @return A CData instance. The caller gets ownership of this object.
1.865 +
1.866 + @leave KErrNotFound The content object with the given UniqueId does not exist.
1.867 + @leave KErrCAPendingRights The rights have not yet arrived but are expected soon.
1.868 + @leave KErrCANoPermission Rights exist but the specified intent is not permitted.
1.869 + @leave KErrCANoRights No rights exist for the content object.
1.870 + @leave KErrCANotSupported Unable to open the object with the specified UniqueId, it may be a container object.
1.871 + @leave KErrPermissionDenied The agent does not allow the client to access the content object.
1.872 + @leave KErrAccessDenied The content is already in use.
1.873 + @leave ... One of the other CAF error codes defined in \c caferr.h
1.874 + or one of the other system-wide error codes for any other
1.875 + errors.
1.876 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
1.877 + */
1.878 + IMPORT_C CData* OpenContentLC(TIntent aIntent);
1.879 +
1.880 + /**
1.881 + Grants read access to the content object based on evaluation of the
1.882 + supplied intent information.
1.883 +
1.884 + Note that the intent is simply evaluated and not executed.
1.885 + To force the intent to be executed, clients must use the call
1.886 + ContentAccess::CData::ExecuteIntent().
1.887 +
1.888 + A CData object can be obtained as follows:
1.889 + @code
1.890 + CData* MyData = myContent->OpenContentL(ChosenIntent, uniqueId);
1.891 + ...
1.892 + delete MyData; // when finished accessing plaintext content
1.893 + @endcode
1.894 +
1.895 + @see ContentAccess::TIntent
1.896 +
1.897 + @param aIntent The intent indicator.
1.898 + @param aUniqueId The object to open for reading. If the UniqueId is set to KNullDesC16() the entire file will be opened for reading with no transformation.
1.899 + @return A CData instance. The caller gets ownership of this object.
1.900 +
1.901 + @leave KErrNotFound The content object with the given UniqueId does not exist.
1.902 + @leave KErrCAPendingRights The rights have not yet arrived but are expected soon.
1.903 + @leave KErrCANoPermission Rights exist but the specified intent is not permitted.
1.904 + @leave KErrCANoRights No rights exist for the content object.
1.905 + @leave KErrCANotSupported Unable to open the object with the specified UniqueId, it may be a container object.
1.906 + @leave KErrPermissionDenied The agent does not allow the client to access the content object.
1.907 + @leave KErrAccessDenied The content is already in use.
1.908 + @leave ... One of the other CAF error codes defined in \c caferr.h
1.909 + or one of the other system-wide error codes for any other
1.910 + errors.
1.911 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.912 + */
1.913 + IMPORT_C CData* OpenContentL(TIntent aIntent, const TDesC& aUniqueId);
1.914 +
1.915 +
1.916 + /**
1.917 + Grants read access to the content object based on evaluation of the
1.918 + supplied intent information.
1.919 +
1.920 + Note that the intent is simply evaluated and not executed.
1.921 + To force the intent to be executed, clients must use the call
1.922 + ContentAccess::CData::ExecuteIntent().
1.923 +
1.924 + A CData object can be obtained as follows:
1.925 + @code
1.926 + CData* MyData = myContent->OpenContentLC(ChosenIntent, uniqueId);
1.927 + ...
1.928 + PopAndDestroy(MyData); // when finished accessing plaintext content
1.929 + @endcode
1.930 +
1.931 + @see ContentAccess::TIntent
1.932 +
1.933 + @param aIntent The intent indicator.
1.934 + @param aUniqueId The object to open for reading. If the UniqueId is set to KNullDesC16() the entire file will be opened for reading with no transformation.
1.935 + @return A CData instance. The caller gets ownership of this object.
1.936 +
1.937 + @leave KErrNotFound The content object with the given UniqueId does not exist.
1.938 + @leave KErrCAPendingRights The rights have not yet arrived but are expected soon.
1.939 + @leave KErrCANoPermission Rights exist but the specified intent is not permitted.
1.940 + @leave KErrCANoRights No rights exist for the content object.
1.941 + @leave KErrCANotSupported Unable to open the object with the specified UniqueId, it may be a container object.
1.942 + @leave KErrPermissionDenied The agent does not allow the client to access the content object.
1.943 + @leave KErrAccessDenied The content is already in use.
1.944 + @leave ... One of the other CAF error codes defined in \c caferr.h
1.945 + or one of the other system-wide error codes for any other
1.946 + errors.
1.947 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.948 + */
1.949 + IMPORT_C CData* OpenContentLC(TIntent aIntent, const TDesC& aUniqueId);
1.950 +
1.951 +
1.952 + /** Find out which agent is handling this file
1.953 + @return The agent handling the File
1.954 + */
1.955 + IMPORT_C const TAgent& Agent() const;
1.956 +
1.957 + /** Indicates the mode in which the content is shared.
1.958 + @return The content sharing mode
1.959 + */
1.960 + inline TContentShareMode ShareMode() const;
1.961 +
1.962 +#ifndef REMOVE_CAF1
1.963 + /** Create a CData object for reading the content
1.964 +
1.965 + @see ContentAccess::TIntent
1.966 + @param aIntent The intended use of the content
1.967 + @param aShareMode The mode used to open the file. If EContentShareExclusive is required, use CData::NewL() instead
1.968 + @return A new CData object
1.969 + @leave One of the CAF error codes defined in \c caferr.h or one of the system-wide error codes for any errors.
1.970 + @capability DRM Access to DRM agents is not permitted for processes without DRM capability
1.971 + @deprecated
1.972 + */
1.973 + IMPORT_C CData* OpenContentL(TIntent aIntent, TContentShareMode aShareMode);
1.974 +
1.975 + /** Create a CAttribute object to determine the attributes of the default content object
1.976 +
1.977 + @return The agent handling the File
1.978 + @capability DRM Access to DRM agents is not permitted for processes without DRM capability
1.979 + @deprecated
1.980 + */
1.981 + IMPORT_C CAttribute* NewAttributeL(TBool aPreloaded);
1.982 +
1.983 + /** Create a CAttribute object to determine the attributes of the default content object
1.984 +
1.985 + @return The agent handling the File
1.986 + @capability DRM Access to DRM agents is not permitted for processes without DRM capability
1.987 + @deprecated
1.988 + */
1.989 + IMPORT_C CAttribute* NewAttributeL(TBool aPreloaded, TContentShareMode aShareMode);
1.990 +
1.991 +#endif // REMOVE_CAF1
1.992 +
1.993 + private:
1.994 + CContent();
1.995 + void ConstructL(RFile& aFile);
1.996 + void ConstructL(const TDesC& aURI, TContentShareMode aShareMode);
1.997 +
1.998 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.999 + void ConstructL(const TDesC8& aHeaderData);
1.1000 +
1.1001 + /**
1.1002 + Create a CData object for reading WMDRM content.
1.1003 +
1.1004 + @param aIntent The intended use of the content.
1.1005 + @param aHeaderData Header data of WMDRM file/stream content.
1.1006 + @return CData object.
1.1007 + @leave One of the CAF error codes defined in caferr.h or one of the system-wide error codes for any errors.
1.1008 + @capability DRM Access to DRM agents is not permitted for processes without DRM capability.
1.1009 + */
1.1010 +
1.1011 + CData* OpenContentL(TIntent aIntent, const TDesC8& aHeaderData);
1.1012 +
1.1013 + /**
1.1014 + Create a CData object for reading WMDRM content.
1.1015 +
1.1016 + @param aIntent The intended use of the content.
1.1017 + @param aHeaderData Header data of WMDRM file/stream content.
1.1018 + @return CData object.
1.1019 + @leave One of the CAF error codes defined in caferr.h or one of the system-wide error codes for any errors.
1.1020 + @capability DRM Access to DRM agents is not permitted for processes without DRM capability.
1.1021 + */
1.1022 + CData* OpenContentLC(TIntent aIntent, const TDesC8& aHeaderData);
1.1023 +
1.1024 +#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.1025 +
1.1026 + private:
1.1027 +
1.1028 + /** CAgentFactory object is effectively the ECOM session handle */
1.1029 + CAgentFactory* iAgentFactory;
1.1030 +
1.1031 + /**
1.1032 + Agent object used for browsing the contents of a file
1.1033 + */
1.1034 + CAgentContent* iAgentContent;
1.1035 +
1.1036 + /** Points to the default content object if the file is opened by name */
1.1037 + CVirtualPath* iVirtualPath;
1.1038 +
1.1039 + /** The content object referred to by CContent, either points to iVirtualPath
1.1040 + or points to (KNullDesC(), KDefaultContentObject())
1.1041 + */
1.1042 + TVirtualPathPtr iDefaultVirtualPath;
1.1043 +
1.1044 + /* Stores the name and UID of the agent
1.1045 + */
1.1046 + TAgent iAgent;
1.1047 +
1.1048 + /** The share mode used to open the content file*/
1.1049 + TContentShareMode iShareMode;
1.1050 +
1.1051 + /** Reference to the file handle if the content was opened with a file handle */
1.1052 +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.1053 + RFile64 iFile;
1.1054 +#else
1.1055 + RFile iFile;
1.1056 +#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.1057 +
1.1058 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.1059 + HBufC8* iHeaderData;
1.1060 +#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.1061 +
1.1062 + };
1.1063 +
1.1064 +#include <caf/content.inl>
1.1065 + } // namespace ContentAccess
1.1066 +
1.1067 +#endif // __CONTENT_H__
1.1068 +