contentmgmt/contentaccessfwfordrm/inc/manager.h
changeset 0 2c201484c85f
child 8 35751d3474b7
equal deleted inserted replaced
-1:000000000000 0:2c201484c85f
       
     1 /*
       
     2 * Copyright (c) 2003-2006 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 the License "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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 /** 
       
    21 @file
       
    22 
       
    23 @publishedPartner
       
    24 @released
       
    25 */
       
    26 
       
    27 
       
    28 #ifndef __MANAGER_H__
       
    29 #define __MANAGER_H__
       
    30 
       
    31 #include <e32base.h>
       
    32 #include <f32file.h>
       
    33 #include <caf/caftypes.h>
       
    34 #include <caf/agent.h>
       
    35 class CDir;
       
    36 
       
    37 namespace ContentAccess
       
    38 	{
       
    39 	class CAgentResolver;
       
    40 	class CRightsManager;
       
    41 	class RAttributeSet;
       
    42 	class RStringAttributeSet;
       
    43 	class CDirStreamable;
       
    44 	class CAgentManager;
       
    45 	class TVirtualPathPtr;
       
    46 	
       
    47 
       
    48 	/** 
       
    49 	Manages files and content access agents
       
    50 	
       
    51 	@publishedPartner
       
    52 	@released
       
    53 	*/
       
    54 	class CManager : public CBase
       
    55 		{
       
    56 	public:
       
    57 
       
    58 		/** Creates a CManager 
       
    59 
       
    60 		@return A CManager object
       
    61 		*/
       
    62 		IMPORT_C static CManager* NewL();
       
    63 
       
    64 		/** Creates a CManager 
       
    65 
       
    66 		@return A CManager object
       
    67 		*/
       
    68 		IMPORT_C static CManager* NewLC();
       
    69 
       
    70 		/** destructor 
       
    71 		*/
       
    72 		virtual ~CManager();
       
    73 
       
    74 
       
    75 		/** 
       
    76 		Delete a file on the device
       
    77 
       
    78 		The agent who manages the file will be used to delete it.
       
    79 		   
       
    80 		In the case of a DRM agent implementation it may delete rights that 
       
    81 		were associated with the file at the same time. If an agent deletes 
       
    82 		rights at the same time as the content it will display a confirmation 
       
    83 		dialog that makes it clear that the rights will be also deleted. 
       
    84 		 
       
    85 		Access to the agent private directories is permitted at the 
       
    86 		agents discretion.
       
    87 
       
    88 		@param aFileName The full pathname of the file to delete.
       
    89 		@return The outcome of the delete operation.
       
    90 		@return KErrNone if the file was deleted successfully.
       
    91 		@return KErrCancel if the user selects cancel in an agent supplied confirmation screen.
       
    92 		@return KErrAccessDenied if the agent does not allow the file to be deleted.
       
    93 		@return KErrCANotSupported if the agent does not support file deletion
       
    94 		@return KErrPermissionDenied if the client does not have the necessary capabilities to delete the file.
       
    95 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
    96 				other system-wide error codes for any other errors.
       
    97 		@capability DRM Deleting DRM protected content is not permitted for processes without DRM capability. 
       
    98 		*/
       
    99 		IMPORT_C TInt DeleteFile(const TDesC &aFileName) const;
       
   100 
       
   101 		/**
       
   102 		Make a copy of a file (eg to removable media) 
       
   103 
       
   104 		Access to the agents private directory is permitted at the 
       
   105 		agents discretion.
       
   106 
       
   107   		@param aSource The full pathname of the source file.
       
   108 		@param aDestination The full pathname of the destination file.
       
   109 		@return The outcome of the copy operation.
       
   110 		@return KErrNone if the file was copied successfully.
       
   111 		@return KErrAccessDenied if the agent does not allow the file to be copied.
       
   112 		@return KErrCANotSupported if the agent does not support file copying.
       
   113 		@return KErrPermissionDenied if the client does not have the necessary capabilities to copy the file.
       
   114 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
   115 				other system-wide error codes for any other errors.
       
   116   		@capability DRM Copying DRM protected files is not permitted for processes without DRM capability. Copying unprotected files is permitted
       
   117 		*/
       
   118 		IMPORT_C TInt CopyFile(const TDesC& aSource, const TDesC& aDestination) const;
       
   119 
       
   120 		/**
       
   121 		Make a copy of a file (eg to removable media) using a file handle
       
   122 
       
   123 		Access to the agents private directory is permitted at the 
       
   124 		agents discretion.
       
   125 
       
   126   		@param aSourceFile The handle the source file.
       
   127 		@param aDestination The full pathname of the destination file.
       
   128 		@return The outcome of the copy operation.
       
   129 		@return KErrNone if the file was copied successfully.
       
   130 		@return KErrAccessDenied if the agent does not allow the file to be copied.
       
   131 		@return KErrCANotSupported if the agent does not support file copying.
       
   132 		@return KErrPermissionDenied if the client does not have the necessary capabilities to copy the file.
       
   133 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
   134 				other system-wide error codes for any other errors.
       
   135   		@capability DRM Copying DRM protected files is not permitted for processes without DRM capability. Copying unprotected files is permitted
       
   136 		*/
       
   137 		IMPORT_C TInt CopyFile(RFile& aSourceFile, const TDesC &aDestination) const;
       
   138 				
       
   139 		/**
       
   140 		Rename or move the content file (eg to removable media)
       
   141 
       
   142 		Access to the agent private directories is permitted at the 
       
   143 		agents discretion.
       
   144 
       
   145 		@param aSource The full pathname of the source file.
       
   146 		@param aDestination The full pathname of the destination file.
       
   147 		@return The outcome of the Rename operation.
       
   148 		@return KErrNone if the file was moved or renamed successfully.
       
   149 		@return KErrAccessDenied if the agent does not allow the file to be moved or renamed.
       
   150 		@return KErrCANotSupported if the agent does not support file renaming.
       
   151 		@return KErrPermissionDenied if the client does not have the necessary capabilities to move or rename the file.
       
   152 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
   153 				other system-wide error codes for any other errors.
       
   154   		@capability DRM Moving DRM protected files is not permitted for processes without DRM capability. Moving unprotected files is permitted
       
   155 		*/
       
   156 		IMPORT_C TInt RenameFile(const TDesC& aSource, const TDesC& aDestination) const;
       
   157 
       
   158 		/** Create a directory
       
   159 
       
   160 		This function can be used to create a directory within in the agent's 
       
   161 		private directory. Access to the agents private directory is permitted at the 
       
   162 		agents discretion. 
       
   163 
       
   164 		@param aPath The full pathname of the directory to create.
       
   165 		@return The outcome of the MkDir operation.
       
   166 		@return KErrNone if the directory was created successfully.
       
   167 		@return KErrAccessDenied if the agent does not allow the directory to be created.
       
   168 		@return KErrCANotSupported if the agent does not support directory creation.
       
   169 		@return KErrPermissionDenied if the client does not have the necessary capabilities to create directories.
       
   170 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
   171 				other system-wide error codes for any other errors.
       
   172 		@capability DRM Required when attempting to access an agents private directory.
       
   173 		*/
       
   174 		IMPORT_C TInt MkDir(const TDesC& aPath) const;
       
   175 
       
   176 		/** Create all directories in the given path if they do not exist
       
   177 
       
   178 		This function can be used to create directories within in the agent's 
       
   179 		private directory. Access to the agents private directory is permitted at the 
       
   180 		agents discretion. 
       
   181 		
       
   182 		@param aPath The full pathname of the directory to create.
       
   183 		@return The outcome of the MkDirAll operation.
       
   184 		@return KErrNone if the directory was created successfully.
       
   185 		@return KErrAccessDenied if the agent does not allow the directory to be created.
       
   186 		@return KErrPermissionDenied if the client does not have the necessary capabilities to create directories.
       
   187 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
   188 				other system-wide error codes for any other errors.
       
   189 		@capability DRM Required when attempting to access an agents private directory.
       
   190 		*/
       
   191 		IMPORT_C TInt MkDirAll(const TDesC& aPath) const;
       
   192 
       
   193 		/** Remove a directory
       
   194 
       
   195 		This function can be used to remove a directory from within the agent's 
       
   196 		private directory. Access to the agents private directory is permitted 
       
   197 		at the agents discretion. 
       
   198 		
       
   199 		@param aPath The full pathname of the directory to remove.
       
   200 		@return The outcome of the RmDir operation.
       
   201 		@return KErrNone if the directory was removed successfully.
       
   202 		@return KErrAccessDenied if the agent does not allow the directory to be removed.
       
   203 		@return KErrCANotSupported if the agent does not support directory removal.
       
   204 		@return KErrPermissionDenied if the client does not have the necessary capabilities to remove directories.
       
   205 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
   206 				other system-wide error codes for any other errors.
       
   207 		@capability DRM Required when attempting to access an agents private directory
       
   208 		*/
       
   209 		IMPORT_C TInt RmDir(const TDesC& aPath) const;
       
   210 
       
   211 
       
   212 		/** Rename a directory
       
   213 
       
   214 		This function can be used to rename a directory from within the agent's 
       
   215 		private directory. Access to the agents private directory is permitted 
       
   216 		at the agents discretion. 
       
   217 		
       
   218 		@param aOldName The existing pathname of the directory to rename.
       
   219 		@param aNewName The new pathname of the directory.
       
   220 		@return The outcome of the RenameDir operation.
       
   221 		@return KErrNone if the directory was removed successfully.
       
   222 		@return KErrAccessDenied f the agent does not allow the directory to be removed.
       
   223 		@return KErrCANotSupported if the agent does not support directory removal.
       
   224 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
   225 				other system-wide error codes for any other errors.
       
   226 		@return Otherwise one of the other system-wide error codes for any other errors.
       
   227 		*/
       
   228 		IMPORT_C TInt RenameDir(const TDesC& aOldName, const TDesC& aNewName) const;
       
   229 
       
   230 
       
   231 		/**  Gets a filtered list of a directory's contents. 
       
   232 
       
   233 		The bitmask determines which file and directory entry types should be listed. The sort key determines the order in which they are listed.
       
   234 
       
   235 		Notes:
       
   236 		-# If sorting by UID (as indicated when the ESortByUid bit is OR'ed with the sort key), then UID information will be included in the listing whether or not KEntryAttAllowUid is specified in aEntryAttMask.
       
   237 		-# The function sets aFileList to NULL, and then allocates memory for it before appending entries to the list. Therefore, aFileList should have no memory allocated to it before this function is called, otherwise this memory will become orphaned.
       
   238 		-# The caller of this function is responsible for deleting aFileList after the function has returned.
       
   239 
       
   240 		Access to agent private directories is permitted at 
       
   241 		the agents discretion. 
       
   242 		
       
   243 		@see TEntryKey
       
   244 
       
   245   		@param aName The name of the directory for which a listing is required. Wildcards may be used to specify particular files.
       
   246 		@param aEntryAttMask Bitmask indicating the attributes of interest. Only files and directories whose attributes match those specified here can be included in the listing. For more information, see KEntryAttMatchMask and the other directory entry details. Also see KEntryAttNormal and the other file or directory attributes 
       
   247 		@param aEntrySortKey The sort key. This is a set of flags indicating the order in which the entries are to be sorted. These flags are defined by TEntryKey. 
       
   248 		@param aEntryList On return contains a filtered list of directory and file entries.
       
   249 		@return The outcome of the GetDir operation.
       
   250 		@return KErrNone if the directory contents were listed successfully.
       
   251 		@return KErrCANotSupported if the agent does not allow clients to view its private directory.
       
   252 		@return KErrPermissionDenied if the process does not have the correct capabilities to view the directory.
       
   253 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
   254 				other system-wide error codes for any other errors.
       
   255 		@capability DRM Required when attempting to access an agents private directory
       
   256 		*/
       
   257 		IMPORT_C TInt GetDir(const TDesC& aName, TUint aEntryAttMask, TUint aEntrySortKey, CDir*& aEntryList) const;
       
   258 
       
   259 		/**  Gets a filtered list of the directory and file entries contained in a directory and a list of the directory entries only
       
   260 
       
   261 		The bitmask determines which file and directory entry types should be listed in aFileList. The contents of the second list, aDirList are not affected by the bitmask; it returns all directory entries contained in directory aName. The sort key determines the order in which both lists are sorted.
       
   262 
       
   263 		Notes:
       
   264 		-# If sorting by UID (as indicated when the ESortByUid bit is OR'ed with the sort key), then UID information will be included in the listing whether or not KEntryAttAllowUid is specified in aEntryAttMask.
       
   265 		-# The function sets both aFileList and aDirList to NULL, and then allocates memory to them before appending entries to the lists. Therefore, aFileList and aDirList should have no memory allocated to them before this function is called, otherwise the allocated memory will become orphaned.
       
   266 		-# The caller of this function is responsible for deleting aFileList and aDirList after the function has returned.
       
   267 
       
   268 		Access to agent private directories is permitted at 
       
   269 		the agents discretion. 
       
   270 
       
   271 		@see TEntryKey
       
   272 
       
   273 		@param aName The name of the directory for which a listing is required. Wildcards may be used to specify particular files. 
       
   274 		@param aEntryAttMask Bitmask indicating the attributes of interest. Only files and directories whose attributes match those specified here can be included in aFileList. aDirList is unaffected by this mask. For more information, see KEntryAttMatchMask and the other directory entry details. Also see KEntryAttNormal and the other file or directory attributes.
       
   275 		@param aEntrySortKey The sort key. This is a set of flags indicating the order in which the entries in both lists are to be sorted. These flags are defined by TEntryKey. 
       
   276 		@param aEntryList On return contains a filtered list of directory and file entries. 
       
   277 		@param aDirList On return contains a filtered list of directory entries only.
       
   278 		@return The outcome of the GetDir operation.
       
   279 		@return KErrNone The directory contents were listed successfully.
       
   280 		@return KErrCANotSupported The agent does not allow clients to view its private directory.
       
   281 		@return KErrPermissionDenied If the process does not have the correct capabilities to view the directory.
       
   282 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
   283 				other system-wide error codes for any other errors.
       
   284 		@capability DRM Required when attempting to access an agents private directory.
       
   285 		*/
       
   286 		IMPORT_C TInt GetDir(const TDesC& aName, TUint aEntryAttMask, TUint aEntrySortKey, CDir*& aEntryList, CDir*& aDirList) const;
       
   287 
       
   288 		/**  Gets a filtered list of a directory's contents by UID
       
   289 
       
   290 		The aUidType parameter determines which file entry types should be listed. The sort key determines the order in which they are listed.
       
   291 
       
   292 		Notes:
       
   293 		-# The function sets aFileList to NULL, and then allocates memory for it before appending entries to the list. Therefore, aFileList should have no memory allocated to it before this function is called, otherwise this memory will become orphaned.
       
   294 		-# The caller of this function is responsible for deleting aFileList after the function has returned.
       
   295 
       
   296 		Access to agent private directories is permitted at 
       
   297 		the agents discretion. 
       
   298 
       
   299 		@see TEntryKey
       
   300 
       
   301 		@param aName The name of the directory for which a listing is required. Wildcards may be used to specify particular files. 
       
   302 		@param aEntryUid Only those files whose UIDs match those specified within this UID type will be included in the file list. Any, or all, of the three UIDs within the UID type may be omitted. Any UID which is omitted acts in a similar manner to a wildcard character, matching to all UIDs. 
       
   303 		@param aEntrySortKey The sort key. This is a set of flags indicating the order in which the entries are to be sorted. These flags are defined by TEntryKey.
       
   304 		@param aFileList On return contains a filtered list of directory and file entries.
       
   305 		@return The outcome of the GetDir operation.
       
   306 		@return KErrNone The directory contents were listed successfully.
       
   307 		@return KErrCANotSupported The agent does not allow clients to view its private directory.
       
   308 		@return KErrPermissionDenied If the process does not have the correct capabilities to view the directory.
       
   309 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
   310 				other system-wide error codes for any other errors.
       
   311 		@capability DRM Required when attempting to access an agents private directory.
       
   312 		*/
       
   313 		IMPORT_C TInt GetDir(const TDesC& aName, const TUidType& aEntryUid, TUint aEntrySortKey, CDir*& aFileList) const;
       
   314 
       
   315 		/**  Get an attribute from a content object
       
   316 
       
   317 		@see ContentAccess::TAttribute
       
   318 
       
   319 		e.g.
       
   320 
       
   321 		@code
       
   322 		TInt value = 0;
       
   323 		CManager* manager = CManager::NewL();
       
   324 		
       
   325 		err = manager->GetAttribute(EIsProtected, value, aVirtualPath);
       
   326 		if(err == KErrNone && value)
       
   327 			{
       
   328 			DisplayPadLock();
       
   329 			}
       
   330 		@endcode
       
   331 	
       
   332 		@param aAttribute The attribute to retrieve, from ContentAccess::TAttribute.
       
   333 		@param aValue Used to return the value of the attribute.
       
   334 		@param aVirtualPath The content object whose attributes are to be queried.
       
   335 		@return Whether the attribute value was updated.
       
   336 		@return KErrNone if the attribute value was updated.
       
   337 		@return KErrNotFound if the URI or the object with the given UniqueId inside the file was not found.
       
   338 		@return KErrCANotSupported if the requested attribute is not supported for this content object.
       
   339 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
   340 				other system-wide error codes for any other errors.
       
   341 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
       
   342 		*/
       
   343 		IMPORT_C TInt GetAttribute(TInt aAttribute, TInt& aValue, const TVirtualPathPtr& aVirtualPath) const;
       
   344 
       
   345 		/** Get a set of attributes from a content object
       
   346 
       
   347 		@see ContentAccess::TAttribute
       
   348 
       
   349 		The following example determines whether the content object is protected
       
   350 		and has rights that will enable it to be viewed by the user
       
   351 		
       
   352 		@code
       
   353 		TInt err = KErrNone;
       
   354 		TInt value = 0;
       
   355 		
       
   356 		// The manager		
       
   357 		CManager* manager = CManager::NewLC();
       
   358 
       
   359 		// Prepare the RAttributeSet object with the attributes to query		
       
   360 		RAttributeSet attributeSet;
       
   361 		CleanupClosePushL(attributeSet);
       
   362 		attributeSet.AddL(EProtected);
       
   363 		attributeSet.AddL(ECanView);
       
   364 		
       
   365 		// Retrieve the attributes from the agent
       
   366 		User::LeaveIfError(manager->GetAttributeSet(attributeSet, aVirtualPath));
       
   367 		
       
   368 		// Check if the content object is protected
       
   369 		err =attributeSet.GetValue(EProtected, value);
       
   370 		if(err == KErrNone && value)
       
   371 			{
       
   372 			// content object is DRM protected
       
   373 			}
       
   374 		
       
   375 		// Check if the content object can be display on screen
       
   376 		err = attributeSet.GetValue(ECanView, value);
       
   377 		if(err == KErrNone && value)
       
   378 			{
       
   379 			// content object is DRM protected
       
   380 			}
       
   381 	
       
   382   		// Can reuse the RAttributeSet if necessary
       
   383 		User::LeaveIfError(manager->GetAttributeSet(attributeSet, aVirtualPath));
       
   384 		
       
   385 		...
       
   386 		// Finished
       
   387 		CleanupStack::PopAndDestroy(2);		// manager, attributeSet.Close()
       
   388 		
       
   389 		@endcode
       
   390 
       
   391 
       
   392 		@param aAttributeSet The set of attributes to query and update.
       
   393 		@param aVirtualPath The content object to retrieve attributes from.
       
   394 		@return Whether the attribute set was updated.
       
   395 		@return KErrNone if the attribute set was updated successfully.
       
   396 		@return KErrNotFound if the content object was not found.
       
   397 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
   398 				other system-wide error codes for any other errors.
       
   399 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
       
   400 		*/
       
   401 		IMPORT_C TInt GetAttributeSet(RAttributeSet& aAttributeSet, const TVirtualPathPtr& aVirtualPath) const;
       
   402 
       
   403 		/**  Get text string attributes or meta-data from the file 
       
   404 		
       
   405 		@see ContentAccess::TStringAttribute
       
   406 
       
   407 		e.g.
       
   408 		@code
       
   409 		CManager* manager = CManager::NewLC();
       
   410 		
       
   411 		TBuf <MAX_PATH> previewUri;
       
   412 		if(manager->GetStringAttribute(EPreviewURI, previewUri, uri) == KErrNone)
       
   413 			{
       
   414 			DisplayPreview(previewUri);
       
   415 			}
       
   416 			
       
   417 		CleanupStack::PopAndDestroy();	// manager
       
   418 		@endcode
       
   419 
       
   420 		@param aAttribute The attribute to retrieve, from ContentAccess::TStringAttribute.
       
   421 		@param aValue Used to return the value of the attribute.
       
   422 		@param aVirtualPath The content object whose attributes are to be retrieved.
       
   423 		@return Whether the value was updated.
       
   424 		@return KErrNone if the attribute was retrieved successfully.
       
   425 		@return KErrNotFound if the content object does not exist.
       
   426 		@return KErrCANotSupported if the requested attribute does not apply to this content object.
       
   427 		@return KErrOverflow if the buffer was not large enough to return the result.
       
   428 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
   429 				other system-wide error codes for any other errors.
       
   430 		*/
       
   431 		IMPORT_C TInt GetStringAttribute(TInt aAttribute, TDes& aValue, const TVirtualPathPtr& aVirtualPath) const;
       
   432 
       
   433 		/** Used to obtain a set of string attributes 
       
   434 
       
   435 		@see ContentAccess::TStringAttribute
       
   436 
       
   437 		@code
       
   438 		TInt err = KErrNone;
       
   439 		TInt value = 0;
       
   440 		
       
   441 		CManager* manager = CManager::NewLC();
       
   442 		
       
   443 		// Prepare the RStringAttributeSet object with the attributes to query		
       
   444 		RStringAttributeSet stringAttributeSet;
       
   445 		CleanupClosePushL(stringAttributeSet);
       
   446 		stringAttributeSet.AddL(EPreviewURI);
       
   447 		
       
   448 		// Retrieve the attributes from the agent
       
   449 		User::LeaveIfError(manager->GetAttributeSet(stringAttributeSet, aVirtualPath));
       
   450 		
       
   451 		// display preview
       
   452 		TBuf <MAX_PATH> previewUri;
       
   453 		if(stringAttributeSet.GetValue(ECanView, previewUri))
       
   454 			{
       
   455 			DisplayPreview(previewUri);
       
   456 			}
       
   457 	
       
   458 		// Finished
       
   459 		CleanupStack::PopAndDestroy(2);		// manager, stringAttributeSet.Close()
       
   460 		@endcode
       
   461 
       
   462 
       
   463 		@param aStringAttributeSet The set of attributes to query and update.
       
   464 		@param aVirtualPath The content object whose attributes are to be retrieved.
       
   465 		@return Whether the string attribute set was updated.
       
   466 		@return KErrNone if the attribute set was updated successfully.
       
   467 		@return KErrNotFound if the object with the given virtual path was not found.
       
   468 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  or one of the 
       
   469 				other system-wide error codes for any other errors.
       
   470 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
       
   471 		*/
       
   472 		IMPORT_C TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet, const TVirtualPathPtr& aVirtualPath) const;
       
   473 
       
   474 		/** Notify the caller when the status of a DRM protected content object changes
       
   475 
       
   476 		@see ContentAccess::TEventMask
       
   477 
       
   478 		@param aURI The location of the file.
       
   479 		@param aMask Bitmask of events the caller is interested in.
       
   480 		@param aStatus The TRequestStatus object to complete if the event occurs, or KErrCANotSupported if the agent does not support asynchronous notifications.
       
   481 		@capability DRM Deleting DRM protected content is not permitted for processes without DRM capability. 
       
   482 		*/
       
   483 		IMPORT_C void NotifyStatusChange(const TDesC& aURI, TEventMask aMask, TRequestStatus& aStatus);
       
   484 
       
   485 		/** Cancel a previous notification request
       
   486 		@param aURI The URI supplied in the call to NotifyStatusChange().
       
   487 		@param aStatus The TRequestStatus supplied in the call to NotifyStatusChange().
       
   488 		@return The outcome of the cancel request.
       
   489 		@return KErrNone if the notification was cancelled.
       
   490 		@return KErrNotFound if there was no matching request outstanding.
       
   491 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
       
   492 		*/
       
   493 		IMPORT_C TInt CancelNotifyStatusChange(const TDesC& aURI, TRequestStatus& aStatus);
       
   494 
       
   495 		/** Request all agents to set a property value. If the property is set
       
   496 		it is only set for this CManager session and does not impact other CAF
       
   497 		users.
       
   498 
       
   499 		@see ContentAccess::TAgentProperty
       
   500 
       
   501 		@param aProperty The property to set.
       
   502 		@param aValue The value of the property.
       
   503 		@return The outcome of the set property command.
       
   504 		@return KErrNone if the property was set by all agents.
       
   505 		@return KErrCANotSupported if one of the agent does not support the property or value.
       
   506 		@return KErrAccessDenied if one of the agents does not permit the property to be changed.
       
   507 		@return KErrPermissionDenied if the application does not have the necessary capability to change the property.
       
   508 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted 
       
   509 		*/
       
   510 		IMPORT_C TInt SetProperty(TAgentProperty aProperty, TInt aValue);
       
   511 
       
   512 		/** View information associated with a single content object
       
   513 		
       
   514 		This call blocks execution and only returns once the display is dismissed 
       
   515 		by the user
       
   516 
       
   517 		@see ContentAccess::TDisplayInfo
       
   518 
       
   519 		@param aInfo The information to display.
       
   520 		@param aVirtualPath The content object.
       
   521 		@leave KErrCANotSupported if agent cannot display the requested information.
       
   522 		@leave ...		One of the other CAF error codes defined in \c caferr.h  
       
   523 		 				or one of the system-wide error codes 
       
   524 						for any other errors.		
       
   525 		@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted. 
       
   526 		*/
       
   527 		IMPORT_C void DisplayInfoL(TDisplayInfo aInfo, const TVirtualPathPtr& aVirtualPath);
       
   528 		
       
   529 
       
   530 		/** List all the agents installed on the device (except F32Agent) 
       
   531 
       
   532 		The caller must call RPointerArray::ResetAndDestroy() on the array 
       
   533 		when it has finished.
       
   534 
       
   535 		@param aAgents On completion this will contain a list of all the agents.
       
   536 		*/
       
   537 		IMPORT_C void ListAgentsL(RArray <TAgent>& aAgents);
       
   538 
       
   539 		/** Allows extended synchronous calls to an agent
       
   540 		
       
   541 		@param aAgent The agent.
       
   542 		@param aCommand The agent defined command.
       
   543 		@param aInputBuffer Non modifyable input data buffer.
       
   544 		@param aOutputBuffer Modifyable output buffer to hold the result of the command.
       
   545 		@return The outcome of the agent specific command.
       
   546 		@return KErrNone if the command was successful.
       
   547 		@return KErrCANotSupported if the agent does not recognize the command.
       
   548 		@return KErrPermissionDenied if the agent does not permit the client to execute this command.
       
   549 		@return Otherwise one of the other CAF error codes defined in \c caferr.h  
       
   550 				or one of the other system-wide error codes 
       
   551 				for any other errors.		
       
   552   		@capability DRM Access to extended DRM agent functions is not permitted for processes without DRM capability
       
   553 		*/
       
   554 		IMPORT_C  TInt AgentSpecificCommand(TAgent& aAgent, TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer);
       
   555 
       
   556 		/** Allows extended asynchronous calls to an agent.
       
   557 		NB: It is important that the descriptor passed to 
       
   558 		aOutputBuffer remains in scope until the request has completed.
       
   559 
       
   560 		@param aAgent The agent.
       
   561   		@param aCommand The agent defined command.
       
   562 		@param aInputBuffer Non modifyable input data buffer.
       
   563 		@param aOutputBuffer Modifyable output buffer to hold the result of the command.
       
   564 		@param aStatus 	Asynchronous request status. On completion this will 
       
   565 						contain one of the following error codes: KErrNone if the command
       
   566 						was successful. KErrCANotSupported if the agent does 
       
   567 						not recognize the command. KErrPermissionDenied if the 
       
   568 						agent does not permit the client to execute this command.
       
   569 						Otherwise one of the other CAF error codes 
       
   570 						defined in \c caferr.h  or one of the other 
       
   571 						system-wide error codes for any other errors.
       
   572 		@capability DRM Access to extended DRM agent functions is not permitted for processes without DRM capability
       
   573 		*/
       
   574 		IMPORT_C void AgentSpecificCommand(TAgent& aAgent, TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer, TRequestStatus& aStatus);
       
   575 	
       
   576 		/** Allows a client to display management information for a particular agent
       
   577 		
       
   578 		This allows a user to see all the specific information associated
       
   579 		with a particular agent. In the case of an agent implementing DRM this could 
       
   580 		include the ability to list, view or delete DRM rights objects.
       
   581 
       
   582 		@param aAgent The agent.
       
   583 		@leave KErrCANotSupported If the specified agent does not support the display of management information.
       
   584 		@capability DRM Agents implementing DRM may not display their management dialog to processes without DRM capability
       
   585 		*/
       
   586 		IMPORT_C void DisplayManagementInfoL(TAgent& aAgent);  
       
   587 
       
   588 		/** Allow clients to list, view and delete the rights contained by an agent 
       
   589 		in a generic manner.
       
   590 		
       
   591 		This function is only relevant for agents implementing a DRM scheme. Other agents
       
   592 		will leave with KErrCANotSupported if an application attempts to invoke the
       
   593 		rights manager.
       
   594 
       
   595 		To manage the rights in a more comprehensive manner the application should use the 
       
   596 		DisplayManagementInfoL() function where the agent can present its own 
       
   597 		management information.
       
   598 
       
   599 		@param aAgent The agent to create a rights manager object.
       
   600 		@return A CRightsManager object for the specified agent.
       
   601 
       
   602 		@leave KErrCANotSupported If the agent does not implement DRM or support rights management.
       
   603 		@leave KErrPermissionDenied If the agent does not allow the client to create a rights manager.
       
   604   		@capability DRM Access to DRM rights is not permitted for processes without DRM capability. 
       
   605 		*/
       
   606 		IMPORT_C CRightsManager* CreateRightsManagerL(TAgent& aAgent) const;
       
   607 		
       
   608 #ifndef REMOVE_CAF1
       
   609 		/** Delete a file
       
   610 		@param aFileName The file to delete.
       
   611 		@deprecated Use DeleteFile() instead.
       
   612 		*/
       
   613 		IMPORT_C static void DeleteFileL (const TDesC &aFileName);
       
   614 #endif // REMOVE_CAF1
       
   615 
       
   616 	private:
       
   617 		CManager();
       
   618 		void ConstructL();
       
   619 
       
   620 		/** Populate the list of agents in the CDirStreamable 
       
   621 		@param aDir Reference to a CDir pointer, this pointer must be set to NULL
       
   622 		*/
       
   623 		void GetListOfAgentPrivateDirectoriesL(CDir *&aDir) const;
       
   624 		
       
   625 		// Implemenetation functions for public exports
       
   626 		void DoDeleteFileL(const TDesC &aFileName) const;
       
   627 		void DoCopyFileL(const TDesC& aSource, const TDesC& aDestination) const;		
       
   628 		void DoCopyFileL(RFile& aSourceFile, const TDesC &aDestination) const;
       
   629 		void DoRenameFileL(const TDesC& aSource, const TDesC& aDestination) const;		
       
   630 		void DoMkDirL(const TDesC &aPath) const;
       
   631 		void DoMkDirAllL(const TDesC &aPath) const;
       
   632 		void DoRmDirL(const TDesC &aPath) const;
       
   633 		void DoRenameDirL(const TDesC &aOldName, const TDesC& aNewName) const;
       
   634 		void DoGetDirL(const TDesC& aName, TUint aEntryAttMask, TUint aEntrySortKey, CDir*& aEntryList) const;
       
   635 		void DoGetDirL(const TDesC& aName, TUint aEntryAttMask, TUint anEntrySortKey, CDir*& aEntryList, CDir*& aDirList) const;
       
   636 		void DoGetDirL(const TDesC &aName, const TUidType &aEntryUid, TUint aEntrySortKey, CDir *&aFileList) const;
       
   637 		void DoGetAttributeL(TInt aAttribute, TInt& aValue, const TVirtualPathPtr& aVirtualPath) const;
       
   638 		void DoGetAttributeSetL(RAttributeSet& aAttributeSet, const TVirtualPathPtr& aVirtualPath) const;		
       
   639 		void DoGetStringAttributeL(TInt aAttribute, TDes& aValue, const TVirtualPathPtr& aVirtualPath) const;		
       
   640 		void DoGetStringAttributeSetL(RStringAttributeSet& aStringAttributeSet, const TVirtualPathPtr& aVirtualPath) const;		
       
   641 		void DoNotifyStatusChangeL(const TDesC& aURI, TEventMask aMask, TRequestStatus& aStatus);		
       
   642 		void DoCancelNotifyStatusChangeL(const TDesC& aURI, TRequestStatus& aStatus);
       
   643 		void DoSetPropertyL(TAgentProperty aProperty, TInt aValue);		
       
   644 	private:
       
   645 		// Holds instances of all the agents
       
   646 		CAgentResolver* iResolver;
       
   647 		};
       
   648 
       
   649 	} // namespace ContentAccess
       
   650 
       
   651 #endif /* __MANAGER_H__ */
       
   652 
       
   653