epoc32/include/caf/caftypes.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 /*
     2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 * This file contains enumerations and constants used throughout the 
    16 * content access framework
    17 *
    18 */
    19 
    20 
    21 
    22 
    23 /**
    24  @file
    25  @publishedPartner
    26  @released
    27 */
    28 
    29 #ifndef __CAF_TYPES_H__
    30 #define __CAF_TYPES_H__
    31 
    32 #include <e32std.h>
    33 
    34 namespace ContentAccess
    35 	{
    36 #ifndef REMOVE_CAF1
    37 	/** @deprecated */
    38 	enum TQosAttribute
    39 		{
    40 		EQosBufferSize   = 0,  ///< Size of read buffer suggested by client
    41 		EQosAttrTop // Must always be last sequential entry
    42 		};
    43 
    44 	/**
    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
    47 
    48 	 @deprecated 
    49 	 */
    50 	enum TMimeFields
    51 		{
    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
    58 		}; 
    59 #endif // REMOVE_CAF1
    60 	
    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.
    64 	*/
    65 	enum TContentShareMode
    66 		{
    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
    70 		};
    71 		
    72 	/**
    73 	 * Set of valid reader intents when opening content.
    74 	 * Remember to update any DRM agents if new values are added here.
    75 	 */
    76 	enum TIntent
    77 		{
    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.
    88 		};
    89 
    90 
    91 	/**
    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.
    95 	 */
    96 	enum TOutputType
    97 		{
    98 		EContent					= 0,	///< Content file produced
    99 		EReceipt					= 1     ///< Receipt for rights produced
   100 		}; 
   101 
   102 	/**
   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.
   105 	 */
   106 	enum TImportStatus 
   107 		{
   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
   113 		};
   114 
   115 	/** 
   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.
   119 
   120 	@li ETrue If an attribute is true
   121 	@li EFalse If the attribute is false
   122 	*/
   123 	enum TAttribute
   124 			{
   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
   150 			};
   151 
   152 
   153 		
   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.
   157 		*/
   158 		enum TStringAttribute
   159 			{
   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
   178 			};
   179 
   180 		/** 
   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.
   183 		*/
   184 		enum TEventMask
   185 			{
   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
   189 			};
   190 		/** 
   191 		The type of object inside a DRM file
   192 		Remember to update any DRM agents if new values are added here.
   193 		*/
   194 		enum TEmbeddedType 
   195 			{
   196 			EContainerObject		= 0,	///< A container object
   197 			EContentObject			= 1,	///< A content object
   198 			EAgentSpecificObject	= 2	    ///< An agent specific object
   199 			};
   200 
   201 		/** Type of information to display
   202 			Remember to update any DRM agents if new values are added here.
   203 		 */
   204 		enum TDisplayInfo
   205 			{	
   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
   209 			};
   210 
   211 		/** The type of rights object
   212 
   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.
   216 		*/
   217 		enum TRightsTypeMask
   218 			{	
   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)
   221 			};
   222 		
   223 		/** State of a rights object
   224 		Remember to update any DRM agents if new values are added here.
   225 		*/
   226 		enum TRightsStatus
   227 			{	
   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
   232 			};
   233 
   234 	/** The Unique Id that identifies the default content object within any file
   235 	*/
   236 	_LIT(KDefaultContentObject,"DEFAULT");
   237 
   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.
   240 	*/
   241 	enum TAgentProperty
   242 		{
   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.
   246 		};
   247 
   248 	/** Maximum length of a content or container unique id
   249 	*/
   250 	const TInt KMaxCafUniqueId = 1024;
   251 	
   252 	/** Maximum length of a content object name
   253 	*/
   254 	const TInt KMaxCafContentName = 1024;
   255 
   256 	}
   257 
   258 #endif // __CAF_H__