williamr@2: /* williamr@2: * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * under the terms of the License "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * This file contains enumerations and constants used throughout the williamr@2: * content access framework williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: /** williamr@2: @file williamr@4: @publishedAll williamr@2: @released williamr@2: */ williamr@2: williamr@2: #ifndef __CAF_TYPES_H__ williamr@2: #define __CAF_TYPES_H__ williamr@2: williamr@2: #include williamr@2: williamr@2: namespace ContentAccess williamr@2: { williamr@2: #ifndef REMOVE_CAF1 williamr@2: /** @deprecated */ williamr@2: enum TQosAttribute williamr@2: { williamr@2: EQosBufferSize = 0, ///< Size of read buffer suggested by client williamr@2: EQosAttrTop // Must always be last sequential entry williamr@2: }; williamr@2: williamr@2: /** williamr@2: Defines an internal set of 'standard' MIME header fields. These allow an agent williamr@2: to quickly read the value of a field when importing files williamr@2: williamr@2: @deprecated williamr@2: */ williamr@2: enum TMimeFields williamr@2: { williamr@2: EContentType = 0, ///< Content-Type : williamr@2: EContentLength = 1, ///< Content-Length : williamr@2: EContentId = 2, ///< Content-Id: williamr@2: EContentTransferEncoding = 3, ///< Content-Transfer-Encoding: williamr@2: EBoundary = 4, ///< Boundary: williamr@2: EMimeMax ///< indicates the end of this enumeration williamr@2: }; williamr@2: #endif // REMOVE_CAF1 williamr@2: williamr@2: /** Defines the share modes available when opening content for consumption. These williamr@2: modes have no effect unless the content is a file stored on the device. williamr@2: Remember to update any DRM agents if new values are added here. williamr@2: */ williamr@2: enum TContentShareMode williamr@2: { williamr@2: EContentShareReadOnly = 0, ///< Client will only read and expects others will only read. williamr@2: EContentShareReadWrite = 1, ///< Client expects to read and write and others will read and write williamr@2: EContentShareExclusive = 2 ///< Client will have exclusive access to the file. This can only be used for unprotected content williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Set of valid reader intents when opening content. williamr@2: * Remember to update any DRM agents if new values are added here. williamr@2: */ williamr@2: enum TIntent williamr@2: { williamr@2: EPeek = 0, ///< Reader intends to peek at content. williamr@2: EPlay = 1, ///< Reader intends to play content. williamr@2: EView = 2, ///< Reader intends to view content. williamr@2: EExecute = 3, ///< Reader intends to execute content. williamr@2: EPrint = 4, ///< Reader intends to print content. williamr@2: EPause = 5, ///< Reader pauses play operation williamr@2: EContinue = 6, ///< Reader continues play operation after a pause operation williamr@2: EStop = 7, ///< Reader stops play operation. williamr@2: EUnknown = 8, ///< Reader is uncertain of how the content will be used. Permits free access to unprotected data but prevents access to protected content williamr@2: EInstall = 9 ///< Reader intends to install content. williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: * Defines the types of output file produced when importing files williamr@2: * into the Content Access Famework using CImportFile williamr@2: * Remember to update any DRM agents if new values are added here. williamr@2: */ williamr@2: enum TOutputType williamr@2: { williamr@2: EContent = 0, ///< Content file produced williamr@2: EReceipt = 1 ///< Receipt for rights produced williamr@2: }; williamr@2: williamr@2: /** williamr@2: The agent status codes reported when importing a file with the supplier API williamr@2: Remember to update any DRM agents if new values are added here. williamr@2: */ williamr@2: enum TImportStatus williamr@2: { williamr@2: EInProgress, ///< The import operation is proceeding with no error williamr@2: EWaitingForNewOutputFile, ///< The agent is waiting for the client application to provide a new output file by calling ContinueWithNewOutputFile() williamr@2: EComplete, ///< The import operation is complete williamr@2: EFailed, ///< The import was aborted by the agent williamr@2: EUnsupportedMedia ///< The mime-type of the content is not supported on this device williamr@2: }; williamr@2: williamr@2: /** williamr@2: The list of generic content object attributes. Each of these attributes has a williamr@2: value that is either ETrue or EFalse unless otherwise specified williamr@2: Remember to update any DRM agents if new values are added here. williamr@2: williamr@2: @li ETrue If an attribute is true williamr@2: @li EFalse If the attribute is false williamr@2: */ williamr@2: enum TAttribute williamr@2: { williamr@2: EIsProtected = 0, ///< Content object is protected williamr@2: EIsForwardable = 1, ///< Content object can be forwarded to another device or copied to removable media williamr@2: EIsModifyable = 2, ///< The content can be modified williamr@2: EIsCopyable = 3, ///< The content object can be duplicated in internal storage williamr@2: ECanPlay = 4, ///< Rights exist allowing the content to be played williamr@2: ECanPrint = 5, ///< Rights exist allowing the content to be printed williamr@2: ECanExecute = 6, ///< Rights exist allowing the content to be executed williamr@2: ECanView = 7, ///< Rights exist allowing the content to be viewed on screen williamr@2: ERightsNone = 8, ///< No rights exist for the content object williamr@2: ERightsPending = 9, ///< Rights are expected to arrive soon williamr@2: ERightsHaveExpired = 10, ///< Rights were were present but have since expired or been consumed williamr@2: EPreviewAvailable = 11, ///< A preview URI is available williamr@2: EContentCDataInUse = 12, ///< Set if the content is currently being used by another CData session williamr@2: ECanRewind = 13, ///< Media can be rewound without decrementing rights williamr@2: ECopyPaste = 14, ///< can make copies via the clipboard williamr@2: ERightsConsumable = 15, ///< Rights are consumable. The are decremented whenever content is accessed (ie. play counts). williamr@2: ERightsStateless = 16, ///< Rights are stateless and the content can be used repeatedly until a condition expires (ie. expiry date) williamr@2: ECanMove = 17, ///< Content can be moved williamr@2: ECanRename = 18, ///< Content can be renamed williamr@2: ECanAutomaticConsume = 19, ///< Rights can be consumed automatically when the content object is used for say wallpaper williamr@2: EContentVersion = 20, ///< Version identifying the incarnation of the content object williamr@2: EIsMediaPlayerOnly = 21, ///< The content can only be accessed by a media player, and cannot be accessed on an automatic event (such as a ringtone) williamr@2: EIsAutomatedUseOnly = 22, ///< The content can only be used on automated events (such as ringtones), and cannot be accessed manually from media players williamr@2: ETrackNumber = 23, ///< Track number of the content in a collection (e.g. a track number in a music album) williamr@2: EAgentSpecificAttributeBase = 32768 ///< Base index the agents should use when implementing new agent specific attributes williamr@2: }; williamr@2: williamr@2: williamr@2: williamr@2: /** The list of generic string attributes. Each of these attributes williamr@2: has a value that is returned to the client as a string. williamr@2: Remember to update any DRM agents if new values are added here. williamr@2: */ williamr@2: enum TStringAttribute williamr@2: { williamr@2: EDescription = 0, ///< Description of the embedded object williamr@2: EMimeType = 1, ///< Mime type of the content object williamr@2: ETitle = 2, ///< Title of the object williamr@2: EAuthor = 3, ///< Author of the object williamr@2: EIconURI = 4, ///< Location of the icon for this content williamr@2: EPreviewURI = 5, ///< Location of a preview of the content williamr@2: EContentURI = 6, ///< URI where this content can be acquired from williamr@2: EContentID = 7, ///< Unique CID for this content williamr@2: EInfoURL = 8, ///< Location of further information about this content williamr@2: EPendingRightsETA = 9, ///< Expected number of seconds before the rights arrive williamr@2: ETransactionID = 10, ///< Transaction ID for content object. It may be used to track the content flow from one user to another one williamr@2: 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 williamr@2: ERightsIssuerURI = 12, ///< URI where the rights for this content may be acquired from williamr@2: EGenre = 13, ///< Genre of the content williamr@2: EUserRating = 14, ///< User rating of the content williamr@2: EAuthoredDate = 15, ///< The Recording Year Date williamr@2: ECoverURI = 16, ///< Cover URI for the content williamr@2: EAgentSpecificStringAttributeBase = 32768 ///< Base index the agents should use when implementing new string attributes williamr@2: }; williamr@2: williamr@2: /** williamr@2: Events relating to DRM objects, powers of 2 so they can be OR'd williamr@2: Remember to update any DRM agents if new values are added here. williamr@2: */ williamr@2: enum TEventMask williamr@2: { williamr@2: ERightsAvailable = 1, ///< Rights have arrived for the content object williamr@2: ERightsExpired = 2, ///< Rights have expired or have been exhausted williamr@2: EAgentSpecificEventBase = 1023 ///< Base index for agent-specific events williamr@2: }; williamr@2: /** williamr@2: The type of object inside a DRM file williamr@2: Remember to update any DRM agents if new values are added here. williamr@2: */ williamr@2: enum TEmbeddedType williamr@2: { williamr@2: EContainerObject = 0, ///< A container object williamr@2: EContentObject = 1, ///< A content object williamr@2: EAgentSpecificObject = 2 ///< An agent specific object williamr@2: }; williamr@2: williamr@2: /** Type of information to display williamr@2: Remember to update any DRM agents if new values are added here. williamr@2: */ williamr@2: enum TDisplayInfo williamr@2: { williamr@2: EFileProperties = 0, ///< Display file name, last modified date etc williamr@2: EFileAndRights = 1, ///< Display file information and DRM rights information williamr@2: ERights = 2 ///< Display DRM rights information only williamr@2: }; williamr@2: williamr@2: /** The type of rights object williamr@2: williamr@2: A rights object can be consumable and williamr@2: stateless so these can be OR'd together to form a bit mask williamr@2: Remember to update any DRM agents if new values are added here. williamr@2: */ williamr@2: enum TRightsTypeMask williamr@2: { williamr@2: ERightsTypeConsumable = 1, ///< Rights are consumable. The are decremented whenever content is accessed (ie. play counts). williamr@2: ERightsTypeStateless = 2 ///< Rights are stateless and the content can be used repeatedly until a condition expires (ie. expiry date) williamr@2: }; williamr@2: williamr@2: /** State of a rights object williamr@2: Remember to update any DRM agents if new values are added here. williamr@2: */ williamr@2: enum TRightsStatus williamr@2: { williamr@2: ERightsStatusNone = 0, ///< Rights do not exist williamr@2: ERightsStatusValid = 1, ///< Rights are valid, ready to use williamr@2: ERightsStatusExpired = 2, ///< Rights have all expired williamr@2: ERightsStatusPending = 3 ///< Rights are expected soon williamr@2: }; williamr@2: williamr@2: /** The Unique Id that identifies the default content object within any file williamr@2: */ williamr@2: _LIT(KDefaultContentObject,"DEFAULT"); williamr@2: williamr@2: /** Defines the properties that an application can set in an agent. williamr@2: Remember to update any DRM agents if new values are added here. williamr@2: */ williamr@2: enum TAgentProperty williamr@2: { williamr@2: EAgentPropertyBufferSize = 0, ///< Set the buffer size used by the agent when reading content. This can be used to optimise performance. williamr@2: EAgentPropertyAgentUI = 1, ///< Enable or disable the Agent's user interface for errors and confirmation requests. 0 = Disable Agent UI, 1 = Enable Agent UI williamr@2: 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. williamr@2: }; williamr@2: williamr@2: /** Maximum length of a content or container unique id williamr@2: */ williamr@2: const TInt KMaxCafUniqueId = 1024; williamr@2: williamr@2: /** Maximum length of a content object name williamr@2: */ williamr@2: const TInt KMaxCafContentName = 1024; williamr@2: williamr@2: } williamr@2: williamr@2: #endif // __CAF_H__ williamr@4: