1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // \n |
|
15 // Files are managed by the <code>ContentAccess::CManager</code> class in the content |
|
16 // access framework. |
|
17 // <hr> |
|
18 // Some agents may choose to store content files inside their server private directories. For example: |
|
19 // \private\<process SID>\protectedfile.ext |
|
20 // If an agent wishes to publish the existence of its private directory, it should fill in the name of |
|
21 // the private directory (its SecureID of the process) in the \c opaque_data section of the agents ECOM resource file. |
|
22 // CAF will map the path to one based on the agent name so that it's human-readable. For example: |
|
23 // \private\<agent_name>\protectedfile.ext |
|
24 // <hr> |
|
25 // The <code>ContentAccess::CManager::DeleteFileL()</code> allows a client to delete a specified file managed by a DRM agent. |
|
26 // The agent responsible for the content can display a dialog to confirm that |
|
27 // the user wants to delete the file. This is particularly important if the content still has valid rights. |
|
28 // The agent implementation must decide whether to delete the rights or only the content. |
|
29 // TFileName filename; |
|
30 // // create a manager object |
|
31 // CManager* manager = CManager::NewL(); |
|
32 // // Use the manager to delete a file |
|
33 // // CAF will ask the agent who actually owns the file to delete it. |
|
34 // TInt result = manager->DeleteFile(filename); |
|
35 // <hr> |
|
36 // <code>ContentAccess::CManager::CopyFile()</code> allows a user to make a copy of the file. For example, the user may wish |
|
37 // to make a copy of the file on removable media. When copying content managed by a DRM agent, the agent will only copy the |
|
38 // content, it will not copy the rights. |
|
39 // TInt result = manager->CopyFile(source, destination); |
|
40 // <hr> |
|
41 // <code>ContentAccess::CManager::RenameFile()</code> allows a user to move or rename a file. |
|
42 // For example, the user may wish to move the file to removable media. |
|
43 // TInt result = manager->RenameFile(oldFilename, newFilename); |
|
44 // <hr> |
|
45 // <code>ContentAccess::CManager::MkDir()</code> allows a user to create a directory. |
|
46 // TInt result = manager->MkDir(fullpath); |
|
47 // <hr> |
|
48 // <code>ContentAccess::CManager::MkDirAll()</code> allows a user to create a directory. |
|
49 // If one or more of the sub-directories do not exist they will be created too. |
|
50 // TInt result = manager->MkDirAll(fullpath); |
|
51 // <hr> |
|
52 // <code>ContentAccess::CManager::RmDir()</code> allows a user to remove a directory. |
|
53 // TInt result = manager->RmDir(fullpath); |
|
54 // <hr> |
|
55 // There a three variations of the <code>ContentAccess::CManager::GetDir()</code> function. They each allow a client |
|
56 // to list the contents of an agent's private directory. |
|
57 // As mentioned earlier it is optional for agents to provide this information. |
|
58 // CDir *aDir; |
|
59 // TInt result = manager->GetDir(aName, aEntryAttMask, aEntrySortKey, aDir); |
|
60 // <hr> |
|
61 // The CAF Apparc recognizer provides a MIME type that is a combination of the file MIME type and |
|
62 // the content within the file. In some circumstances, such as forwarding DRM content to another |
|
63 // device, it will be important to make sure the content is sent with the correct MIME type. |
|
64 // Using the <code>""</code> empty string <code>UniqueId</code> allows an application to determine the MIME type of the file. |
|
65 // TBuf <256> aMimeType; |
|
66 // TInt result = manager->GetStringAttribute(EMimeType, aMimeType, TVirtualPathPtr(aURI,KNullDesC16())); |
|
67 // <hr> |
|
68 // The <code>CManager</code> API allows applications to retrieve attributes or string attributes from a content object |
|
69 // <hr> |
|
70 // |
|
71 // |
|
72 |
|
73 /** |
|
74 @page CAFManageFiles Managing files with the Content Access Framework |
|
75 - @ref CAFPrivateDirectories |
|
76 - @ref Deleteing |
|
77 - @ref Copying |
|
78 - @ref Moving |
|
79 - @ref MkDir |
|
80 - @ref MkDirAll |
|
81 - @ref RemoveDir |
|
82 - @ref GetDir |
|
83 - @ref GetRealMimeType |
|
84 - @ref ManagerGetAttribute |
|
85 @section CAFPrivateDirectories Agents using Private directories |
|
86 @code |
|
87 @endcode |
|
88 See @ref CAA_Configuration. |
|
89 @code |
|
90 @endcode |
|
91 @section Deleteing Deleting a File |
|
92 @code |
|
93 @endcode |
|
94 @section Copying Copying a file |
|
95 @code |
|
96 @endcode |
|
97 @section Moving Move or Rename a file |
|
98 @code |
|
99 @endcode |
|
100 @section MkDir Creating a Directory |
|
101 @code |
|
102 @endcode |
|
103 @section MkDirAll Creating all directories |
|
104 @code |
|
105 @endcode |
|
106 @section RemoveDir Removing a Directory |
|
107 @code |
|
108 @endcode |
|
109 @section GetDir List the contents of a directory |
|
110 @code |
|
111 @endcode |
|
112 @section GetRealMimeType Find out the real MIME type of the file |
|
113 @code |
|
114 @endcode |
|
115 @section ManagerGetAttribute Get the attributes of the Content object |
|
116 as described in @ref ContentAttributes. |
|
117 */ |
|