epoc32/include/mm/mmcaf.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 mmcaf.h
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // CAF wrapper classes for Multimedia.
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef MMCAF_H
       
    19 #define MMCAF_H
       
    20 
       
    21 #include <f32file.h>
       
    22 #include <caf/caf.h>
       
    23 
       
    24 
       
    25 
       
    26 const TUid KUidMMFileSource = {0x101F7D3E};
       
    27 const TUid KUidMMFileHandleSource = {0x101F7D3F};
       
    28 
       
    29 /**
       
    30 @publishedAll
       
    31 @released
       
    32 
       
    33 Base class which provides a lightweight encapsulation of a DRM protected
       
    34 content source.
       
    35 */
       
    36 class TMMSource
       
    37 	{
       
    38 public:
       
    39 
       
    40 	/**
       
    41 	Get the universal identifier of the content source.
       
    42 	
       
    43 	@return The universal identifier of the content source.
       
    44 	*/
       
    45 	IMPORT_C TUid SourceType() const;
       
    46 	
       
    47 	/**
       
    48     Get the Unique Id of the source object within the DRM archive.
       
    49     
       
    50     @return A reference to a descriptor containing the Unique Id.
       
    51 	*/
       
    52 	IMPORT_C const TDesC& UniqueId() const;
       
    53 	/**
       
    54 	Get the Intent used to open the source object within the DRM archive.
       
    55 	
       
    56 	@see ContentAccess::TIntent
       
    57 	@return The Intent.
       
    58 	*/
       
    59 	IMPORT_C ContentAccess::TIntent Intent() const;
       
    60 
       
    61 	/**
       
    62 	Get the flag that indicates whether an agent's UI is enabled.
       
    63 	
       
    64 	@return A boolean flag that has the value ETrue if the UI is enabled, EFalse otherwise
       
    65 	*/
       
    66 	IMPORT_C TBool IsUIEnabled() const;
       
    67 	
       
    68 protected:
       
    69     /**
       
    70     Initialise DRM protected content source
       
    71     
       
    72     @param aSourceType The source type to differentiate
       
    73     @param aUniqueId Unique Id of the source object within the DRM archive
       
    74     @param aIntent Usage intent when opening content
       
    75     */
       
    76 	IMPORT_C TMMSource(TUid aSourceType, const TDesC& aUniqueId, ContentAccess::TIntent aIntent);
       
    77 
       
    78     /**
       
    79     Initialise DRM protected content source
       
    80     
       
    81     @param aSourceType The source type to differentiate
       
    82     @param aUniqueId Unique Id of the source object within the DRM archive
       
    83     @param aIntent Usage intent when opening content
       
    84     @param aEnableUI The agent's UI is enabled or not.
       
    85     */
       
    86 	IMPORT_C TMMSource(TUid aSourceType, const TDesC& aUniqueId, ContentAccess::TIntent aIntent, TBool aEnableUI);
       
    87 
       
    88 private:
       
    89 	/** A univeral identifier to differentiate between content sources. */
       
    90 	TUid iSourceType;
       
    91 	/** The Unique Id of the source object within the DRM archive. */
       
    92 	const TDesC& iUniqueId;
       
    93 	/** Intent to use when opening content. */
       
    94 	ContentAccess::TIntent iIntent;
       
    95 	/** Flag whether an agent's property to enable the UI may be set prior
       
    96 		to evaluating the intent.	*/
       
    97 	TBool iEnableUI;	
       
    98 	/** Reserved to avoid BC break. */
       
    99 	TInt iReserved1;
       
   100 	/** Reserved to avoid BC break. */
       
   101 	TInt iReserved2;
       
   102 	};
       
   103 
       
   104 
       
   105 /**
       
   106 @publishedAll
       
   107 @released
       
   108 
       
   109 Provides a file handle to DRM protected content source
       
   110 */
       
   111 class TMMFileHandleSource : public TMMSource
       
   112 	{
       
   113 public:
       
   114 	/**
       
   115 	Constructs a new TMMFileHandleSource object using a file handle. The Unique Id defaults
       
   116 	to an empty descriptor.  The Intent defaults to ContentAccess::EUnknown.
       
   117 	
       
   118 	@param aFile A reference to a file handle object.
       
   119 	*/
       
   120 	IMPORT_C TMMFileHandleSource(RFile& aFile);
       
   121 	/**
       
   122 	Constructs a new TMMFileHandleSource object using a file handle and the Unique Id
       
   123 	of the source object within the DRM archive.  The Intent defaults to ContentAccess::EUnknown.
       
   124 	
       
   125 	@param aFile A reference to a file handle object.
       
   126 	@param aUniqueId A reference to a descriptor containing the Unique Id.
       
   127 	*/
       
   128 	IMPORT_C TMMFileHandleSource(RFile& aFile, const TDesC& aUniqueId);
       
   129 	/**
       
   130 	Constructs a new TMMFileHandleSource object using a file handle and the Unique Id
       
   131 	of the source object within the DRM archive.  The Intent defaults to ContentAccess::EUnknown.
       
   132 	
       
   133 	@param aFile A reference to a file handle object.
       
   134 	@param aUniqueId A reference to a descriptor containing the Unique Id.
       
   135 	@param aIntent the Intent to use when opening the source object within the DRM archive.
       
   136 	*/
       
   137 	IMPORT_C TMMFileHandleSource(RFile& aFile, const TDesC& aUniqueId, ContentAccess::TIntent aIntent);
       
   138 
       
   139 	/**
       
   140 	Constructs a new TMMFileHandleSource object using a file handle and the Unique Id
       
   141 	of the source object within the DRM archive.  The Intent defaults to ContentAccess::EUnknown.
       
   142 	
       
   143 	@param aFile A reference to a file handle object.
       
   144 	@param aUniqueId A reference to a descriptor containing the Unique Id.
       
   145 	@param aIntent the Intent to use when opening the source object within the DRM archive.
       
   146 	@param aEnableUI a flag to enable the agent's UI.
       
   147 	*/
       
   148 	IMPORT_C TMMFileHandleSource(RFile& aFile, const TDesC& aUniqueId, ContentAccess::TIntent aIntent, TBool aEnableUI);
       
   149 
       
   150 	/**
       
   151     Get the file handle of the source object within the DRM archive.
       
   152     
       
   153     @return A reference to the file handle.
       
   154 	*/
       
   155 	IMPORT_C RFile& Handle() const;
       
   156 
       
   157 private:
       
   158 	/** The file handle to use when opening content. */
       
   159 	RFile& iFile;
       
   160 	};
       
   161 
       
   162 
       
   163 /**
       
   164 @publishedAll
       
   165 @released
       
   166 
       
   167 A class that provides a consistent interface between filename based and file handle based API's.
       
   168 In particular this API:
       
   169 
       
   170 - provides support for container files with embedded content
       
   171 - allows enabling/disabling of Agent provided user interface features (AgentUI)
       
   172 - allows a client to take explicit responsibility for the execution of intent
       
   173 */
       
   174 class TMMFileSource : public TMMSource
       
   175 	{
       
   176 public:
       
   177 	/**
       
   178 	Constructs a new TMMFileSource object using a filename. The Unique Id defaults
       
   179 	to an empty descriptor.  The Intent defaults to ContentAccess::EUnknown.
       
   180 	
       
   181 	@param aName A reference to a filename descriptor.
       
   182 	*/
       
   183 	IMPORT_C TMMFileSource(const TDesC& aName);
       
   184 	/**
       
   185 	Constructs a new TMMFileSource object using a filename and the Unique Id
       
   186 	of the source object within the DRM archive.  The Intent defaults to ContentAccess::EUnknown.
       
   187 	
       
   188 	@param aName A reference to a filename descriptor.
       
   189 	@param aUniqueId A reference to a descriptor containing the Unique Id.
       
   190 	*/
       
   191 	IMPORT_C TMMFileSource(const TDesC& aName, const TDesC& aUniqueId);
       
   192 	/**
       
   193 	Constructs a new TMMFileSource object using a filename and the Unique Id
       
   194 	of the source object within the DRM archive.  The Intent defaults to ContentAccess::EUnknown.
       
   195 	
       
   196 	@param aName A reference to a filename descriptor.
       
   197 	@param aUniqueId A reference to a descriptor containing the Unique Id.
       
   198 	@param aIntent the Intent to use when opening the source object within the DRM archive.
       
   199 	*/
       
   200 	IMPORT_C TMMFileSource(const TDesC& aName, const TDesC& aUniqueId, ContentAccess::TIntent aIntent);
       
   201 	
       
   202 	/**
       
   203 	Constructs a new TMMFileHandleSource object using a file handle and the Unique Id
       
   204 	of the source object within the DRM archive.  The Intent defaults to ContentAccess::EUnknown.
       
   205 	
       
   206 	@param aName A reference to a filename descriptor.
       
   207 	@param aUniqueId A reference to a descriptor containing the Unique Id.
       
   208 	@param aIntent the Intent to use when opening the source object within the DRM archive.
       
   209 	@param aEnableUI a flag to enable the agent's UI.
       
   210 	*/
       
   211 	IMPORT_C TMMFileSource(const TDesC& aName, const TDesC& aUniqueId, ContentAccess::TIntent aIntent, TBool aEnableUI);
       
   212 
       
   213 	IMPORT_C const TDesC& Name() const;
       
   214 	
       
   215 private:
       
   216 	/** The filename to use when opening content. */
       
   217 	const TDesC& iName;
       
   218 	};
       
   219 
       
   220 	
       
   221 #endif // MMCAF_H