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