epoc32/include/caf/caftypes.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/caf/caftypes.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,258 @@
     1.4 +/*
     1.5 +* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +* This file contains enumerations and constants used throughout the 
    1.19 +* content access framework
    1.20 +*
    1.21 +*/
    1.22 +
    1.23 +
    1.24 +
    1.25 +
    1.26 +/**
    1.27 + @file
    1.28 + @publishedPartner
    1.29 + @released
    1.30 +*/
    1.31 +
    1.32 +#ifndef __CAF_TYPES_H__
    1.33 +#define __CAF_TYPES_H__
    1.34 +
    1.35 +#include <e32std.h>
    1.36 +
    1.37 +namespace ContentAccess
    1.38 +	{
    1.39 +#ifndef REMOVE_CAF1
    1.40 +	/** @deprecated */
    1.41 +	enum TQosAttribute
    1.42 +		{
    1.43 +		EQosBufferSize   = 0,  ///< Size of read buffer suggested by client
    1.44 +		EQosAttrTop // Must always be last sequential entry
    1.45 +		};
    1.46 +
    1.47 +	/**
    1.48 +	 Defines an internal set of 'standard' MIME header fields. These allow an agent
    1.49 +	 to quickly read the value of a field when importing files
    1.50 +
    1.51 +	 @deprecated 
    1.52 +	 */
    1.53 +	enum TMimeFields
    1.54 +		{
    1.55 +		EContentType				= 0,	///< Content-Type :
    1.56 +		EContentLength				= 1,	///< Content-Length :
    1.57 +		EContentId					= 2,    ///< Content-Id:
    1.58 +		EContentTransferEncoding	= 3,    ///< Content-Transfer-Encoding:
    1.59 +		EBoundary					= 4,    ///< Boundary:
    1.60 +		EMimeMax				    		///< indicates the end of this enumeration
    1.61 +		}; 
    1.62 +#endif // REMOVE_CAF1
    1.63 +	
    1.64 +	/** Defines the share modes available when opening content for consumption. These
    1.65 +	modes have no effect unless the content is a file stored on the device.
    1.66 +	Remember to update any DRM agents if new values are added here.
    1.67 +	*/
    1.68 +	enum TContentShareMode
    1.69 +		{
    1.70 +		EContentShareReadOnly      = 0,  ///< Client will only read and expects others will only read.
    1.71 +		EContentShareReadWrite     = 1,  ///< Client expects to read and write and others will read and write
    1.72 +		EContentShareExclusive     = 2   ///< Client will have exclusive access to the file. This can only be used for unprotected content
    1.73 +		};
    1.74 +		
    1.75 +	/**
    1.76 +	 * Set of valid reader intents when opening content.
    1.77 +	 * Remember to update any DRM agents if new values are added here.
    1.78 +	 */
    1.79 +	enum TIntent
    1.80 +		{
    1.81 +		EPeek		= 0,	///< Reader intends to peek at content.
    1.82 +		EPlay		= 1,	///< Reader intends to play content.
    1.83 +		EView		= 2,	///< Reader intends to view content.
    1.84 +		EExecute	= 3,	///< Reader intends to execute content.
    1.85 +		EPrint		= 4,	///< Reader intends to print content.
    1.86 +		EPause		= 5,	///< Reader pauses play operation
    1.87 +		EContinue	= 6,	///< Reader continues play operation after a pause operation
    1.88 +		EStop		= 7,	///< Reader stops play operation.
    1.89 +		EUnknown    = 8,    ///< Reader is uncertain of how the content will be used. Permits free access to unprotected data but prevents access to protected content
    1.90 +		EInstall	= 9		///< Reader intends to install content.
    1.91 +		};
    1.92 +
    1.93 +
    1.94 +	/**
    1.95 +	 * Defines the types of output file produced when importing files
    1.96 +	 * into the Content Access Famework using CImportFile
    1.97 +	 * Remember to update any DRM agents if new values are added here.
    1.98 +	 */
    1.99 +	enum TOutputType
   1.100 +		{
   1.101 +		EContent					= 0,	///< Content file produced
   1.102 +		EReceipt					= 1     ///< Receipt for rights produced
   1.103 +		}; 
   1.104 +
   1.105 +	/**
   1.106 +	 The agent status codes reported when importing a file with the supplier API
   1.107 +	 Remember to update any DRM agents if new values are added here.
   1.108 +	 */
   1.109 +	enum TImportStatus 
   1.110 +		{
   1.111 +		EInProgress,				///< The import operation is proceeding with no error
   1.112 +		EWaitingForNewOutputFile,	///< The agent is waiting for the client application to provide a new output file by calling ContinueWithNewOutputFile()
   1.113 +		EComplete,					///< The import operation is complete
   1.114 +		EFailed,					///< The import was aborted by the agent 
   1.115 +		EUnsupportedMedia			///< The mime-type of the content is not supported on this device
   1.116 +		};
   1.117 +
   1.118 +	/** 
   1.119 +	The list of generic content object attributes. Each of these attributes has a 
   1.120 +	value that is either ETrue or EFalse unless otherwise specified
   1.121 +	Remember to update any DRM agents if new values are added here.
   1.122 +
   1.123 +	@li ETrue If an attribute is true
   1.124 +	@li EFalse If the attribute is false
   1.125 +	*/
   1.126 +	enum TAttribute
   1.127 +			{
   1.128 +			EIsProtected				= 0, ///< Content object is protected
   1.129 +			EIsForwardable				= 1, ///< Content object can be forwarded to another device or copied to removable media
   1.130 +			EIsModifyable				= 2, ///< The content can be modified
   1.131 +			EIsCopyable					= 3, ///< The content object can be duplicated in internal storage
   1.132 +			ECanPlay					= 4, ///< Rights exist allowing the content to be played
   1.133 +			ECanPrint					= 5, ///< Rights exist allowing the content to be printed
   1.134 +			ECanExecute					= 6, ///< Rights exist allowing the content to be executed
   1.135 +			ECanView					= 7, ///< Rights exist allowing the content to be viewed on screen
   1.136 +			ERightsNone					= 8, ///< No rights exist for the content object
   1.137 +			ERightsPending				= 9, ///< Rights are expected to arrive soon
   1.138 +			ERightsHaveExpired			= 10, ///< Rights were were present but have since expired or been consumed
   1.139 +			EPreviewAvailable			= 11, ///< A preview URI is available
   1.140 +			EContentCDataInUse			= 12, ///< Set if the content is currently being used by another CData session
   1.141 +			ECanRewind					= 13, ///< Media can be rewound without decrementing rights
   1.142 +			ECopyPaste					= 14, ///< can make copies via the clipboard
   1.143 +			ERightsConsumable			= 15, ///< Rights are consumable. The are decremented whenever content is accessed (ie. play counts).
   1.144 +			ERightsStateless			= 16, ///< Rights are stateless and the content can be used repeatedly until a condition expires (ie. expiry date)
   1.145 +			ECanMove					= 17, ///< Content can be moved
   1.146 +			ECanRename					= 18, ///< Content can be renamed
   1.147 +			ECanAutomaticConsume		= 19, ///< Rights can be consumed automatically when the content object is used for say wallpaper
   1.148 +			EContentVersion   			= 20, ///< Version identifying the incarnation of the content object 
   1.149 +			EIsMediaPlayerOnly          = 21, ///< The content can only be accessed by a media player, and cannot be accessed on an automatic event (such as a ringtone)
   1.150 +			EIsAutomatedUseOnly         = 22, ///< The content can only be used on automated events (such as ringtones), and cannot be accessed manually from media players
   1.151 +			ETrackNumber			    = 23, ///< Track number of the content in a collection (e.g. a track number in a music album)
   1.152 +			EAgentSpecificAttributeBase	= 32768	///< Base index the agents should use when implementing new agent specific attributes
   1.153 +			};
   1.154 +
   1.155 +
   1.156 +		
   1.157 +		/**  The list of generic string attributes. Each of these attributes 
   1.158 +		has a value that is returned to the client as a string.
   1.159 +		Remember to update any DRM agents if new values are added here.
   1.160 +		*/
   1.161 +		enum TStringAttribute
   1.162 +			{
   1.163 +			EDescription				= 0,	///< Description of the embedded object
   1.164 +			EMimeType					= 1,    ///< Mime type of the content object
   1.165 +			ETitle						= 2,    ///< Title of the object
   1.166 +			EAuthor						= 3,	///< Author of the object
   1.167 +			EIconURI					= 4,	///< Location of the icon for this content
   1.168 +			EPreviewURI					= 5,	///< Location of a preview of the content
   1.169 +			EContentURI					= 6,	///< URI where this content can be acquired from
   1.170 +			EContentID					= 7,	///< Unique CID for this content
   1.171 +			EInfoURL					= 8,	///< Location of further information about this content
   1.172 +			EPendingRightsETA			= 9,	///< Expected number of seconds before the rights arrive
   1.173 +			ETransactionID				= 10,	///< Transaction ID for content object. It may be used to track the content flow from one user to another one 
   1.174 +			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
   1.175 +			ERightsIssuerURI  			= 12,	///< URI where the rights for this content may be acquired from 
   1.176 +			EGenre						= 13,   ///< Genre of the content
   1.177 +			EUserRating					= 14,   ///< User rating of the content
   1.178 +			EAuthoredDate				= 15,   ///< The Recording Year Date
   1.179 +			ECoverURI					= 16,	///< Cover URI for the content
   1.180 +			EAgentSpecificStringAttributeBase	= 32768 ///< Base index the agents should use when implementing new string attributes
   1.181 +			};
   1.182 +
   1.183 +		/** 
   1.184 +		Events relating to DRM objects, powers of 2 so they can be OR'd
   1.185 +		Remember to update any DRM agents if new values are added here.
   1.186 +		*/
   1.187 +		enum TEventMask
   1.188 +			{
   1.189 +			ERightsAvailable = 1,			///< Rights have arrived for the content object
   1.190 +			ERightsExpired   = 2,			///< Rights have expired or have been exhausted
   1.191 +			EAgentSpecificEventBase = 1023  ///< Base index for agent-specific events
   1.192 +			};
   1.193 +		/** 
   1.194 +		The type of object inside a DRM file
   1.195 +		Remember to update any DRM agents if new values are added here.
   1.196 +		*/
   1.197 +		enum TEmbeddedType 
   1.198 +			{
   1.199 +			EContainerObject		= 0,	///< A container object
   1.200 +			EContentObject			= 1,	///< A content object
   1.201 +			EAgentSpecificObject	= 2	    ///< An agent specific object
   1.202 +			};
   1.203 +
   1.204 +		/** Type of information to display
   1.205 +			Remember to update any DRM agents if new values are added here.
   1.206 +		 */
   1.207 +		enum TDisplayInfo
   1.208 +			{	
   1.209 +			EFileProperties			= 0,	///< Display file name, last modified date etc
   1.210 +			EFileAndRights			= 1,	///< Display file information and DRM rights information
   1.211 +			ERights					= 2		///< Display DRM rights information only
   1.212 +			};
   1.213 +
   1.214 +		/** The type of rights object
   1.215 +
   1.216 +		A rights object can be consumable and 
   1.217 +		stateless so these can be OR'd together to form a bit mask
   1.218 +		Remember to update any DRM agents if new values are added here.
   1.219 +		*/
   1.220 +		enum TRightsTypeMask
   1.221 +			{	
   1.222 +			ERightsTypeConsumable		= 1,    ///< Rights are consumable. The are decremented whenever content is accessed (ie. play counts).
   1.223 +			ERightsTypeStateless		= 2		///< Rights are stateless and the content can be used repeatedly until a condition expires (ie. expiry date)
   1.224 +			};
   1.225 +		
   1.226 +		/** State of a rights object
   1.227 +		Remember to update any DRM agents if new values are added here.
   1.228 +		*/
   1.229 +		enum TRightsStatus
   1.230 +			{	
   1.231 +			ERightsStatusNone				= 0,    ///< Rights do not exist
   1.232 +			ERightsStatusValid				= 1,	///< Rights are valid, ready to use
   1.233 +			ERightsStatusExpired			= 2,	///< Rights have all expired
   1.234 +			ERightsStatusPending			= 3		///< Rights are expected soon
   1.235 +			};
   1.236 +
   1.237 +	/** The Unique Id that identifies the default content object within any file
   1.238 +	*/
   1.239 +	_LIT(KDefaultContentObject,"DEFAULT");
   1.240 +
   1.241 +	/** Defines the properties that an application can set in an agent.
   1.242 +	Remember to update any DRM agents if new values are added here.
   1.243 +	*/
   1.244 +	enum TAgentProperty
   1.245 +		{
   1.246 +		EAgentPropertyBufferSize				= 0,	///< Set the buffer size used by the agent when reading content. This can be used to optimise performance.
   1.247 +		EAgentPropertyAgentUI					= 1,	///< Enable or disable the Agent's user interface for errors and confirmation requests. 0 = Disable Agent UI, 1 = Enable Agent UI
   1.248 +		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.
   1.249 +		};
   1.250 +
   1.251 +	/** Maximum length of a content or container unique id
   1.252 +	*/
   1.253 +	const TInt KMaxCafUniqueId = 1024;
   1.254 +	
   1.255 +	/** Maximum length of a content object name
   1.256 +	*/
   1.257 +	const TInt KMaxCafContentName = 1024;
   1.258 +
   1.259 +	}
   1.260 +
   1.261 +#endif // __CAF_H__