sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
|
sl@0
|
20 |
/**
|
sl@0
|
21 |
@file
|
sl@0
|
22 |
|
sl@0
|
23 |
@publishedAll
|
sl@0
|
24 |
@released
|
sl@0
|
25 |
*/
|
sl@0
|
26 |
|
sl@0
|
27 |
|
sl@0
|
28 |
#ifndef __DATA_H__
|
sl@0
|
29 |
#define __DATA_H__
|
sl@0
|
30 |
|
sl@0
|
31 |
#include <e32base.h>
|
sl@0
|
32 |
#include <f32file.h>
|
sl@0
|
33 |
#include <caf/caftypes.h>
|
sl@0
|
34 |
|
sl@0
|
35 |
namespace ContentAccess
|
sl@0
|
36 |
{
|
sl@0
|
37 |
class CAgentFactory;
|
sl@0
|
38 |
class CAgentInfo;
|
sl@0
|
39 |
class TVirtualPathPtr;
|
sl@0
|
40 |
class CAgentData;
|
sl@0
|
41 |
class RAttributeSet;
|
sl@0
|
42 |
class RStringAttributeSet;
|
sl@0
|
43 |
|
sl@0
|
44 |
|
sl@0
|
45 |
/**
|
sl@0
|
46 |
Allows clients to read data from a content object.
|
sl@0
|
47 |
|
sl@0
|
48 |
This class is initialised with an agent implementation that is
|
sl@0
|
49 |
responsible for this content object.
|
sl@0
|
50 |
|
sl@0
|
51 |
*/
|
sl@0
|
52 |
class CData : public CBase
|
sl@0
|
53 |
{
|
sl@0
|
54 |
public:
|
sl@0
|
55 |
/**
|
sl@0
|
56 |
Creates a new CData object.
|
sl@0
|
57 |
|
sl@0
|
58 |
@param aVirtualPath The content object to read
|
sl@0
|
59 |
@param aIntent The intended use of the content.
|
sl@0
|
60 |
@param aShareMode The file share mode used to open this content.
|
sl@0
|
61 |
@return The new CData object.
|
sl@0
|
62 |
|
sl@0
|
63 |
@leave KErrNotFound The content object with the given UniqueId does not exist.
|
sl@0
|
64 |
@leave KErrCAPendingRights The rights have not yet arrived but are expected soon.
|
sl@0
|
65 |
@leave KErrCANoPermission Rights exist but the specified intent is not permitted.
|
sl@0
|
66 |
@leave KErrCANoRights No rights exist for the content object.
|
sl@0
|
67 |
@leave KErrCANotSupported Unable to open the object with the specified UniqueId, it may be a container object.
|
sl@0
|
68 |
@leave KErrPermissionDenied The agent does not allow the client to access the content object.
|
sl@0
|
69 |
@leave KErrAccessDenied The content is already in use.
|
sl@0
|
70 |
@leave ... One of the other CAF error codes defined in \c caferr.h
|
sl@0
|
71 |
or one of the other system-wide error codes
|
sl@0
|
72 |
for any other errors.
|
sl@0
|
73 |
*/
|
sl@0
|
74 |
IMPORT_C static CData* NewL(const TVirtualPathPtr& aVirtualPath,
|
sl@0
|
75 |
TIntent aIntent, TContentShareMode aShareMode);
|
sl@0
|
76 |
|
sl@0
|
77 |
/**
|
sl@0
|
78 |
Creates a new CData object.
|
sl@0
|
79 |
|
sl@0
|
80 |
@param aVirtualPath The content object to read.
|
sl@0
|
81 |
@param aShareMode The file share mode used to open this content.
|
sl@0
|
82 |
@return The new CData object.
|
sl@0
|
83 |
|
sl@0
|
84 |
@leave KErrNotFound The content object with the given UniqueId does not exist.
|
sl@0
|
85 |
@leave KErrCAPendingRights The rights have not yet arrived but are expected soon.
|
sl@0
|
86 |
@leave KErrCANoPermission Rights exist but the specified intent is not permitted.
|
sl@0
|
87 |
@leave KErrCANoRights No rights exist for the content object.
|
sl@0
|
88 |
@leave KErrCANotSupported Unable to open the object with the specified UniqueId, it may be a container object.
|
sl@0
|
89 |
@leave KErrPermissionDenied The agent does not allow the client to access the content object.
|
sl@0
|
90 |
@leave KErrAccessDenied The content is already in use.
|
sl@0
|
91 |
@leave ... One of the other CAF error codes defined in \c caferr.h
|
sl@0
|
92 |
or one of the other system-wide error codes for
|
sl@0
|
93 |
any other errors.
|
sl@0
|
94 |
*/
|
sl@0
|
95 |
IMPORT_C static CData* NewL(const TVirtualPathPtr& aVirtualPath,
|
sl@0
|
96 |
TContentShareMode aShareMode);
|
sl@0
|
97 |
|
sl@0
|
98 |
|
sl@0
|
99 |
/**
|
sl@0
|
100 |
Creates a new CData object
|
sl@0
|
101 |
|
sl@0
|
102 |
@param aVirtualPath The content object to read.
|
sl@0
|
103 |
@param aIntent The intended use of the content.
|
sl@0
|
104 |
@param aShareMode The file share mode used to open this content.
|
sl@0
|
105 |
@return The new CData object.
|
sl@0
|
106 |
|
sl@0
|
107 |
@leave KErrNotFound The content object with the given UniqueId does not exist.
|
sl@0
|
108 |
@leave KErrCAPendingRights The rights have not yet arrived but are expected soon.
|
sl@0
|
109 |
@leave KErrCANoPermission Rights exist but the specified intent is not permitted.
|
sl@0
|
110 |
@leave KErrCANoRights No rights exist for the content object.
|
sl@0
|
111 |
@leave KErrCANotSupported Unable to open the object with the specified UniqueId, it may be a container object.
|
sl@0
|
112 |
@leave KErrPermissionDenied The agent does not allow the client to access the content object.
|
sl@0
|
113 |
@leave KErrAccessDenied The content is already in use.
|
sl@0
|
114 |
@leave ... One of the other CAF error codes defined in \c caferr.h
|
sl@0
|
115 |
or one of the other system-wide error codes for
|
sl@0
|
116 |
any other errors.
|
sl@0
|
117 |
*/
|
sl@0
|
118 |
IMPORT_C static CData* NewLC(const TVirtualPathPtr& aVirtualPath,
|
sl@0
|
119 |
TIntent aIntent, TContentShareMode aShareMode);
|
sl@0
|
120 |
|
sl@0
|
121 |
/**
|
sl@0
|
122 |
Creates a new CData object
|
sl@0
|
123 |
|
sl@0
|
124 |
@param aVirtualPath The content object to read.
|
sl@0
|
125 |
@param aShareMode The file share mode used to open this content.
|
sl@0
|
126 |
@return The new CData object.
|
sl@0
|
127 |
|
sl@0
|
128 |
@leave KErrNotFound The content object with the given UniqueId does not exist.
|
sl@0
|
129 |
@leave KErrCAPendingRights The rights have not yet arrived but are expected soon.
|
sl@0
|
130 |
@leave KErrCANoPermission Rights exist but the specified intent is not permitted.
|
sl@0
|
131 |
@leave KErrCANoRights No rights exist for the content object.
|
sl@0
|
132 |
@leave KErrCANotSupported Unable to open the object with the specified UniqueId, it may be a container object.
|
sl@0
|
133 |
@leave KErrPermissionDenied The agent does not allow the client to access the content object.
|
sl@0
|
134 |
@leave KErrAccessDenied The content is already in use.
|
sl@0
|
135 |
@leave ... One of the other CAF error codes defined in \c caferr.h
|
sl@0
|
136 |
or one of the other system-wide error codes for
|
sl@0
|
137 |
any other errors.
|
sl@0
|
138 |
*/
|
sl@0
|
139 |
IMPORT_C static CData* NewLC(const TVirtualPathPtr& aVirtualPath,
|
sl@0
|
140 |
TContentShareMode aShareMode);
|
sl@0
|
141 |
|
sl@0
|
142 |
|
sl@0
|
143 |
/**
|
sl@0
|
144 |
Creates a new CData object.
|
sl@0
|
145 |
|
sl@0
|
146 |
@param aFile An open RFile handle, the agent will make a duplicate of this handle.
|
sl@0
|
147 |
The underlying RFs session should be shared for transfer to other processes using RFs::ShareProtected(), since the agent may use transfer this handle to its own or one of the system servers.
|
sl@0
|
148 |
@param aUniqueId The content object to read.
|
sl@0
|
149 |
@param aIntent The intended use of the content.
|
sl@0
|
150 |
@return The new CData object.
|
sl@0
|
151 |
|
sl@0
|
152 |
@leave KErrNotFound The content object with the given UniqueId does not exist.
|
sl@0
|
153 |
@leave KErrCAPendingRights The rights have not yet arrived but are expected soon.
|
sl@0
|
154 |
@leave KErrCANoPermission Rights exist but the specified intent is not permitted.
|
sl@0
|
155 |
@leave KErrCANoRights No rights exist for the content object.
|
sl@0
|
156 |
@leave KErrCANotSupported Unable to open the object with the specified UniqueId, it may be a container object.
|
sl@0
|
157 |
@leave KErrPermissionDenied The agent does not allow the client to access the content object.
|
sl@0
|
158 |
@leave KErrAccessDenied The content is already in use.
|
sl@0
|
159 |
@leave ... One of the other CAF error codes defined in \c caferr.h
|
sl@0
|
160 |
or one of the other system-wide error codes for
|
sl@0
|
161 |
any other errors.
|
sl@0
|
162 |
*/
|
sl@0
|
163 |
IMPORT_C static CData* NewL(RFile& aFile, const TDesC& aUniqueId, TIntent aIntent);
|
sl@0
|
164 |
|
sl@0
|
165 |
/**
|
sl@0
|
166 |
Creates a new CData object.
|
sl@0
|
167 |
|
sl@0
|
168 |
@param aFile An open RFile handle, the agent will make a duplicate of this handle.
|
sl@0
|
169 |
The underlying RFs session should be shared for transfer to other processes using RFs::ShareProtected(), since the agent may use transfer this handle to its own or one of the system servers.
|
sl@0
|
170 |
@param aUniqueId The content object to read.
|
sl@0
|
171 |
@return The new CData object.
|
sl@0
|
172 |
|
sl@0
|
173 |
@leave KErrNotFound The content object with the given UniqueId does not exist.
|
sl@0
|
174 |
@leave KErrCAPendingRights The rights have not yet arrived but are expected soon.
|
sl@0
|
175 |
@leave KErrCANoPermission Rights exist but the specified intent is not permitted.
|
sl@0
|
176 |
@leave KErrCANoRights No rights exist for the content object.
|
sl@0
|
177 |
@leave KErrCANotSupported Unable to open the object with the specified UniqueId, it may be a container object.
|
sl@0
|
178 |
@leave KErrPermissionDenied The agent does not allow the client to access the content object.
|
sl@0
|
179 |
@leave KErrAccessDenied The content is already in use.
|
sl@0
|
180 |
@leave ... One of the other CAF error codes defined in \c caferr.h
|
sl@0
|
181 |
or one of the other system-wide error codes for
|
sl@0
|
182 |
any other errors.
|
sl@0
|
183 |
*/
|
sl@0
|
184 |
IMPORT_C static CData* NewL(RFile& aFile, const TDesC& aUniqueId);
|
sl@0
|
185 |
|
sl@0
|
186 |
/**
|
sl@0
|
187 |
Creates a new CData object.
|
sl@0
|
188 |
|
sl@0
|
189 |
@param aFile An open RFile handle, the agent will make a duplicate of this handle.
|
sl@0
|
190 |
The underlying RFs session should be shared for transfer to other processes using RFs::ShareProtected(), since the agent may use transfer this handle to its own or one of the system servers.
|
sl@0
|
191 |
@param aUniqueId The content object to read.
|
sl@0
|
192 |
@param aIntent The intended use of the content.
|
sl@0
|
193 |
@return The new CData object.
|
sl@0
|
194 |
|
sl@0
|
195 |
@leave KErrNotFound The content object with the given UniqueId does not exist.
|
sl@0
|
196 |
@leave KErrCAPendingRights The rights have not yet arrived but are expected soon.
|
sl@0
|
197 |
@leave KErrCANoPermission Rights exist but the specified intent is not permitted.
|
sl@0
|
198 |
@leave KErrCANoRights No rights exist for the content object.
|
sl@0
|
199 |
@leave KErrCANotSupported Unable to open the object with the specified UniqueId, it may be a container object.
|
sl@0
|
200 |
@leave KErrPermissionDenied The agent does not allow the client to access the content object.
|
sl@0
|
201 |
@leave KErrAccessDenied The content is already in use.
|
sl@0
|
202 |
@leave ... One of the other CAF error codes defined in \c caferr.h
|
sl@0
|
203 |
or one of the other system-wide error codes
|
sl@0
|
204 |
for any other errors.
|
sl@0
|
205 |
*/
|
sl@0
|
206 |
IMPORT_C static CData* NewLC(RFile& aFile, const TDesC& aUniqueId, TIntent aIntent);
|
sl@0
|
207 |
|
sl@0
|
208 |
/**
|
sl@0
|
209 |
Creates a new CData object.
|
sl@0
|
210 |
|
sl@0
|
211 |
@param aFile An open RFile handle, the agent will make a duplicate of this handle.
|
sl@0
|
212 |
The underlying RFs session should be shared for transfer to other processes using RFs::ShareProtected(), since the agent may use transfer this handle to its own or one of the system servers.
|
sl@0
|
213 |
@param aUniqueId The content object to read.
|
sl@0
|
214 |
@return The new CData object.
|
sl@0
|
215 |
|
sl@0
|
216 |
@leave KErrNotFound The content object with the given UniqueId does not exist.
|
sl@0
|
217 |
@leave KErrCAPendingRights The rights have not yet arrived but are expected soon.
|
sl@0
|
218 |
@leave KErrCANoPermission Rights exist but the specified intent is not permitted.
|
sl@0
|
219 |
@leave KErrCANoRights No rights exist for the content object.
|
sl@0
|
220 |
@leave KErrCANotSupported Unable to open the object with the specified UniqueId, it may be a container object.
|
sl@0
|
221 |
@leave KErrPermissionDenied The agent does not allow the client to access the content object.
|
sl@0
|
222 |
@leave KErrAccessDenied The content is already in use.
|
sl@0
|
223 |
@leave ... One of the other CAF error codes defined in \c caferr.h
|
sl@0
|
224 |
or one of the other system-wide error codes
|
sl@0
|
225 |
for any other errors.
|
sl@0
|
226 |
*/
|
sl@0
|
227 |
IMPORT_C static CData* NewLC(RFile& aFile, const TDesC& aUniqueId);
|
sl@0
|
228 |
|
sl@0
|
229 |
/**
|
sl@0
|
230 |
Creates a new CData object.
|
sl@0
|
231 |
|
sl@0
|
232 |
@param aAgentUid The agent determined to support this content.
|
sl@0
|
233 |
@param aVirtualPath The content object to read.
|
sl@0
|
234 |
@param aIntent The intended use of the content.
|
sl@0
|
235 |
@param aShareMode The file share mode used to open this content.
|
sl@0
|
236 |
@return The new CData object.
|
sl@0
|
237 |
|
sl@0
|
238 |
@leave KErrNotFound The content object with the given UniqueId does not exist.
|
sl@0
|
239 |
@leave KErrCAPendingRights The rights have not yet arrived but are expected soon.
|
sl@0
|
240 |
@leave KErrCANoPermission Rights exist but the specified intent is not permitted.
|
sl@0
|
241 |
@leave KErrCANoRights No rights exist for the content object.
|
sl@0
|
242 |
@leave KErrCANotSupported Unable to open the object with the specified UniqueId, it may be a container object.
|
sl@0
|
243 |
@leave KErrPermissionDenied The agent does not allow the client to access the content object.
|
sl@0
|
244 |
@leave KErrAccessDenied The content is already in use.
|
sl@0
|
245 |
@leave ... One of the other CAF error codes defined in \c caferr.h
|
sl@0
|
246 |
or one of the other system-wide error codes
|
sl@0
|
247 |
for any other errors.
|
sl@0
|
248 |
*/
|
sl@0
|
249 |
static CData* NewLC(TUid aAgentUid, const TVirtualPathPtr& aVirtualPath,
|
sl@0
|
250 |
TIntent aIntent, TContentShareMode aShareMode);
|
sl@0
|
251 |
|
sl@0
|
252 |
/**
|
sl@0
|
253 |
Creates a new CData object.
|
sl@0
|
254 |
|
sl@0
|
255 |
@param aAgentUid The Uid of the agent who supports this content.
|
sl@0
|
256 |
@param aFile An open RFile handle, the agent will make a duplicate of this handle.
|
sl@0
|
257 |
The underlying RFs session should be shared for transfer to other processes using RFs::ShareProtected(), since the agent may use transfer this handle to its own or one of the system servers.
|
sl@0
|
258 |
@param aUniqueId The content object to read.
|
sl@0
|
259 |
@param aIntent The intended use of the content.
|
sl@0
|
260 |
@return The new CData object.
|
sl@0
|
261 |
|
sl@0
|
262 |
@leave KErrNotFound The content object with the given UniqueId does not exist.
|
sl@0
|
263 |
@leave KErrCAPendingRights The rights have not yet arrived but are expected soon.
|
sl@0
|
264 |
@leave KErrCANoPermission Rights exist but the specified intent is not permitted.
|
sl@0
|
265 |
@leave KErrCANoRights No rights exist for the content object.
|
sl@0
|
266 |
@leave KErrCANotSupported Unable to open the object with the specified UniqueId, it may be a container object.
|
sl@0
|
267 |
@leave KErrPermissionDenied The agent does not allow the client to access the content object.
|
sl@0
|
268 |
@leave KErrAccessDenied The content is already in use.
|
sl@0
|
269 |
@leave ... One of the other CAF error codes defined in \c caferr.h
|
sl@0
|
270 |
or one of the other system-wide error codes for
|
sl@0
|
271 |
any other errors.
|
sl@0
|
272 |
|
sl@0
|
273 |
*/
|
sl@0
|
274 |
static CData* NewLC(TUid aAgentUid, RFile& aFile, const TDesC& aUniqueId, TIntent aIntent);
|
sl@0
|
275 |
|
sl@0
|
276 |
#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
|
sl@0
|
277 |
|
sl@0
|
278 |
/**
|
sl@0
|
279 |
Creates a new CData object.
|
sl@0
|
280 |
@param aHeaderData Header data of WMDRM file/stream content.
|
sl@0
|
281 |
@return CData object.
|
sl@0
|
282 |
@leave One of the CAF error codes defined in caferr.h or one of the
|
sl@0
|
283 |
system-wide error for any other errors.
|
sl@0
|
284 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability.
|
sl@0
|
285 |
Access to unprotected content is unrestricted.
|
sl@0
|
286 |
*/
|
sl@0
|
287 |
|
sl@0
|
288 |
IMPORT_C static CData* NewL(const TDesC8& aHeaderData);
|
sl@0
|
289 |
|
sl@0
|
290 |
/**
|
sl@0
|
291 |
Creates a new CData object.
|
sl@0
|
292 |
@param aHeaderData Header data of WMDRM file/stream content.
|
sl@0
|
293 |
@param aIntent The intended use of the content.
|
sl@0
|
294 |
@return CData object.
|
sl@0
|
295 |
@leave One of the CAF error codes defined in caferr.h or one of the
|
sl@0
|
296 |
system-wide error for any other errors.
|
sl@0
|
297 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability.
|
sl@0
|
298 |
Access to unprotected content is unrestricted.
|
sl@0
|
299 |
*/
|
sl@0
|
300 |
|
sl@0
|
301 |
IMPORT_C static CData* NewL(const TDesC8& aHeaderData, TIntent aIntent);
|
sl@0
|
302 |
|
sl@0
|
303 |
/**
|
sl@0
|
304 |
Creates a new CData object.
|
sl@0
|
305 |
@param aHeaderData Header data of WMDRM file/stream content.
|
sl@0
|
306 |
@return CData object.
|
sl@0
|
307 |
@leave One of the CAF error codes defined in caferr.h or one of the
|
sl@0
|
308 |
system-wide error for any other errors.
|
sl@0
|
309 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability.
|
sl@0
|
310 |
Access to unprotected content is unrestricted.
|
sl@0
|
311 |
*/
|
sl@0
|
312 |
|
sl@0
|
313 |
IMPORT_C static CData* NewLC(const TDesC8& aHeaderData);
|
sl@0
|
314 |
|
sl@0
|
315 |
/**
|
sl@0
|
316 |
Creates a new CData object.
|
sl@0
|
317 |
@param aHeaderData Header data of WMDRM file/stream content.
|
sl@0
|
318 |
@param aIntent The intended use of the content.
|
sl@0
|
319 |
@return CData object.
|
sl@0
|
320 |
@leave One of the CAF error codes defined in caferr.h or one of the
|
sl@0
|
321 |
system-wide error for any other errors.
|
sl@0
|
322 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability.
|
sl@0
|
323 |
Access to unprotected content is unrestricted.
|
sl@0
|
324 |
*/
|
sl@0
|
325 |
|
sl@0
|
326 |
IMPORT_C static CData* NewLC(const TDesC8& aHeaderData, TIntent aIntent);
|
sl@0
|
327 |
|
sl@0
|
328 |
/**
|
sl@0
|
329 |
Creates a new CData object.
|
sl@0
|
330 |
@param aAgentUid UID of an agent which supports this content.
|
sl@0
|
331 |
@param aHeaderData Header data of WMDRM file/stream content.
|
sl@0
|
332 |
@param aIntent The intended use of the content.
|
sl@0
|
333 |
@return CData object.
|
sl@0
|
334 |
@leave One of the CAF error codes defined in caferr.h or one of the
|
sl@0
|
335 |
system-wide error for any other errors.
|
sl@0
|
336 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability.
|
sl@0
|
337 |
Access to unprotected content is unrestricted.
|
sl@0
|
338 |
|
sl@0
|
339 |
*/
|
sl@0
|
340 |
|
sl@0
|
341 |
static CData* NewLC(TUid aAgentUid, const TDesC8& aHeaderData, TIntent aIntent);
|
sl@0
|
342 |
|
sl@0
|
343 |
#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
|
sl@0
|
344 |
|
sl@0
|
345 |
/** destructor */
|
sl@0
|
346 |
virtual ~CData();
|
sl@0
|
347 |
|
sl@0
|
348 |
/**
|
sl@0
|
349 |
Reads from a content object up to the maximum length of the
|
sl@0
|
350 |
descriptor or the end of the content object.
|
sl@0
|
351 |
|
sl@0
|
352 |
When an attempt is made to read beyond the end of the content,
|
sl@0
|
353 |
no error is returned. The descriptor’s length is set to the
|
sl@0
|
354 |
number of bytes that were read into it. Therefore, when reading
|
sl@0
|
355 |
through content, the end has been reached when the
|
sl@0
|
356 |
descriptor length (given by TDesC::Length()) is zero.
|
sl@0
|
357 |
|
sl@0
|
358 |
@param aDes Descriptor into which binary data is read. Any existing
|
sl@0
|
359 |
contents are overwritten. On return, its length is set
|
sl@0
|
360 |
to the number of bytes read.
|
sl@0
|
361 |
@return KErrNone if successful.
|
sl@0
|
362 |
@return One of the CAF error codes defined in \c caferr.h or
|
sl@0
|
363 |
one of the other system-wide error codes.
|
sl@0
|
364 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
|
sl@0
|
365 |
*/
|
sl@0
|
366 |
IMPORT_C TInt Read(TDes8& aDes) const;
|
sl@0
|
367 |
|
sl@0
|
368 |
/**
|
sl@0
|
369 |
Reads from a content object up to the specified length of the
|
sl@0
|
370 |
descriptor or the end of the content object.
|
sl@0
|
371 |
|
sl@0
|
372 |
@see Read(TDes8& aDes)
|
sl@0
|
373 |
|
sl@0
|
374 |
@param aDes Descriptor into which binary data is read. Any existing
|
sl@0
|
375 |
contents are overwritten. On return, its length is set
|
sl@0
|
376 |
to the number of bytes read.
|
sl@0
|
377 |
@param aLength The number of bytes to read from the file,
|
sl@0
|
378 |
or to the end of the file, whichever is encountered first.
|
sl@0
|
379 |
The length of the buffer is set to the number of bytes actually read.
|
sl@0
|
380 |
@return KErrNone if successful.
|
sl@0
|
381 |
@return Otherwise one of the CAF error codes defined in \c caferr.h or
|
sl@0
|
382 |
one of the other system-wide error codes.
|
sl@0
|
383 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
|
sl@0
|
384 |
*/
|
sl@0
|
385 |
IMPORT_C TInt Read(TDes8& aDes,TInt aLength) const;
|
sl@0
|
386 |
|
sl@0
|
387 |
/**
|
sl@0
|
388 |
Read content asynchronously up to the maximum length of the descriptor
|
sl@0
|
389 |
or until the end of the content object is reached.
|
sl@0
|
390 |
NB: It is important that the descriptor passed to
|
sl@0
|
391 |
aDes remains in scope until the request has completed.
|
sl@0
|
392 |
|
sl@0
|
393 |
@see Read(TDes8& aDes)
|
sl@0
|
394 |
|
sl@0
|
395 |
@param aDes Descriptor into which binary data is read. Any
|
sl@0
|
396 |
existing contents are overwritten. On return,
|
sl@0
|
397 |
its length is set to the number of bytes read.
|
sl@0
|
398 |
@param aStatus Asynchronous request status. On completion this will contain one
|
sl@0
|
399 |
of the following error codes: KErrNone if the data was
|
sl@0
|
400 |
successfully read. Otherwise one of the CAF error codes defined in
|
sl@0
|
401 |
\c caferr.h or one of the other standard system-wide
|
sl@0
|
402 |
error codes for any other errors.
|
sl@0
|
403 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
|
sl@0
|
404 |
*/
|
sl@0
|
405 |
IMPORT_C void Read(TDes8& aDes, TRequestStatus& aStatus) const;
|
sl@0
|
406 |
|
sl@0
|
407 |
/**
|
sl@0
|
408 |
Read content asynchronously up to the specified length
|
sl@0
|
409 |
or until the end of the content object is reached.
|
sl@0
|
410 |
NB: It is important that the descriptor passed to
|
sl@0
|
411 |
aDes remains in scope until the request has completed.
|
sl@0
|
412 |
|
sl@0
|
413 |
@see Read(TDes8& aDes)
|
sl@0
|
414 |
|
sl@0
|
415 |
@param aDes Descriptor into which binary data is read. Any
|
sl@0
|
416 |
existing contents are overwritten. On return,
|
sl@0
|
417 |
its length is set to the number of bytes read.
|
sl@0
|
418 |
@param aLength The number of bytes to read from the file,
|
sl@0
|
419 |
or to the end of the file, whichever is encountered first.
|
sl@0
|
420 |
The length of the buffer is set to the number of bytes actually read.
|
sl@0
|
421 |
@param aStatus Asynchronous request status. On completion this will contain one
|
sl@0
|
422 |
of the following error codes: KErrNone if the data was
|
sl@0
|
423 |
successfully read. Otherwise one of the CAF error codes defined in
|
sl@0
|
424 |
\c caferr.h or one of the other standard system-wide
|
sl@0
|
425 |
error codes for any other errors.
|
sl@0
|
426 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
|
sl@0
|
427 |
*/
|
sl@0
|
428 |
IMPORT_C void Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus) const;
|
sl@0
|
429 |
|
sl@0
|
430 |
/**
|
sl@0
|
431 |
Cancels asynchronous read.
|
sl@0
|
432 |
|
sl@0
|
433 |
@param aStatus Asynchronous request status. This parameter should have been supplied earlier to
|
sl@0
|
434 |
an asynchronous Read call. If it has not been previously supplied to a Read call,
|
sl@0
|
435 |
this function will not have any effect.
|
sl@0
|
436 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
|
sl@0
|
437 |
*/
|
sl@0
|
438 |
IMPORT_C void ReadCancel(TRequestStatus &aStatus) const;
|
sl@0
|
439 |
|
sl@0
|
440 |
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
|
sl@0
|
441 |
/**
|
sl@0
|
442 |
Reads content asynchronously. The data is read from a specified offset
|
sl@0
|
443 |
up to a specified number of bytes or until the end of the content object
|
sl@0
|
444 |
is reached. The data is read into the descriptor buffer supplied.
|
sl@0
|
445 |
NB: It is important that the descriptor passed to
|
sl@0
|
446 |
aDes remains in scope until the request has completed.
|
sl@0
|
447 |
If agent does not support 64bit, fallback to 32bit Read is provided automatically by CAF
|
sl@0
|
448 |
|
sl@0
|
449 |
@see Read(TDes8& aDes)
|
sl@0
|
450 |
|
sl@0
|
451 |
@param aPos Position of first byte to be read.
|
sl@0
|
452 |
This is an offset from the start of the file.
|
sl@0
|
453 |
@param aDes Descriptor into which binary data is read. Any
|
sl@0
|
454 |
existing contents are overwritten. On return,
|
sl@0
|
455 |
its length is set to the number of bytes read.
|
sl@0
|
456 |
@param aLength The number of bytes to read from the file,
|
sl@0
|
457 |
or to the end of the file, whichever is encountered first.
|
sl@0
|
458 |
The length of the buffer is set to the number of bytes actually read.
|
sl@0
|
459 |
@param aStatus Asynchronous request status. On completion this will contain one
|
sl@0
|
460 |
of the following error codes: KErrNone if the data was
|
sl@0
|
461 |
successfully read. Otherwise one of the CAF error codes defined in
|
sl@0
|
462 |
\c caferr.h or one of the other standard system-wide
|
sl@0
|
463 |
error codes for any other errors.
|
sl@0
|
464 |
@return KErrNone if the async read request was successfully submitted.
|
sl@0
|
465 |
@return KErrArgument if a negative offset is supplied.
|
sl@0
|
466 |
@return KErrCANotSupported if the agent does not support this operation.
|
sl@0
|
467 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
|
sl@0
|
468 |
*/
|
sl@0
|
469 |
IMPORT_C TInt Read(TInt64 aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus) const;
|
sl@0
|
470 |
#else
|
sl@0
|
471 |
/**
|
sl@0
|
472 |
Reads content asynchronously. The data is read from a specified offset
|
sl@0
|
473 |
up to a specified number of bytes or until the end of the content object
|
sl@0
|
474 |
is reached. The data is read into the descriptor buffer supplied.
|
sl@0
|
475 |
|
sl@0
|
476 |
@see Read(TDes8& aDes)
|
sl@0
|
477 |
|
sl@0
|
478 |
@param aPos Position of first byte to be read.
|
sl@0
|
479 |
This is an offset from the start of the file.
|
sl@0
|
480 |
@param aDes Descriptor into which binary data is read. Any
|
sl@0
|
481 |
existing contents are overwritten. On return,
|
sl@0
|
482 |
its length is set to the number of bytes read.
|
sl@0
|
483 |
@param aLength The number of bytes to read from the file,
|
sl@0
|
484 |
or to the end of the file, whichever is encountered first.
|
sl@0
|
485 |
The length of the buffer is set to the number of bytes actually read.
|
sl@0
|
486 |
@param aStatus Asynchronous request status. On completion this will contain one
|
sl@0
|
487 |
of the following error codes: KErrNone if the data was
|
sl@0
|
488 |
successfully read. Otherwise one of the CAF error codes defined in
|
sl@0
|
489 |
\c caferr.h or one of the other standard system-wide
|
sl@0
|
490 |
error codes for any other errors.
|
sl@0
|
491 |
@return KErrNone if the async read request was successfully submitted.
|
sl@0
|
492 |
@return KErrArgument if a negative offset is supplied.
|
sl@0
|
493 |
@return KErrCANotSupported if the agent does not support this operation.
|
sl@0
|
494 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
|
sl@0
|
495 |
*/
|
sl@0
|
496 |
IMPORT_C TInt Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus) const;
|
sl@0
|
497 |
#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
|
sl@0
|
498 |
|
sl@0
|
499 |
/**
|
sl@0
|
500 |
Gets the data size in bytes.
|
sl@0
|
501 |
|
sl@0
|
502 |
@param aSize On return this will contain the size of the plaintext data in bytes.
|
sl@0
|
503 |
@leave KErrCASizeNotDetermined Size could not be determined by the managing agent.
|
sl@0
|
504 |
@leave ... One of the other CAF error codes defined in \c caferr.h or one of the
|
sl@0
|
505 |
system-wide error codes for any other errors.
|
sl@0
|
506 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
|
sl@0
|
507 |
*/
|
sl@0
|
508 |
IMPORT_C void DataSizeL(TInt& aSize);
|
sl@0
|
509 |
|
sl@0
|
510 |
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
|
sl@0
|
511 |
/**
|
sl@0
|
512 |
This is the 64bit version of CData::DataSizeL
|
sl@0
|
513 |
Client can call this function instead of CData::DataSizeL. If it's not implemented by the agent,
|
sl@0
|
514 |
fallback to 32bit counterpart will be provided automatically
|
sl@0
|
515 |
|
sl@0
|
516 |
@see DataSizeL(TInt& aSize)
|
sl@0
|
517 |
*/
|
sl@0
|
518 |
IMPORT_C void DataSize64L(TInt64& aSize);
|
sl@0
|
519 |
#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
|
sl@0
|
520 |
|
sl@0
|
521 |
/**
|
sl@0
|
522 |
Changes or retrieves the location of the file pointer within
|
sl@0
|
523 |
the content object.
|
sl@0
|
524 |
|
sl@0
|
525 |
NOTE: Some operations may fail if the content data is sourced over a network connection.
|
sl@0
|
526 |
|
sl@0
|
527 |
There are four seek modes used:
|
sl@0
|
528 |
|
sl@0
|
529 |
@li ESeekStart - Sets the file pointer aPos bytes from the start of the
|
sl@0
|
530 |
content object. aPos is not modified by the call to Seek()
|
sl@0
|
531 |
@li ESeekEnd - Sets the file pointer aPos bytes from the end of the
|
sl@0
|
532 |
content object. The aPos parameter supplied should be zero or negative
|
sl@0
|
533 |
when using ESeekEnd. Upon completion aPos is updated with the current
|
sl@0
|
534 |
position relative to the start of the content object.
|
sl@0
|
535 |
@li ESeekCurrent - Moves the file pointer aPos bytes from the current
|
sl@0
|
536 |
position. Upon completion aPos is updated with the new position relative
|
sl@0
|
537 |
to the start of the content object. Suppling a zero value for the aPos Parameter can be
|
sl@0
|
538 |
used to retrieve the current file pointer location
|
sl@0
|
539 |
@li ESeekAddress Sets the aPos parameter to the address of the byte
|
sl@0
|
540 |
aPos bytes from the start of the content object
|
sl@0
|
541 |
|
sl@0
|
542 |
@see TSeek
|
sl@0
|
543 |
|
sl@0
|
544 |
@param aMode Seek mode - controls the destination of the
|
sl@0
|
545 |
seek operation.
|
sl@0
|
546 |
|
sl@0
|
547 |
@param aPos Offset from either the start, end or current position depending upon
|
sl@0
|
548 |
the seek mode. Negative offsets are used to seek before the current position or
|
sl@0
|
549 |
relative to the end of the file.
|
sl@0
|
550 |
|
sl@0
|
551 |
@return KErrNone if successful.
|
sl@0
|
552 |
@return Otherwise one of the CAF error codes defined in \c caferr.h or one
|
sl@0
|
553 |
of the other system-wide error codes.
|
sl@0
|
554 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
|
sl@0
|
555 |
*/
|
sl@0
|
556 |
IMPORT_C TInt Seek(TSeek aMode,TInt& aPos) const;
|
sl@0
|
557 |
|
sl@0
|
558 |
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
|
sl@0
|
559 |
/**
|
sl@0
|
560 |
This is the 64bit version of CData::Seek
|
sl@0
|
561 |
Client can call this function instead of CData::Seek. If it's not implemented by the agent,
|
sl@0
|
562 |
fallback to 32bit counterpart will be provided automatically
|
sl@0
|
563 |
|
sl@0
|
564 |
@see Seek(TSeek aMode,TInt& aPos)
|
sl@0
|
565 |
*/
|
sl@0
|
566 |
IMPORT_C TInt Seek64(TSeek aMode,TInt64& aPos) const;
|
sl@0
|
567 |
#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
|
sl@0
|
568 |
|
sl@0
|
569 |
/** Request the agent handling this content to set a property value. If the property is set
|
sl@0
|
570 |
it is only set for this CData session and does not impact other CAF users.
|
sl@0
|
571 |
|
sl@0
|
572 |
For example setting the buffer-size to 256 bytes can be achieved as follows:
|
sl@0
|
573 |
|
sl@0
|
574 |
@code
|
sl@0
|
575 |
MyData->SetProperty(EAgentPropertyBufferSize, 256);
|
sl@0
|
576 |
@endcode
|
sl@0
|
577 |
|
sl@0
|
578 |
@see ContentAccess::TAgentProperty
|
sl@0
|
579 |
|
sl@0
|
580 |
@param aProperty The property to set.
|
sl@0
|
581 |
@param aValue The value of the property.
|
sl@0
|
582 |
@return Whether or not the property was set.
|
sl@0
|
583 |
@return KErrNone if the property was set.
|
sl@0
|
584 |
@return KErrCANotSupported if the agent does not support the property or value.
|
sl@0
|
585 |
@return KErrAccessDenied if the agent does not permit the property to be changed.
|
sl@0
|
586 |
@return KErrPermissionDenied if the application does not have the necessary capability to change the property.
|
sl@0
|
587 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted.
|
sl@0
|
588 |
*/
|
sl@0
|
589 |
IMPORT_C TInt SetProperty(TAgentProperty aProperty, TInt aValue);
|
sl@0
|
590 |
|
sl@0
|
591 |
/**
|
sl@0
|
592 |
Allows a client to verify that the intent is supported by the
|
sl@0
|
593 |
current rights for the data object.
|
sl@0
|
594 |
|
sl@0
|
595 |
@note Since the intent is only evaluated the agent will not decrement
|
sl@0
|
596 |
any rights-state such as play counts.
|
sl@0
|
597 |
|
sl@0
|
598 |
@see ContentAccess::TIntent
|
sl@0
|
599 |
|
sl@0
|
600 |
@param aIntent The intended way the content will be used.
|
sl@0
|
601 |
@return Whether rights exist allowing the content to be used for this intent.
|
sl@0
|
602 |
@return KErrNone if the intent is permitted.
|
sl@0
|
603 |
@return KErrNoRights if no rights exist for the specified content object.
|
sl@0
|
604 |
@return KErrCANoPermission if rights exist but the specified intent is not permitted.
|
sl@0
|
605 |
@return KErrCAPendingRights if the rights have not yet arrived but are expected soon.
|
sl@0
|
606 |
@return KErrNoPermission if rights exist but none permit the specified intent.
|
sl@0
|
607 |
@return KErrPermissionDenied if the client is not allowed to use this content object.
|
sl@0
|
608 |
@return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
|
sl@0
|
609 |
other system-wide error codes for any other errors.
|
sl@0
|
610 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
|
sl@0
|
611 |
*/
|
sl@0
|
612 |
IMPORT_C TInt EvaluateIntent(TIntent aIntent);
|
sl@0
|
613 |
|
sl@0
|
614 |
/**
|
sl@0
|
615 |
Execute intent allows the application to signal it is about to carry out
|
sl@0
|
616 |
the specified intent on protected content.The agent will decrement applicable
|
sl@0
|
617 |
stateful rights such as play counts where necessary.
|
sl@0
|
618 |
|
sl@0
|
619 |
Applications should be very careful to use this function correctly.
|
sl@0
|
620 |
@li If ExecuteIntent() is never called stateful rights will never be decremented. Users will be able to use the content forever
|
sl@0
|
621 |
@li If ExecuteIntent() is called too often stateful rights may be consumed prematurely.
|
sl@0
|
622 |
|
sl@0
|
623 |
Usually it would be best to call ExecuteIntent immediately before the content
|
sl@0
|
624 |
is displayed or the instant playback begins. ExecuteIntent should not be considered a
|
sl@0
|
625 |
prerequisite for calling the Read functions. It is valid for an application to read from
|
sl@0
|
626 |
the file before calling ExecuteIntent.
|
sl@0
|
627 |
|
sl@0
|
628 |
@note Since rights are executed here the agent will decrement any rights-state such as
|
sl@0
|
629 |
play counts that apply.
|
sl@0
|
630 |
|
sl@0
|
631 |
@param aIntent The intent indicator.
|
sl@0
|
632 |
@return The result of attempting executing the intent.
|
sl@0
|
633 |
@return KErrNone if the intent is permitted and stateful rights may have been decremented.
|
sl@0
|
634 |
@return KErrNoRights if no rights exist for the specified content object.
|
sl@0
|
635 |
@return KErrCANoPermission if rights exist but the specified intent is not permitted.
|
sl@0
|
636 |
@return KErrCAPendingRights if the rights have not yet arrived but are expected soon.
|
sl@0
|
637 |
@return KErrNoPermission if rights exist but none permit the specified intent.
|
sl@0
|
638 |
@return KErrPermissionDenied if the client is not allowed to use this content object.
|
sl@0
|
639 |
@return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the.
|
sl@0
|
640 |
other system-wide error codes for any other errors.
|
sl@0
|
641 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
|
sl@0
|
642 |
*/
|
sl@0
|
643 |
IMPORT_C TInt ExecuteIntent(TIntent aIntent);
|
sl@0
|
644 |
|
sl@0
|
645 |
/** Get an attribute for the content object
|
sl@0
|
646 |
|
sl@0
|
647 |
@see ContentAccess::TAttribute
|
sl@0
|
648 |
|
sl@0
|
649 |
@code
|
sl@0
|
650 |
CContent* content = CContent::NewL(uri);
|
sl@0
|
651 |
CData* data = content->OpenContentL(EPlay, uniqueId);
|
sl@0
|
652 |
delete content;
|
sl@0
|
653 |
|
sl@0
|
654 |
TInt value = 0;
|
sl@0
|
655 |
TInt err = data->GetAttribute(EIsProtected, value);
|
sl@0
|
656 |
if(err == KErrNone && value)
|
sl@0
|
657 |
{
|
sl@0
|
658 |
DisplayPadLock();
|
sl@0
|
659 |
}
|
sl@0
|
660 |
|
sl@0
|
661 |
delete data;
|
sl@0
|
662 |
@endcode
|
sl@0
|
663 |
|
sl@0
|
664 |
@param aAttribute The attribute to query, from ContentAccess::TAttribute.
|
sl@0
|
665 |
@param aValue Used to return the attribute value.
|
sl@0
|
666 |
@return Whether the attribute was updated.
|
sl@0
|
667 |
@return KErrNone if the value of the attribute was updated.
|
sl@0
|
668 |
@return KErrCANotSupported if the requested attribute does not exist.
|
sl@0
|
669 |
@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
|
sl@0
|
670 |
@return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
|
sl@0
|
671 |
other system-wide error codes for any other errors.
|
sl@0
|
672 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
|
sl@0
|
673 |
*/
|
sl@0
|
674 |
IMPORT_C TInt GetAttribute(TInt aAttribute, TInt& aValue) const;
|
sl@0
|
675 |
|
sl@0
|
676 |
/** Get a set of attributes for the content object
|
sl@0
|
677 |
|
sl@0
|
678 |
@see ContentAccess::TAttribute
|
sl@0
|
679 |
|
sl@0
|
680 |
The following example determines whether the content object
|
sl@0
|
681 |
is protected and has rights that will enable it to be viewed by the
|
sl@0
|
682 |
user
|
sl@0
|
683 |
|
sl@0
|
684 |
@code
|
sl@0
|
685 |
// CData* data = a data object
|
sl@0
|
686 |
|
sl@0
|
687 |
RAttributeSet attributeSet;
|
sl@0
|
688 |
CleanupClosePushL(attributeSet);
|
sl@0
|
689 |
attributeSet->AddL(EProtected);
|
sl@0
|
690 |
attributeSet->AddL(ECanView);
|
sl@0
|
691 |
|
sl@0
|
692 |
User::LeaveIfError(data->GetAttributeSet(attributeSet);
|
sl@0
|
693 |
|
sl@0
|
694 |
TInt err = attributeSet.GetValue(EProtected, value);
|
sl@0
|
695 |
if(err == KErrNone && value)
|
sl@0
|
696 |
{
|
sl@0
|
697 |
// file is DRM protected
|
sl@0
|
698 |
}
|
sl@0
|
699 |
|
sl@0
|
700 |
err = attributeSet.GetValue(ECanView, value);
|
sl@0
|
701 |
if(err == KErrNone && value)
|
sl@0
|
702 |
{
|
sl@0
|
703 |
// File has rights that allow it to be displayed on screen
|
sl@0
|
704 |
}
|
sl@0
|
705 |
|
sl@0
|
706 |
// Finished
|
sl@0
|
707 |
CleanupStack::PopAndDestroy(); // attributeSet.Close()
|
sl@0
|
708 |
@endcode
|
sl@0
|
709 |
|
sl@0
|
710 |
|
sl@0
|
711 |
@param aAttributeSet The set of attributes to query and update.
|
sl@0
|
712 |
@return Whether the attribute set was updated.
|
sl@0
|
713 |
@return KErrNone if the attributes were retrieved successfully.
|
sl@0
|
714 |
@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
|
sl@0
|
715 |
@return Otherwise one of the CAF error codes defined in \c caferr.h or one of the
|
sl@0
|
716 |
other system-wide error codes for any other errors.
|
sl@0
|
717 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
|
sl@0
|
718 |
*/
|
sl@0
|
719 |
IMPORT_C TInt GetAttributeSet(RAttributeSet& aAttributeSet) const;
|
sl@0
|
720 |
|
sl@0
|
721 |
|
sl@0
|
722 |
/** Get text string attributes or meta-data for the content object
|
sl@0
|
723 |
|
sl@0
|
724 |
@see ContentAccess::TStringAttribute
|
sl@0
|
725 |
|
sl@0
|
726 |
@code
|
sl@0
|
727 |
CContent* content = CContent::NewLC(uri);
|
sl@0
|
728 |
CData* data = content->OpenContentLC(EPlay, uniqueId);
|
sl@0
|
729 |
CleanupStack::PopAndDestroy(content);
|
sl@0
|
730 |
|
sl@0
|
731 |
TBuf <MAX_PATH> previewUri;
|
sl@0
|
732 |
TInt err = data->GetStringAttribute(EPreviewURI, previewUri);
|
sl@0
|
733 |
if(err == KErrNone)
|
sl@0
|
734 |
{
|
sl@0
|
735 |
DisplayPreview(previewUri);
|
sl@0
|
736 |
}
|
sl@0
|
737 |
|
sl@0
|
738 |
CleanupStack::PopAndDestroy(data);
|
sl@0
|
739 |
@endcode
|
sl@0
|
740 |
|
sl@0
|
741 |
@param aAttribute The attribute to query, from ContentAccess::TStringAttribute.
|
sl@0
|
742 |
@param aValue Returns the value of the attribute.
|
sl@0
|
743 |
@return Whether the value was updated.
|
sl@0
|
744 |
@return KErrNone if the attribute was retrieved.
|
sl@0
|
745 |
@return KErrOverflow if the buffer was not large enough to return the result.
|
sl@0
|
746 |
@return KErrCANotSupported if the requested attribute does not exist.
|
sl@0
|
747 |
@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
|
sl@0
|
748 |
@return Otherwise one of the other CAF error codes defined in \c caferr.h or one of the
|
sl@0
|
749 |
other system-wide error codes for any other errors.
|
sl@0
|
750 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
|
sl@0
|
751 |
*/
|
sl@0
|
752 |
IMPORT_C TInt GetStringAttribute(TInt aAttribute, TDes& aValue) const;
|
sl@0
|
753 |
|
sl@0
|
754 |
|
sl@0
|
755 |
|
sl@0
|
756 |
/** Obtain a set of string attributes for the content object
|
sl@0
|
757 |
|
sl@0
|
758 |
@see ContentAccess::TStringAttribute
|
sl@0
|
759 |
|
sl@0
|
760 |
@code
|
sl@0
|
761 |
CContent* content = CContent::NewLC(uri);
|
sl@0
|
762 |
CData* data = content->OpenContentLC(EPlay, uniqueId);
|
sl@0
|
763 |
|
sl@0
|
764 |
// create the attribute set, add the attributes we are interested in
|
sl@0
|
765 |
RStringAttributeSet stringAttributeSet;
|
sl@0
|
766 |
CleanupClosePushL(stringAttributeSet);
|
sl@0
|
767 |
stringAttributeSet.AddL(EPreviewURI);
|
sl@0
|
768 |
stringAttributeSet.AddL(ETitle);
|
sl@0
|
769 |
|
sl@0
|
770 |
User::LeaveIfError(data->GetStringAttributeSet(stringAttributeSet));
|
sl@0
|
771 |
|
sl@0
|
772 |
// Pass the value of the string attribute to DisplayPreview()
|
sl@0
|
773 |
TFileName previewUri;
|
sl@0
|
774 |
TInt err = stringAttributeSet.GetValue(EPreviewURI, previewUri);
|
sl@0
|
775 |
if(err == KErrNone)
|
sl@0
|
776 |
{
|
sl@0
|
777 |
DisplayPreview(previewUri);
|
sl@0
|
778 |
}
|
sl@0
|
779 |
|
sl@0
|
780 |
CleanupStack::PopAndDestroy(3); // content, data, stringAttributeSet
|
sl@0
|
781 |
@endcode
|
sl@0
|
782 |
|
sl@0
|
783 |
|
sl@0
|
784 |
@param aStringAttributeSet The set of attributes to query and update.
|
sl@0
|
785 |
@return Whether the string attribute set was updated.
|
sl@0
|
786 |
@return KErrNone if the attributes were retrieved successfully.
|
sl@0
|
787 |
@return KErrNotFound if the default content object was not found.
|
sl@0
|
788 |
@return KErrPermissionDenied if the access to the protected content is not permitted by the CAF Agent.
|
sl@0
|
789 |
@return Otherwise one of the CAF error codes defined in \c caferr.h or one of the
|
sl@0
|
790 |
other system-wide error codes for any other errors.
|
sl@0
|
791 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
|
sl@0
|
792 |
*/
|
sl@0
|
793 |
IMPORT_C TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet) const;
|
sl@0
|
794 |
|
sl@0
|
795 |
|
sl@0
|
796 |
#ifndef REMOVE_CAF1
|
sl@0
|
797 |
/** Set Qos attribute
|
sl@0
|
798 |
@param aQosAttr The Qos attribute to set.
|
sl@0
|
799 |
@param aValue The value of the attribute.
|
sl@0
|
800 |
@deprecated
|
sl@0
|
801 |
*/
|
sl@0
|
802 |
IMPORT_C void SetQosL(TQosAttribute aQosAttr, TInt aValue);
|
sl@0
|
803 |
|
sl@0
|
804 |
/** Get the mime type of the content
|
sl@0
|
805 |
@param aMimeType Buffer to store the mime type provided by the agent.
|
sl@0
|
806 |
@return ETrue if the mime type was retrieved successfully.
|
sl@0
|
807 |
@deprecated
|
sl@0
|
808 |
*/
|
sl@0
|
809 |
IMPORT_C TBool GetMimeTypeL(TDes8& aMimeType) const;
|
sl@0
|
810 |
#endif // REMOVE_CAF1
|
sl@0
|
811 |
|
sl@0
|
812 |
#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
|
sl@0
|
813 |
/**
|
sl@0
|
814 |
Decrypts the encrypted input data packet.
|
sl@0
|
815 |
|
sl@0
|
816 |
@param aEncryptedInputDataPacket Buffer descriptor containing the encrypted data packet supplied by client application.
|
sl@0
|
817 |
@param aDecryptedOutputDataPacket Buffer descriptor supplied by the client application into which the decrypted data is written.
|
sl@0
|
818 |
The length of this descriptor must be equal to or greater than the input packet.
|
sl@0
|
819 |
@return KErrNone if successful.KErrInsufficientDataPacketLength if a part of input packet is provided,
|
sl@0
|
820 |
otherwise one of the CAF error codes defined in \c caferr.h or
|
sl@0
|
821 |
one of the other system-wide error codes.
|
sl@0
|
822 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability.
|
sl@0
|
823 |
Access to unprotected content is unrestricted.
|
sl@0
|
824 |
*/
|
sl@0
|
825 |
|
sl@0
|
826 |
IMPORT_C TInt Read(const TDesC8& aEncryptedInputDataPacket, TDes8& aDecryptedOutputDataPacket) const;
|
sl@0
|
827 |
|
sl@0
|
828 |
/**
|
sl@0
|
829 |
Decrypts the encrypted input data packet asynchronously.
|
sl@0
|
830 |
@param aEncryptedInputDataPacket Buffer descriptor containing the encrypted data packet supplied by client application.
|
sl@0
|
831 |
@param aDecryptedOutputDataPacket Buffer descriptor supplied by the client application into which the decrypted data is written.
|
sl@0
|
832 |
The length of this descriptor must be equal to or greater than the input packet.
|
sl@0
|
833 |
@param aStatus Asynchronous request status. On completion this will contain one of the following error codes:
|
sl@0
|
834 |
KErrNone if the data packet was successfully decrypted.KErrInsufficientDataPacketLength if a
|
sl@0
|
835 |
part of input packet is provided, otherwise one of the CAF error codes defined in \c caferr.h or
|
sl@0
|
836 |
one of the other system-wide error codes.
|
sl@0
|
837 |
@capability DRM Access to DRM protected content is not permitted for processes without DRM capability.
|
sl@0
|
838 |
Access to unprotected content is unrestricted.
|
sl@0
|
839 |
*/
|
sl@0
|
840 |
IMPORT_C void Read(const TDesC8& aEncryptedInputDataPacket, TDes8& aDecryptedOutputDataPacket, TRequestStatus& aStatus) const;
|
sl@0
|
841 |
|
sl@0
|
842 |
#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
|
sl@0
|
843 |
|
sl@0
|
844 |
private:
|
sl@0
|
845 |
CData();
|
sl@0
|
846 |
void ConstructL(RFile& aFile, const TDesC& aUniqueId, TIntent aIntent);
|
sl@0
|
847 |
void ConstructL(const TVirtualPathPtr& aVirtualPath, TIntent aIntent, TContentShareMode aShareMode);
|
sl@0
|
848 |
void ConstructL(TUid aAgentUid, RFile& aFile, const TDesC& aUniqueId, TIntent aIntent);
|
sl@0
|
849 |
void ConstructL(TUid aAgentUid, const TVirtualPathPtr& aVirtualPath, TIntent aIntent, TContentShareMode aShareMode);
|
sl@0
|
850 |
|
sl@0
|
851 |
void ConstructL(RFile& aFile, const TDesC& aUniqueId);
|
sl@0
|
852 |
void ConstructL(const TVirtualPathPtr& aVirtualPath, TContentShareMode aShareMode);
|
sl@0
|
853 |
void ConstructL(TUid aAgentUid, RFile& aFile, const TDesC& aUniqueId);
|
sl@0
|
854 |
void ConstructL(TUid aAgentUid, const TVirtualPathPtr& aVirtualPath, TContentShareMode aShareMode);
|
sl@0
|
855 |
|
sl@0
|
856 |
#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
|
sl@0
|
857 |
|
sl@0
|
858 |
void ConstructL(TUid aAgentUid, const TDesC8& aHeaderData, TIntent aIntent);
|
sl@0
|
859 |
void ConstructL(const TDesC8& aHeaderData);
|
sl@0
|
860 |
void ConstructL(const TDesC8& aHeaderData, TIntent aIntent);
|
sl@0
|
861 |
void ConstructL(TUid aAgentUid, const TDesC8& aHeaderData);
|
sl@0
|
862 |
|
sl@0
|
863 |
#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
|
sl@0
|
864 |
|
sl@0
|
865 |
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
|
sl@0
|
866 |
/*
|
sl@0
|
867 |
* This is the obselete 32bit Read and replaced by its 64bit counterpart
|
sl@0
|
868 |
* TInt Read(TInt64 aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus) const
|
sl@0
|
869 |
* However, this function still exits at its original ordinal to avoid BC break.
|
sl@0
|
870 |
* Upgrade to 64bit Read is done automatically upon recompling the client code which uses CAF interfaces
|
sl@0
|
871 |
*/
|
sl@0
|
872 |
IMPORT_C TInt Read_Unused(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus) const;
|
sl@0
|
873 |
#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
|
sl@0
|
874 |
|
sl@0
|
875 |
private:
|
sl@0
|
876 |
// The agent handling this content
|
sl@0
|
877 |
CAgentData* iAgentData;
|
sl@0
|
878 |
|
sl@0
|
879 |
// Defacto ECOM session handle
|
sl@0
|
880 |
CAgentFactory* iAgentFactory;
|
sl@0
|
881 |
|
sl@0
|
882 |
// Uid of the agent
|
sl@0
|
883 |
TUid iAgentUid;
|
sl@0
|
884 |
};
|
sl@0
|
885 |
|
sl@0
|
886 |
} // namespace ContentAccess
|
sl@0
|
887 |
#endif /* __DATA_H__ */
|
sl@0
|
888 |
|