williamr@2: // Copyright (c) 2005-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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.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: // CAF wrapper classes for Multimedia. williamr@2: // williamr@2: // williamr@2: williamr@2: #ifndef MMCAF_H williamr@2: #define MMCAF_H williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: williamr@2: williamr@2: const TUid KUidMMFileSource = {0x101F7D3E}; williamr@2: const TUid KUidMMFileHandleSource = {0x101F7D3F}; williamr@2: williamr@2: /** williamr@2: @publishedAll williamr@2: @released williamr@2: williamr@2: Base class which provides a lightweight encapsulation of a DRM protected williamr@2: content source. williamr@2: */ williamr@2: class TMMSource williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: Get the universal identifier of the content source. williamr@2: williamr@2: @return The universal identifier of the content source. williamr@2: */ williamr@2: IMPORT_C TUid SourceType() const; williamr@2: williamr@2: /** williamr@2: Get the Unique Id of the source object within the DRM archive. williamr@2: williamr@2: @return A reference to a descriptor containing the Unique Id. williamr@2: */ williamr@2: IMPORT_C const TDesC& UniqueId() const; williamr@2: /** williamr@2: Get the Intent used to open the source object within the DRM archive. williamr@2: williamr@2: @see ContentAccess::TIntent williamr@2: @return The Intent. williamr@2: */ williamr@2: IMPORT_C ContentAccess::TIntent Intent() const; williamr@2: williamr@2: /** williamr@2: Get the flag that indicates whether an agent's UI is enabled. williamr@2: williamr@2: @return A boolean flag that has the value ETrue if the UI is enabled, EFalse otherwise williamr@2: */ williamr@2: IMPORT_C TBool IsUIEnabled() const; williamr@2: williamr@2: protected: williamr@2: /** williamr@2: Initialise DRM protected content source williamr@2: williamr@2: @param aSourceType The source type to differentiate williamr@2: @param aUniqueId Unique Id of the source object within the DRM archive williamr@2: @param aIntent Usage intent when opening content williamr@2: */ williamr@2: IMPORT_C TMMSource(TUid aSourceType, const TDesC& aUniqueId, ContentAccess::TIntent aIntent); williamr@2: williamr@2: /** williamr@2: Initialise DRM protected content source williamr@2: williamr@2: @param aSourceType The source type to differentiate williamr@2: @param aUniqueId Unique Id of the source object within the DRM archive williamr@2: @param aIntent Usage intent when opening content williamr@2: @param aEnableUI The agent's UI is enabled or not. williamr@2: */ williamr@2: IMPORT_C TMMSource(TUid aSourceType, const TDesC& aUniqueId, ContentAccess::TIntent aIntent, TBool aEnableUI); williamr@2: williamr@2: private: williamr@2: /** A univeral identifier to differentiate between content sources. */ williamr@2: TUid iSourceType; williamr@2: /** The Unique Id of the source object within the DRM archive. */ williamr@2: const TDesC& iUniqueId; williamr@2: /** Intent to use when opening content. */ williamr@2: ContentAccess::TIntent iIntent; williamr@2: /** Flag whether an agent's property to enable the UI may be set prior williamr@2: to evaluating the intent. */ williamr@2: TBool iEnableUI; williamr@2: /** Reserved to avoid BC break. */ williamr@2: TInt iReserved1; williamr@2: /** Reserved to avoid BC break. */ williamr@2: TInt iReserved2; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: @publishedAll williamr@2: @released williamr@2: williamr@2: Provides a file handle to DRM protected content source williamr@2: */ williamr@2: class TMMFileHandleSource : public TMMSource williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Constructs a new TMMFileHandleSource object using a file handle. The Unique Id defaults williamr@2: to an empty descriptor. The Intent defaults to ContentAccess::EUnknown. williamr@2: williamr@2: @param aFile A reference to a file handle object. williamr@2: */ williamr@2: IMPORT_C TMMFileHandleSource(RFile& aFile); williamr@2: /** williamr@2: Constructs a new TMMFileHandleSource object using a file handle and the Unique Id williamr@2: of the source object within the DRM archive. The Intent defaults to ContentAccess::EUnknown. williamr@2: williamr@2: @param aFile A reference to a file handle object. williamr@2: @param aUniqueId A reference to a descriptor containing the Unique Id. williamr@2: */ williamr@2: IMPORT_C TMMFileHandleSource(RFile& aFile, const TDesC& aUniqueId); williamr@2: /** williamr@2: Constructs a new TMMFileHandleSource object using a file handle and the Unique Id williamr@2: of the source object within the DRM archive. The Intent defaults to ContentAccess::EUnknown. williamr@2: williamr@2: @param aFile A reference to a file handle object. williamr@2: @param aUniqueId A reference to a descriptor containing the Unique Id. williamr@2: @param aIntent the Intent to use when opening the source object within the DRM archive. williamr@2: */ williamr@2: IMPORT_C TMMFileHandleSource(RFile& aFile, const TDesC& aUniqueId, ContentAccess::TIntent aIntent); williamr@2: williamr@2: /** williamr@2: Constructs a new TMMFileHandleSource object using a file handle and the Unique Id williamr@2: of the source object within the DRM archive. The Intent defaults to ContentAccess::EUnknown. williamr@2: williamr@2: @param aFile A reference to a file handle object. williamr@2: @param aUniqueId A reference to a descriptor containing the Unique Id. williamr@2: @param aIntent the Intent to use when opening the source object within the DRM archive. williamr@2: @param aEnableUI a flag to enable the agent's UI. williamr@2: */ williamr@2: IMPORT_C TMMFileHandleSource(RFile& aFile, const TDesC& aUniqueId, ContentAccess::TIntent aIntent, TBool aEnableUI); williamr@2: williamr@2: /** williamr@2: Get the file handle of the source object within the DRM archive. williamr@2: williamr@2: @return A reference to the file handle. williamr@2: */ williamr@2: IMPORT_C RFile& Handle() const; williamr@2: williamr@2: private: williamr@2: /** The file handle to use when opening content. */ williamr@2: RFile& iFile; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: @publishedAll williamr@2: @released williamr@2: williamr@2: A class that provides a consistent interface between filename based and file handle based API's. williamr@2: In particular this API: williamr@2: williamr@2: - provides support for container files with embedded content williamr@2: - allows enabling/disabling of Agent provided user interface features (AgentUI) williamr@2: - allows a client to take explicit responsibility for the execution of intent williamr@2: */ williamr@2: class TMMFileSource : public TMMSource williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Constructs a new TMMFileSource object using a filename. The Unique Id defaults williamr@2: to an empty descriptor. The Intent defaults to ContentAccess::EUnknown. williamr@2: williamr@2: @param aName A reference to a filename descriptor. williamr@2: */ williamr@2: IMPORT_C TMMFileSource(const TDesC& aName); williamr@2: /** williamr@2: Constructs a new TMMFileSource object using a filename and the Unique Id williamr@2: of the source object within the DRM archive. The Intent defaults to ContentAccess::EUnknown. williamr@2: williamr@2: @param aName A reference to a filename descriptor. williamr@2: @param aUniqueId A reference to a descriptor containing the Unique Id. williamr@2: */ williamr@2: IMPORT_C TMMFileSource(const TDesC& aName, const TDesC& aUniqueId); williamr@2: /** williamr@2: Constructs a new TMMFileSource object using a filename and the Unique Id williamr@2: of the source object within the DRM archive. The Intent defaults to ContentAccess::EUnknown. williamr@2: williamr@2: @param aName A reference to a filename descriptor. williamr@2: @param aUniqueId A reference to a descriptor containing the Unique Id. williamr@2: @param aIntent the Intent to use when opening the source object within the DRM archive. williamr@2: */ williamr@2: IMPORT_C TMMFileSource(const TDesC& aName, const TDesC& aUniqueId, ContentAccess::TIntent aIntent); williamr@2: williamr@2: /** williamr@2: Constructs a new TMMFileHandleSource object using a file handle and the Unique Id williamr@2: of the source object within the DRM archive. The Intent defaults to ContentAccess::EUnknown. williamr@2: williamr@2: @param aName A reference to a filename descriptor. williamr@2: @param aUniqueId A reference to a descriptor containing the Unique Id. williamr@2: @param aIntent the Intent to use when opening the source object within the DRM archive. williamr@2: @param aEnableUI a flag to enable the agent's UI. williamr@2: */ williamr@2: IMPORT_C TMMFileSource(const TDesC& aName, const TDesC& aUniqueId, ContentAccess::TIntent aIntent, TBool aEnableUI); williamr@2: williamr@2: IMPORT_C const TDesC& Name() const; williamr@2: williamr@2: private: williamr@2: /** The filename to use when opening content. */ williamr@2: const TDesC& iName; williamr@2: }; williamr@2: williamr@2: williamr@2: #endif // MMCAF_H