epoc32/include/mm/mmcaf.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mm/mmcaf.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mm/mmcaf.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,221 @@
     1.4 -mmcaf.h
     1.5 +// Copyright (c) 2005-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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 +// CAF wrapper classes for Multimedia.
    1.19 +// 
    1.20 +//
    1.21 +
    1.22 +#ifndef MMCAF_H
    1.23 +#define MMCAF_H
    1.24 +
    1.25 +#include <f32file.h>
    1.26 +#include <caf/caf.h>
    1.27 +
    1.28 +
    1.29 +
    1.30 +const TUid KUidMMFileSource = {0x101F7D3E};
    1.31 +const TUid KUidMMFileHandleSource = {0x101F7D3F};
    1.32 +
    1.33 +/**
    1.34 +@publishedAll
    1.35 +@released
    1.36 +
    1.37 +Base class which provides a lightweight encapsulation of a DRM protected
    1.38 +content source.
    1.39 +*/
    1.40 +class TMMSource
    1.41 +	{
    1.42 +public:
    1.43 +
    1.44 +	/**
    1.45 +	Get the universal identifier of the content source.
    1.46 +	
    1.47 +	@return The universal identifier of the content source.
    1.48 +	*/
    1.49 +	IMPORT_C TUid SourceType() const;
    1.50 +	
    1.51 +	/**
    1.52 +    Get the Unique Id of the source object within the DRM archive.
    1.53 +    
    1.54 +    @return A reference to a descriptor containing the Unique Id.
    1.55 +	*/
    1.56 +	IMPORT_C const TDesC& UniqueId() const;
    1.57 +	/**
    1.58 +	Get the Intent used to open the source object within the DRM archive.
    1.59 +	
    1.60 +	@see ContentAccess::TIntent
    1.61 +	@return The Intent.
    1.62 +	*/
    1.63 +	IMPORT_C ContentAccess::TIntent Intent() const;
    1.64 +
    1.65 +	/**
    1.66 +	Get the flag that indicates whether an agent's UI is enabled.
    1.67 +	
    1.68 +	@return A boolean flag that has the value ETrue if the UI is enabled, EFalse otherwise
    1.69 +	*/
    1.70 +	IMPORT_C TBool IsUIEnabled() const;
    1.71 +	
    1.72 +protected:
    1.73 +    /**
    1.74 +    Initialise DRM protected content source
    1.75 +    
    1.76 +    @param aSourceType The source type to differentiate
    1.77 +    @param aUniqueId Unique Id of the source object within the DRM archive
    1.78 +    @param aIntent Usage intent when opening content
    1.79 +    */
    1.80 +	IMPORT_C TMMSource(TUid aSourceType, const TDesC& aUniqueId, ContentAccess::TIntent aIntent);
    1.81 +
    1.82 +    /**
    1.83 +    Initialise DRM protected content source
    1.84 +    
    1.85 +    @param aSourceType The source type to differentiate
    1.86 +    @param aUniqueId Unique Id of the source object within the DRM archive
    1.87 +    @param aIntent Usage intent when opening content
    1.88 +    @param aEnableUI The agent's UI is enabled or not.
    1.89 +    */
    1.90 +	IMPORT_C TMMSource(TUid aSourceType, const TDesC& aUniqueId, ContentAccess::TIntent aIntent, TBool aEnableUI);
    1.91 +
    1.92 +private:
    1.93 +	/** A univeral identifier to differentiate between content sources. */
    1.94 +	TUid iSourceType;
    1.95 +	/** The Unique Id of the source object within the DRM archive. */
    1.96 +	const TDesC& iUniqueId;
    1.97 +	/** Intent to use when opening content. */
    1.98 +	ContentAccess::TIntent iIntent;
    1.99 +	/** Flag whether an agent's property to enable the UI may be set prior
   1.100 +		to evaluating the intent.	*/
   1.101 +	TBool iEnableUI;	
   1.102 +	/** Reserved to avoid BC break. */
   1.103 +	TInt iReserved1;
   1.104 +	/** Reserved to avoid BC break. */
   1.105 +	TInt iReserved2;
   1.106 +	};
   1.107 +
   1.108 +
   1.109 +/**
   1.110 +@publishedAll
   1.111 +@released
   1.112 +
   1.113 +Provides a file handle to DRM protected content source
   1.114 +*/
   1.115 +class TMMFileHandleSource : public TMMSource
   1.116 +	{
   1.117 +public:
   1.118 +	/**
   1.119 +	Constructs a new TMMFileHandleSource object using a file handle. The Unique Id defaults
   1.120 +	to an empty descriptor.  The Intent defaults to ContentAccess::EUnknown.
   1.121 +	
   1.122 +	@param aFile A reference to a file handle object.
   1.123 +	*/
   1.124 +	IMPORT_C TMMFileHandleSource(RFile& aFile);
   1.125 +	/**
   1.126 +	Constructs a new TMMFileHandleSource object using a file handle and the Unique Id
   1.127 +	of the source object within the DRM archive.  The Intent defaults to ContentAccess::EUnknown.
   1.128 +	
   1.129 +	@param aFile A reference to a file handle object.
   1.130 +	@param aUniqueId A reference to a descriptor containing the Unique Id.
   1.131 +	*/
   1.132 +	IMPORT_C TMMFileHandleSource(RFile& aFile, const TDesC& aUniqueId);
   1.133 +	/**
   1.134 +	Constructs a new TMMFileHandleSource object using a file handle and the Unique Id
   1.135 +	of the source object within the DRM archive.  The Intent defaults to ContentAccess::EUnknown.
   1.136 +	
   1.137 +	@param aFile A reference to a file handle object.
   1.138 +	@param aUniqueId A reference to a descriptor containing the Unique Id.
   1.139 +	@param aIntent the Intent to use when opening the source object within the DRM archive.
   1.140 +	*/
   1.141 +	IMPORT_C TMMFileHandleSource(RFile& aFile, const TDesC& aUniqueId, ContentAccess::TIntent aIntent);
   1.142 +
   1.143 +	/**
   1.144 +	Constructs a new TMMFileHandleSource object using a file handle and the Unique Id
   1.145 +	of the source object within the DRM archive.  The Intent defaults to ContentAccess::EUnknown.
   1.146 +	
   1.147 +	@param aFile A reference to a file handle object.
   1.148 +	@param aUniqueId A reference to a descriptor containing the Unique Id.
   1.149 +	@param aIntent the Intent to use when opening the source object within the DRM archive.
   1.150 +	@param aEnableUI a flag to enable the agent's UI.
   1.151 +	*/
   1.152 +	IMPORT_C TMMFileHandleSource(RFile& aFile, const TDesC& aUniqueId, ContentAccess::TIntent aIntent, TBool aEnableUI);
   1.153 +
   1.154 +	/**
   1.155 +    Get the file handle of the source object within the DRM archive.
   1.156 +    
   1.157 +    @return A reference to the file handle.
   1.158 +	*/
   1.159 +	IMPORT_C RFile& Handle() const;
   1.160 +
   1.161 +private:
   1.162 +	/** The file handle to use when opening content. */
   1.163 +	RFile& iFile;
   1.164 +	};
   1.165 +
   1.166 +
   1.167 +/**
   1.168 +@publishedAll
   1.169 +@released
   1.170 +
   1.171 +A class that provides a consistent interface between filename based and file handle based API's.
   1.172 +In particular this API:
   1.173 +
   1.174 +- provides support for container files with embedded content
   1.175 +- allows enabling/disabling of Agent provided user interface features (AgentUI)
   1.176 +- allows a client to take explicit responsibility for the execution of intent
   1.177 +*/
   1.178 +class TMMFileSource : public TMMSource
   1.179 +	{
   1.180 +public:
   1.181 +	/**
   1.182 +	Constructs a new TMMFileSource object using a filename. The Unique Id defaults
   1.183 +	to an empty descriptor.  The Intent defaults to ContentAccess::EUnknown.
   1.184 +	
   1.185 +	@param aName A reference to a filename descriptor.
   1.186 +	*/
   1.187 +	IMPORT_C TMMFileSource(const TDesC& aName);
   1.188 +	/**
   1.189 +	Constructs a new TMMFileSource object using a filename and the Unique Id
   1.190 +	of the source object within the DRM archive.  The Intent defaults to ContentAccess::EUnknown.
   1.191 +	
   1.192 +	@param aName A reference to a filename descriptor.
   1.193 +	@param aUniqueId A reference to a descriptor containing the Unique Id.
   1.194 +	*/
   1.195 +	IMPORT_C TMMFileSource(const TDesC& aName, const TDesC& aUniqueId);
   1.196 +	/**
   1.197 +	Constructs a new TMMFileSource object using a filename and the Unique Id
   1.198 +	of the source object within the DRM archive.  The Intent defaults to ContentAccess::EUnknown.
   1.199 +	
   1.200 +	@param aName A reference to a filename descriptor.
   1.201 +	@param aUniqueId A reference to a descriptor containing the Unique Id.
   1.202 +	@param aIntent the Intent to use when opening the source object within the DRM archive.
   1.203 +	*/
   1.204 +	IMPORT_C TMMFileSource(const TDesC& aName, const TDesC& aUniqueId, ContentAccess::TIntent aIntent);
   1.205 +	
   1.206 +	/**
   1.207 +	Constructs a new TMMFileHandleSource object using a file handle and the Unique Id
   1.208 +	of the source object within the DRM archive.  The Intent defaults to ContentAccess::EUnknown.
   1.209 +	
   1.210 +	@param aName A reference to a filename descriptor.
   1.211 +	@param aUniqueId A reference to a descriptor containing the Unique Id.
   1.212 +	@param aIntent the Intent to use when opening the source object within the DRM archive.
   1.213 +	@param aEnableUI a flag to enable the agent's UI.
   1.214 +	*/
   1.215 +	IMPORT_C TMMFileSource(const TDesC& aName, const TDesC& aUniqueId, ContentAccess::TIntent aIntent, TBool aEnableUI);
   1.216 +
   1.217 +	IMPORT_C const TDesC& Name() const;
   1.218 +	
   1.219 +private:
   1.220 +	/** The filename to use when opening content. */
   1.221 +	const TDesC& iName;
   1.222 +	};
   1.223 +
   1.224 +	
   1.225 +#endif // MMCAF_H