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
29 #ifndef __CAF_TYPES_H__
30 #define __CAF_TYPES_H__
34 namespace ContentAccess
40 EQosBufferSize = 0, ///< Size of read buffer suggested by client
41 EQosAttrTop // Must always be last sequential entry
45 Defines an internal set of 'standard' MIME header fields. These allow an agent
46 to quickly read the value of a field when importing files
52 EContentType = 0, ///< Content-Type :
53 EContentLength = 1, ///< Content-Length :
54 EContentId = 2, ///< Content-Id:
55 EContentTransferEncoding = 3, ///< Content-Transfer-Encoding:
56 EBoundary = 4, ///< Boundary:
57 EMimeMax ///< indicates the end of this enumeration
61 /** Defines the share modes available when opening content for consumption. These
62 modes have no effect unless the content is a file stored on the device.
63 Remember to update any DRM agents if new values are added here.
65 enum TContentShareMode
67 EContentShareReadOnly = 0, ///< Client will only read and expects others will only read.
68 EContentShareReadWrite = 1, ///< Client expects to read and write and others will read and write
69 EContentShareExclusive = 2 ///< Client will have exclusive access to the file. This can only be used for unprotected content
73 * Set of valid reader intents when opening content.
74 * Remember to update any DRM agents if new values are added here.
78 EPeek = 0, ///< Reader intends to peek at content.
79 EPlay = 1, ///< Reader intends to play content.
80 EView = 2, ///< Reader intends to view content.
81 EExecute = 3, ///< Reader intends to execute content.
82 EPrint = 4, ///< Reader intends to print content.
83 EPause = 5, ///< Reader pauses play operation
84 EContinue = 6, ///< Reader continues play operation after a pause operation
85 EStop = 7, ///< Reader stops play operation.
86 EUnknown = 8, ///< Reader is uncertain of how the content will be used. Permits free access to unprotected data but prevents access to protected content
87 EInstall = 9 ///< Reader intends to install content.
92 * Defines the types of output file produced when importing files
93 * into the Content Access Famework using CImportFile
94 * Remember to update any DRM agents if new values are added here.
98 EContent = 0, ///< Content file produced
99 EReceipt = 1 ///< Receipt for rights produced
103 The agent status codes reported when importing a file with the supplier API
104 Remember to update any DRM agents if new values are added here.
108 EInProgress, ///< The import operation is proceeding with no error
109 EWaitingForNewOutputFile, ///< The agent is waiting for the client application to provide a new output file by calling ContinueWithNewOutputFile()
110 EComplete, ///< The import operation is complete
111 EFailed, ///< The import was aborted by the agent
112 EUnsupportedMedia ///< The mime-type of the content is not supported on this device
116 The list of generic content object attributes. Each of these attributes has a
117 value that is either ETrue or EFalse unless otherwise specified
118 Remember to update any DRM agents if new values are added here.
120 @li ETrue If an attribute is true
121 @li EFalse If the attribute is false
125 EIsProtected = 0, ///< Content object is protected
126 EIsForwardable = 1, ///< Content object can be forwarded to another device or copied to removable media
127 EIsModifyable = 2, ///< The content can be modified
128 EIsCopyable = 3, ///< The content object can be duplicated in internal storage
129 ECanPlay = 4, ///< Rights exist allowing the content to be played
130 ECanPrint = 5, ///< Rights exist allowing the content to be printed
131 ECanExecute = 6, ///< Rights exist allowing the content to be executed
132 ECanView = 7, ///< Rights exist allowing the content to be viewed on screen
133 ERightsNone = 8, ///< No rights exist for the content object
134 ERightsPending = 9, ///< Rights are expected to arrive soon
135 ERightsHaveExpired = 10, ///< Rights were were present but have since expired or been consumed
136 EPreviewAvailable = 11, ///< A preview URI is available
137 EContentCDataInUse = 12, ///< Set if the content is currently being used by another CData session
138 ECanRewind = 13, ///< Media can be rewound without decrementing rights
139 ECopyPaste = 14, ///< can make copies via the clipboard
140 ERightsConsumable = 15, ///< Rights are consumable. The are decremented whenever content is accessed (ie. play counts).
141 ERightsStateless = 16, ///< Rights are stateless and the content can be used repeatedly until a condition expires (ie. expiry date)
142 ECanMove = 17, ///< Content can be moved
143 ECanRename = 18, ///< Content can be renamed
144 ECanAutomaticConsume = 19, ///< Rights can be consumed automatically when the content object is used for say wallpaper
145 EContentVersion = 20, ///< Version identifying the incarnation of the content object
146 EIsMediaPlayerOnly = 21, ///< The content can only be accessed by a media player, and cannot be accessed on an automatic event (such as a ringtone)
147 EIsAutomatedUseOnly = 22, ///< The content can only be used on automated events (such as ringtones), and cannot be accessed manually from media players
148 ETrackNumber = 23, ///< Track number of the content in a collection (e.g. a track number in a music album)
149 EAgentSpecificAttributeBase = 32768 ///< Base index the agents should use when implementing new agent specific attributes
154 /** The list of generic string attributes. Each of these attributes
155 has a value that is returned to the client as a string.
156 Remember to update any DRM agents if new values are added here.
158 enum TStringAttribute
160 EDescription = 0, ///< Description of the embedded object
161 EMimeType = 1, ///< Mime type of the content object
162 ETitle = 2, ///< Title of the object
163 EAuthor = 3, ///< Author of the object
164 EIconURI = 4, ///< Location of the icon for this content
165 EPreviewURI = 5, ///< Location of a preview of the content
166 EContentURI = 6, ///< URI where this content can be acquired from
167 EContentID = 7, ///< Unique CID for this content
168 EInfoURL = 8, ///< Location of further information about this content
169 EPendingRightsETA = 9, ///< Expected number of seconds before the rights arrive
170 ETransactionID = 10, ///< Transaction ID for content object. It may be used to track the content flow from one user to another one
171 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
172 ERightsIssuerURI = 12, ///< URI where the rights for this content may be acquired from
173 EGenre = 13, ///< Genre of the content
174 EUserRating = 14, ///< User rating of the content
175 EAuthoredDate = 15, ///< The Recording Year Date
176 ECoverURI = 16, ///< Cover URI for the content
177 EAgentSpecificStringAttributeBase = 32768 ///< Base index the agents should use when implementing new string attributes
181 Events relating to DRM objects, powers of 2 so they can be OR'd
182 Remember to update any DRM agents if new values are added here.
186 ERightsAvailable = 1, ///< Rights have arrived for the content object
187 ERightsExpired = 2, ///< Rights have expired or have been exhausted
188 EAgentSpecificEventBase = 1023 ///< Base index for agent-specific events
191 The type of object inside a DRM file
192 Remember to update any DRM agents if new values are added here.
196 EContainerObject = 0, ///< A container object
197 EContentObject = 1, ///< A content object
198 EAgentSpecificObject = 2 ///< An agent specific object
201 /** Type of information to display
202 Remember to update any DRM agents if new values are added here.
206 EFileProperties = 0, ///< Display file name, last modified date etc
207 EFileAndRights = 1, ///< Display file information and DRM rights information
208 ERights = 2 ///< Display DRM rights information only
211 /** The type of rights object
213 A rights object can be consumable and
214 stateless so these can be OR'd together to form a bit mask
215 Remember to update any DRM agents if new values are added here.
219 ERightsTypeConsumable = 1, ///< Rights are consumable. The are decremented whenever content is accessed (ie. play counts).
220 ERightsTypeStateless = 2 ///< Rights are stateless and the content can be used repeatedly until a condition expires (ie. expiry date)
223 /** State of a rights object
224 Remember to update any DRM agents if new values are added here.
228 ERightsStatusNone = 0, ///< Rights do not exist
229 ERightsStatusValid = 1, ///< Rights are valid, ready to use
230 ERightsStatusExpired = 2, ///< Rights have all expired
231 ERightsStatusPending = 3 ///< Rights are expected soon
234 /** The Unique Id that identifies the default content object within any file
236 _LIT(KDefaultContentObject,"DEFAULT");
238 /** Defines the properties that an application can set in an agent.
239 Remember to update any DRM agents if new values are added here.
243 EAgentPropertyBufferSize = 0, ///< Set the buffer size used by the agent when reading content. This can be used to optimise performance.
244 EAgentPropertyAgentUI = 1, ///< Enable or disable the Agent's user interface for errors and confirmation requests. 0 = Disable Agent UI, 1 = Enable Agent UI
245 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.
248 /** Maximum length of a content or container unique id
250 const TInt KMaxCafUniqueId = 1024;
252 /** Maximum length of a content object name
254 const TInt KMaxCafContentName = 1024;