sl@0: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // \n sl@0: // Files are managed by the ContentAccess::CManager class in the content sl@0: // access framework. sl@0: //
sl@0: // Some agents may choose to store content files inside their server private directories. For example: sl@0: // \private\\protectedfile.ext sl@0: // If an agent wishes to publish the existence of its private directory, it should fill in the name of sl@0: // the private directory (its SecureID of the process) in the \c opaque_data section of the agents ECOM resource file. sl@0: // CAF will map the path to one based on the agent name so that it's human-readable. For example: sl@0: // \private\\protectedfile.ext sl@0: //
sl@0: // The ContentAccess::CManager::DeleteFileL() allows a client to delete a specified file managed by a DRM agent. sl@0: // The agent responsible for the content can display a dialog to confirm that sl@0: // the user wants to delete the file. This is particularly important if the content still has valid rights. sl@0: // The agent implementation must decide whether to delete the rights or only the content. sl@0: // TFileName filename; sl@0: // // create a manager object sl@0: // CManager* manager = CManager::NewL(); sl@0: // // Use the manager to delete a file sl@0: // // CAF will ask the agent who actually owns the file to delete it. sl@0: // TInt result = manager->DeleteFile(filename); sl@0: //
sl@0: // ContentAccess::CManager::CopyFile() allows a user to make a copy of the file. For example, the user may wish sl@0: // to make a copy of the file on removable media. When copying content managed by a DRM agent, the agent will only copy the sl@0: // content, it will not copy the rights. sl@0: // TInt result = manager->CopyFile(source, destination); sl@0: //
sl@0: // ContentAccess::CManager::RenameFile() allows a user to move or rename a file. sl@0: // For example, the user may wish to move the file to removable media. sl@0: // TInt result = manager->RenameFile(oldFilename, newFilename); sl@0: //
sl@0: // ContentAccess::CManager::MkDir() allows a user to create a directory. sl@0: // TInt result = manager->MkDir(fullpath); sl@0: //
sl@0: // ContentAccess::CManager::MkDirAll() allows a user to create a directory. sl@0: // If one or more of the sub-directories do not exist they will be created too. sl@0: // TInt result = manager->MkDirAll(fullpath); sl@0: //
sl@0: // ContentAccess::CManager::RmDir() allows a user to remove a directory. sl@0: // TInt result = manager->RmDir(fullpath); sl@0: //
sl@0: // There a three variations of the ContentAccess::CManager::GetDir() function. They each allow a client sl@0: // to list the contents of an agent's private directory. sl@0: // As mentioned earlier it is optional for agents to provide this information. sl@0: // CDir *aDir; sl@0: // TInt result = manager->GetDir(aName, aEntryAttMask, aEntrySortKey, aDir); sl@0: //
sl@0: // The CAF Apparc recognizer provides a MIME type that is a combination of the file MIME type and sl@0: // the content within the file. In some circumstances, such as forwarding DRM content to another sl@0: // device, it will be important to make sure the content is sent with the correct MIME type. sl@0: // Using the "" empty string UniqueId allows an application to determine the MIME type of the file. sl@0: // TBuf <256> aMimeType; sl@0: // TInt result = manager->GetStringAttribute(EMimeType, aMimeType, TVirtualPathPtr(aURI,KNullDesC16())); sl@0: //
sl@0: // The CManager API allows applications to retrieve attributes or string attributes from a content object sl@0: //
sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @page CAFManageFiles Managing files with the Content Access Framework sl@0: - @ref CAFPrivateDirectories sl@0: - @ref Deleteing sl@0: - @ref Copying sl@0: - @ref Moving sl@0: - @ref MkDir sl@0: - @ref MkDirAll sl@0: - @ref RemoveDir sl@0: - @ref GetDir sl@0: - @ref GetRealMimeType sl@0: - @ref ManagerGetAttribute sl@0: @section CAFPrivateDirectories Agents using Private directories sl@0: @code sl@0: @endcode sl@0: See @ref CAA_Configuration. sl@0: @code sl@0: @endcode sl@0: @section Deleteing Deleting a File sl@0: @code sl@0: @endcode sl@0: @section Copying Copying a file sl@0: @code sl@0: @endcode sl@0: @section Moving Move or Rename a file sl@0: @code sl@0: @endcode sl@0: @section MkDir Creating a Directory sl@0: @code sl@0: @endcode sl@0: @section MkDirAll Creating all directories sl@0: @code sl@0: @endcode sl@0: @section RemoveDir Removing a Directory sl@0: @code sl@0: @endcode sl@0: @section GetDir List the contents of a directory sl@0: @code sl@0: @endcode sl@0: @section GetRealMimeType Find out the real MIME type of the file sl@0: @code sl@0: @endcode sl@0: @section ManagerGetAttribute Get the attributes of the Content object sl@0: as described in @ref ContentAttributes. sl@0: */