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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // CAF wrapper classes for Multimedia.
26 const TUid KUidMMFileSource = {0x101F7D3E};
27 const TUid KUidMMFileHandleSource = {0x101F7D3F};
33 Base class which provides a lightweight encapsulation of a DRM protected
41 Get the universal identifier of the content source.
43 @return The universal identifier of the content source.
45 IMPORT_C TUid SourceType() const;
48 Get the Unique Id of the source object within the DRM archive.
50 @return A reference to a descriptor containing the Unique Id.
52 IMPORT_C const TDesC& UniqueId() const;
54 Get the Intent used to open the source object within the DRM archive.
56 @see ContentAccess::TIntent
59 IMPORT_C ContentAccess::TIntent Intent() const;
62 Get the flag that indicates whether an agent's UI is enabled.
64 @return A boolean flag that has the value ETrue if the UI is enabled, EFalse otherwise
66 IMPORT_C TBool IsUIEnabled() const;
70 Initialise DRM protected content source
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
76 IMPORT_C TMMSource(TUid aSourceType, const TDesC& aUniqueId, ContentAccess::TIntent aIntent);
79 Initialise DRM protected content source
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.
86 IMPORT_C TMMSource(TUid aSourceType, const TDesC& aUniqueId, ContentAccess::TIntent aIntent, TBool aEnableUI);
89 /** A univeral identifier to differentiate between content sources. */
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. */
98 /** Reserved to avoid BC break. */
100 /** Reserved to avoid BC break. */
109 Provides a file handle to DRM protected content source
111 class TMMFileHandleSource : public TMMSource
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.
118 @param aFile A reference to a file handle object.
120 IMPORT_C TMMFileHandleSource(RFile& aFile);
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.
125 @param aFile A reference to a file handle object.
126 @param aUniqueId A reference to a descriptor containing the Unique Id.
128 IMPORT_C TMMFileHandleSource(RFile& aFile, const TDesC& aUniqueId);
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.
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.
137 IMPORT_C TMMFileHandleSource(RFile& aFile, const TDesC& aUniqueId, ContentAccess::TIntent aIntent);
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.
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.
148 IMPORT_C TMMFileHandleSource(RFile& aFile, const TDesC& aUniqueId, ContentAccess::TIntent aIntent, TBool aEnableUI);
151 Get the file handle of the source object within the DRM archive.
153 @return A reference to the file handle.
155 IMPORT_C RFile& Handle() const;
158 /** The file handle to use when opening content. */
167 A class that provides a consistent interface between filename based and file handle based API's.
168 In particular this API:
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
174 class TMMFileSource : public TMMSource
178 Constructs a new TMMFileSource object using a filename. The Unique Id defaults
179 to an empty descriptor. The Intent defaults to ContentAccess::EUnknown.
181 @param aName A reference to a filename descriptor.
183 IMPORT_C TMMFileSource(const TDesC& aName);
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.
188 @param aName A reference to a filename descriptor.
189 @param aUniqueId A reference to a descriptor containing the Unique Id.
191 IMPORT_C TMMFileSource(const TDesC& aName, const TDesC& aUniqueId);
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.
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.
200 IMPORT_C TMMFileSource(const TDesC& aName, const TDesC& aUniqueId, ContentAccess::TIntent aIntent);
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.
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.
211 IMPORT_C TMMFileSource(const TDesC& aName, const TDesC& aUniqueId, ContentAccess::TIntent aIntent, TBool aEnableUI);
213 IMPORT_C const TDesC& Name() const;
216 /** The filename to use when opening content. */