2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * This file contains enumerations and constants used throughout the
16 * content access framework
27 #ifndef __CAF_TYPES_H__
28 #define __CAF_TYPES_H__
32 namespace ContentAccess
38 EQosBufferSize = 0, ///< Size of read buffer suggested by client
39 EQosAttrTop // Must always be last sequential entry
43 Defines an internal set of 'standard' MIME header fields. These allow an agent
44 to quickly read the value of a field when importing files
50 EContentType = 0, ///< Content-Type :
51 EContentLength = 1, ///< Content-Length :
52 EContentId = 2, ///< Content-Id:
53 EContentTransferEncoding = 3, ///< Content-Transfer-Encoding:
54 EBoundary = 4, ///< Boundary:
55 EMimeMax ///< indicates the end of this enumeration
59 /** Defines the share modes available when opening content for consumption. These
60 modes have no effect unless the content is a file stored on the device.
61 Remember to update any DRM agents if new values are added here.
63 enum TContentShareMode
65 EContentShareReadOnly = 0, ///< Client will only read and expects others will only read.
66 EContentShareReadWrite = 1, ///< Client expects to read and write and others will read and write
67 EContentShareExclusive = 2 ///< Client will have exclusive access to the file. This can only be used for unprotected content
71 * Set of valid reader intents when opening content.
72 * Remember to update any DRM agents if new values are added here.
76 EPeek = 0, ///< Reader intends to peek at content.
77 EPlay = 1, ///< Reader intends to play content.
78 EView = 2, ///< Reader intends to view content.
79 EExecute = 3, ///< Reader intends to execute content.
80 EPrint = 4, ///< Reader intends to print content.
81 EPause = 5, ///< Reader pauses play operation
82 EContinue = 6, ///< Reader continues play operation after a pause operation
83 EStop = 7, ///< Reader stops play operation.
84 EUnknown = 8, ///< Reader is uncertain of how the content will be used. Permits free access to unprotected data but prevents access to protected content
85 EInstall = 9 ///< Reader intends to install content.
90 * Defines the types of output file produced when importing files
91 * into the Content Access Famework using CImportFile
92 * Remember to update any DRM agents if new values are added here.
96 EContent = 0, ///< Content file produced
97 EReceipt = 1 ///< Receipt for rights produced
101 The agent status codes reported when importing a file with the supplier API
102 Remember to update any DRM agents if new values are added here.
106 EInProgress, ///< The import operation is proceeding with no error
107 EWaitingForNewOutputFile, ///< The agent is waiting for the client application to provide a new output file by calling ContinueWithNewOutputFile()
108 EComplete, ///< The import operation is complete
109 EFailed, ///< The import was aborted by the agent
110 EUnsupportedMedia ///< The mime-type of the content is not supported on this device
114 The list of generic content object attributes. Each of these attributes has a
115 value that is either ETrue or EFalse unless otherwise specified
116 Remember to update any DRM agents if new values are added here.
118 @li ETrue If an attribute is true
119 @li EFalse If the attribute is false
123 EIsProtected = 0, ///< Content object is protected
124 EIsForwardable = 1, ///< Content object can be forwarded to another device or copied to removable media
125 EIsModifyable = 2, ///< The content can be modified
126 EIsCopyable = 3, ///< The content object can be duplicated in internal storage
127 ECanPlay = 4, ///< Rights exist allowing the content to be played
128 ECanPrint = 5, ///< Rights exist allowing the content to be printed
129 ECanExecute = 6, ///< Rights exist allowing the content to be executed
130 ECanView = 7, ///< Rights exist allowing the content to be viewed on screen
131 ERightsNone = 8, ///< No rights exist for the content object
132 ERightsPending = 9, ///< Rights are expected to arrive soon
133 ERightsHaveExpired = 10, ///< Rights were were present but have since expired or been consumed
134 EPreviewAvailable = 11, ///< A preview URI is available
135 EContentCDataInUse = 12, ///< Set if the content is currently being used by another CData session
136 ECanRewind = 13, ///< Media can be rewound without decrementing rights
137 ECopyPaste = 14, ///< can make copies via the clipboard
138 ERightsConsumable = 15, ///< Rights are consumable. The are decremented whenever content is accessed (ie. play counts).
139 ERightsStateless = 16, ///< Rights are stateless and the content can be used repeatedly until a condition expires (ie. expiry date)
140 ECanMove = 17, ///< Content can be moved
141 ECanRename = 18, ///< Content can be renamed
142 ECanAutomaticConsume = 19, ///< Rights can be consumed automatically when the content object is used for say wallpaper
143 EContentVersion = 20, ///< Version identifying the incarnation of the content object
144 EIsMediaPlayerOnly = 21, ///< The content can only be accessed by a media player, and cannot be accessed on an automatic event (such as a ringtone)
145 EIsAutomatedUseOnly = 22, ///< The content can only be used on automated events (such as ringtones), and cannot be accessed manually from media players
146 ETrackNumber = 23, ///< Track number of the content in a collection (e.g. a track number in a music album)
147 EAgentSpecificAttributeBase = 32768 ///< Base index the agents should use when implementing new agent specific attributes
152 /** The list of generic string attributes. Each of these attributes
153 has a value that is returned to the client as a string.
154 Remember to update any DRM agents if new values are added here.
156 enum TStringAttribute
158 EDescription = 0, ///< Description of the embedded object
159 EMimeType = 1, ///< Mime type of the content object
160 ETitle = 2, ///< Title of the object
161 EAuthor = 3, ///< Author of the object
162 EIconURI = 4, ///< Location of the icon for this content
163 EPreviewURI = 5, ///< Location of a preview of the content
164 EContentURI = 6, ///< URI where this content can be acquired from
165 EContentID = 7, ///< Unique CID for this content
166 EInfoURL = 8, ///< Location of further information about this content
167 EPendingRightsETA = 9, ///< Expected number of seconds before the rights arrive
168 ETransactionID = 10, ///< Transaction ID for content object. It may be used to track the content flow from one user to another one
169 EContentLocation = 11, ///< Location attribute of a content object. May be used as a reference for the object within the content file or as a filename for the object when exported
170 ERightsIssuerURI = 12, ///< URI where the rights for this content may be acquired from
171 EGenre = 13, ///< Genre of the content
172 EUserRating = 14, ///< User rating of the content
173 EAuthoredDate = 15, ///< The Recording Year Date
174 ECoverURI = 16, ///< Cover URI for the content
175 EAgentSpecificStringAttributeBase = 32768 ///< Base index the agents should use when implementing new string attributes
179 Events relating to DRM objects, powers of 2 so they can be OR'd
180 Remember to update any DRM agents if new values are added here.
184 ERightsAvailable = 1, ///< Rights have arrived for the content object
185 ERightsExpired = 2, ///< Rights have expired or have been exhausted
186 EAgentSpecificEventBase = 1023 ///< Base index for agent-specific events
189 The type of object inside a DRM file
190 Remember to update any DRM agents if new values are added here.
194 EContainerObject = 0, ///< A container object
195 EContentObject = 1, ///< A content object
196 EAgentSpecificObject = 2 ///< An agent specific object
199 /** Type of information to display
200 Remember to update any DRM agents if new values are added here.
204 EFileProperties = 0, ///< Display file name, last modified date etc
205 EFileAndRights = 1, ///< Display file information and DRM rights information
206 ERights = 2 ///< Display DRM rights information only
209 /** The type of rights object
211 A rights object can be consumable and
212 stateless so these can be OR'd together to form a bit mask
213 Remember to update any DRM agents if new values are added here.
217 ERightsTypeConsumable = 1, ///< Rights are consumable. The are decremented whenever content is accessed (ie. play counts).
218 ERightsTypeStateless = 2 ///< Rights are stateless and the content can be used repeatedly until a condition expires (ie. expiry date)
221 /** State of a rights object
222 Remember to update any DRM agents if new values are added here.
226 ERightsStatusNone = 0, ///< Rights do not exist
227 ERightsStatusValid = 1, ///< Rights are valid, ready to use
228 ERightsStatusExpired = 2, ///< Rights have all expired
229 ERightsStatusPending = 3 ///< Rights are expected soon
232 /** The Unique Id that identifies the default content object within any file
234 _LIT(KDefaultContentObject,"DEFAULT");
236 /** Defines the properties that an application can set in an agent.
237 Remember to update any DRM agents if new values are added here.
241 EAgentPropertyBufferSize = 0, ///< Set the buffer size used by the agent when reading content. This can be used to optimise performance.
242 EAgentPropertyAgentUI = 1, ///< Enable or disable the Agent's user interface for errors and confirmation requests. 0 = Disable Agent UI, 1 = Enable Agent UI
243 EAgentPropertyMultipleSequence = 2 ///< Communicates to the agent that a series of operations are to be performed as part of one larger operation. eg. deleting multiple files, the value should be set back to zero when the sequence is finished. 0 = Not performing a multiple sequence, 1 = performing a multiple sequence.
246 /** Maximum length of a content or container unique id
248 const TInt KMaxCafUniqueId = 1024;
250 /** Maximum length of a content object name
252 const TInt KMaxCafContentName = 1024;