1.1 --- a/epoc32/include/caf/data.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/caf/data.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,5 +1,5 @@
1.4 /*
1.5 -* Copyright (c) 2003-2007 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies).
1.7 * All rights reserved.
1.8 * This component and the accompanying materials are made available
1.9 * under the terms of the License "Eclipse Public License v1.0"
1.10 @@ -20,7 +20,7 @@
1.11 /**
1.12 @file
1.13
1.14 -@publishedPartner
1.15 +@publishedAll
1.16 @released
1.17 */
1.18
1.19 @@ -48,8 +48,6 @@
1.20 This class is initialised with an agent implementation that is
1.21 responsible for this content object.
1.22
1.23 - @publishedPartner
1.24 - @released
1.25 */
1.26 class CData : public CBase
1.27 {
1.28 @@ -247,9 +245,6 @@
1.29 @leave ... One of the other CAF error codes defined in \c caferr.h
1.30 or one of the other system-wide error codes
1.31 for any other errors.
1.32 -
1.33 - @internalComponent
1.34 - @released
1.35 */
1.36 static CData* NewLC(TUid aAgentUid, const TVirtualPathPtr& aVirtualPath,
1.37 TIntent aIntent, TContentShareMode aShareMode);
1.38 @@ -275,11 +270,78 @@
1.39 or one of the other system-wide error codes for
1.40 any other errors.
1.41
1.42 - @internalComponent
1.43 - @released
1.44 */
1.45 static CData* NewLC(TUid aAgentUid, RFile& aFile, const TDesC& aUniqueId, TIntent aIntent);
1.46 +
1.47 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.48
1.49 + /**
1.50 + Creates a new CData object.
1.51 + @param aHeaderData Header data of WMDRM file/stream content.
1.52 + @return CData object.
1.53 + @leave One of the CAF error codes defined in caferr.h or one of the
1.54 + system-wide error for any other errors.
1.55 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability.
1.56 + Access to unprotected content is unrestricted.
1.57 + */
1.58 +
1.59 + IMPORT_C static CData* NewL(const TDesC8& aHeaderData);
1.60 +
1.61 + /**
1.62 + Creates a new CData object.
1.63 + @param aHeaderData Header data of WMDRM file/stream content.
1.64 + @param aIntent The intended use of the content.
1.65 + @return CData object.
1.66 + @leave One of the CAF error codes defined in caferr.h or one of the
1.67 + system-wide error for any other errors.
1.68 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability.
1.69 + Access to unprotected content is unrestricted.
1.70 + */
1.71 +
1.72 + IMPORT_C static CData* NewL(const TDesC8& aHeaderData, TIntent aIntent);
1.73 +
1.74 + /**
1.75 + Creates a new CData object.
1.76 + @param aHeaderData Header data of WMDRM file/stream content.
1.77 + @return CData object.
1.78 + @leave One of the CAF error codes defined in caferr.h or one of the
1.79 + system-wide error for any other errors.
1.80 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability.
1.81 + Access to unprotected content is unrestricted.
1.82 + */
1.83 +
1.84 + IMPORT_C static CData* NewLC(const TDesC8& aHeaderData);
1.85 +
1.86 + /**
1.87 + Creates a new CData object.
1.88 + @param aHeaderData Header data of WMDRM file/stream content.
1.89 + @param aIntent The intended use of the content.
1.90 + @return CData object.
1.91 + @leave One of the CAF error codes defined in caferr.h or one of the
1.92 + system-wide error for any other errors.
1.93 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability.
1.94 + Access to unprotected content is unrestricted.
1.95 + */
1.96 +
1.97 + IMPORT_C static CData* NewLC(const TDesC8& aHeaderData, TIntent aIntent);
1.98 +
1.99 + /**
1.100 + Creates a new CData object.
1.101 + @param aAgentUid UID of an agent which supports this content.
1.102 + @param aHeaderData Header data of WMDRM file/stream content.
1.103 + @param aIntent The intended use of the content.
1.104 + @return CData object.
1.105 + @leave One of the CAF error codes defined in caferr.h or one of the
1.106 + system-wide error for any other errors.
1.107 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability.
1.108 + Access to unprotected content is unrestricted.
1.109 +
1.110 + */
1.111 +
1.112 + static CData* NewLC(TUid aAgentUid, const TDesC8& aHeaderData, TIntent aIntent);
1.113 +
1.114 +#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.115 +
1.116 /** destructor */
1.117 virtual ~CData();
1.118
1.119 @@ -375,17 +437,19 @@
1.120 */
1.121 IMPORT_C void ReadCancel(TRequestStatus &aStatus) const;
1.122
1.123 +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.124 /**
1.125 Reads content asynchronously. The data is read from a specified offset
1.126 up to a specified number of bytes or until the end of the content object
1.127 is reached. The data is read into the descriptor buffer supplied.
1.128 NB: It is important that the descriptor passed to
1.129 - aDes remains in scope until the request has completed.
1.130 -
1.131 + aDes remains in scope until the request has completed.
1.132 + If agent does not support 64bit, fallback to 32bit Read is provided automatically by CAF
1.133 +
1.134 @see Read(TDes8& aDes)
1.135 -
1.136 +
1.137 @param aPos Position of first byte to be read.
1.138 - This is an offset from the start of the file.
1.139 + This is an offset from the start of the file.
1.140 @param aDes Descriptor into which binary data is read. Any
1.141 existing contents are overwritten. On return,
1.142 its length is set to the number of bytes read.
1.143 @@ -401,9 +465,37 @@
1.144 @return KErrArgument if a negative offset is supplied.
1.145 @return KErrCANotSupported if the agent does not support this operation.
1.146 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.147 - */
1.148 + */
1.149 + IMPORT_C TInt Read(TInt64 aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus) const;
1.150 +#else
1.151 + /**
1.152 + Reads content asynchronously. The data is read from a specified offset
1.153 + up to a specified number of bytes or until the end of the content object
1.154 + is reached. The data is read into the descriptor buffer supplied.
1.155 +
1.156 + @see Read(TDes8& aDes)
1.157 +
1.158 + @param aPos Position of first byte to be read.
1.159 + This is an offset from the start of the file.
1.160 + @param aDes Descriptor into which binary data is read. Any
1.161 + existing contents are overwritten. On return,
1.162 + its length is set to the number of bytes read.
1.163 + @param aLength The number of bytes to read from the file,
1.164 + or to the end of the file, whichever is encountered first.
1.165 + The length of the buffer is set to the number of bytes actually read.
1.166 + @param aStatus Asynchronous request status. On completion this will contain one
1.167 + of the following error codes: KErrNone if the data was
1.168 + successfully read. Otherwise one of the CAF error codes defined in
1.169 + \c caferr.h or one of the other standard system-wide
1.170 + error codes for any other errors.
1.171 + @return KErrNone if the async read request was successfully submitted.
1.172 + @return KErrArgument if a negative offset is supplied.
1.173 + @return KErrCANotSupported if the agent does not support this operation.
1.174 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.175 + */
1.176 IMPORT_C TInt Read(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus) const;
1.177 -
1.178 +#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.179 +
1.180 /**
1.181 Gets the data size in bytes.
1.182
1.183 @@ -415,6 +507,17 @@
1.184 */
1.185 IMPORT_C void DataSizeL(TInt& aSize);
1.186
1.187 +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.188 + /**
1.189 + This is the 64bit version of CData::DataSizeL
1.190 + Client can call this function instead of CData::DataSizeL. If it's not implemented by the agent,
1.191 + fallback to 32bit counterpart will be provided automatically
1.192 +
1.193 + @see DataSizeL(TInt& aSize)
1.194 + */
1.195 + IMPORT_C void DataSize64L(TInt64& aSize);
1.196 +#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.197 +
1.198 /**
1.199 Changes or retrieves the location of the file pointer within
1.200 the content object.
1.201 @@ -452,6 +555,16 @@
1.202 */
1.203 IMPORT_C TInt Seek(TSeek aMode,TInt& aPos) const;
1.204
1.205 +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.206 + /**
1.207 + This is the 64bit version of CData::Seek
1.208 + Client can call this function instead of CData::Seek. If it's not implemented by the agent,
1.209 + fallback to 32bit counterpart will be provided automatically
1.210 +
1.211 + @see Seek(TSeek aMode,TInt& aPos)
1.212 + */
1.213 + IMPORT_C TInt Seek64(TSeek aMode,TInt64& aPos) const;
1.214 +#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.215
1.216 /** Request the agent handling this content to set a property value. If the property is set
1.217 it is only set for this CData session and does not impact other CAF users.
1.218 @@ -678,7 +791,8 @@
1.219 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted
1.220 */
1.221 IMPORT_C TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet) const;
1.222 -
1.223 +
1.224 +
1.225 #ifndef REMOVE_CAF1
1.226 /** Set Qos attribute
1.227 @param aQosAttr The Qos attribute to set.
1.228 @@ -695,6 +809,37 @@
1.229 IMPORT_C TBool GetMimeTypeL(TDes8& aMimeType) const;
1.230 #endif // REMOVE_CAF1
1.231
1.232 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.233 + /**
1.234 + Decrypts the encrypted input data packet.
1.235 +
1.236 + @param aEncryptedInputDataPacket Buffer descriptor containing the encrypted data packet supplied by client application.
1.237 + @param aDecryptedOutputDataPacket Buffer descriptor supplied by the client application into which the decrypted data is written.
1.238 + The length of this descriptor must be equal to or greater than the input packet.
1.239 + @return KErrNone if successful.KErrInsufficientDataPacketLength if a part of input packet is provided,
1.240 + otherwise one of the CAF error codes defined in \c caferr.h or
1.241 + one of the other system-wide error codes.
1.242 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability.
1.243 + Access to unprotected content is unrestricted.
1.244 + */
1.245 +
1.246 + IMPORT_C TInt Read(const TDesC8& aEncryptedInputDataPacket, TDes8& aDecryptedOutputDataPacket) const;
1.247 +
1.248 + /**
1.249 + Decrypts the encrypted input data packet asynchronously.
1.250 + @param aEncryptedInputDataPacket Buffer descriptor containing the encrypted data packet supplied by client application.
1.251 + @param aDecryptedOutputDataPacket Buffer descriptor supplied by the client application into which the decrypted data is written.
1.252 + The length of this descriptor must be equal to or greater than the input packet.
1.253 + @param aStatus Asynchronous request status. On completion this will contain one of the following error codes:
1.254 + KErrNone if the data packet was successfully decrypted.KErrInsufficientDataPacketLength if a
1.255 + part of input packet is provided, otherwise one of the CAF error codes defined in \c caferr.h or
1.256 + one of the other system-wide error codes.
1.257 + @capability DRM Access to DRM protected content is not permitted for processes without DRM capability.
1.258 + Access to unprotected content is unrestricted.
1.259 + */
1.260 + IMPORT_C void Read(const TDesC8& aEncryptedInputDataPacket, TDes8& aDecryptedOutputDataPacket, TRequestStatus& aStatus) const;
1.261 +
1.262 +#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.263
1.264 private:
1.265 CData();
1.266 @@ -708,6 +853,24 @@
1.267 void ConstructL(TUid aAgentUid, RFile& aFile, const TDesC& aUniqueId);
1.268 void ConstructL(TUid aAgentUid, const TVirtualPathPtr& aVirtualPath, TContentShareMode aShareMode);
1.269
1.270 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.271 +
1.272 + void ConstructL(TUid aAgentUid, const TDesC8& aHeaderData, TIntent aIntent);
1.273 + void ConstructL(const TDesC8& aHeaderData);
1.274 + void ConstructL(const TDesC8& aHeaderData, TIntent aIntent);
1.275 + void ConstructL(TUid aAgentUid, const TDesC8& aHeaderData);
1.276 +
1.277 +#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.278 +
1.279 +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.280 + /*
1.281 + * This is the obselete 32bit Read and replaced by its 64bit counterpart
1.282 + * TInt Read(TInt64 aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus) const
1.283 + * However, this function still exits at its original ordinal to avoid BC break.
1.284 + * Upgrade to 64bit Read is done automatically upon recompling the client code which uses CAF interfaces
1.285 + */
1.286 + IMPORT_C TInt Read_Unused(TInt aPos, TDes8& aDes, TInt aLength, TRequestStatus& aStatus) const;
1.287 +#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.288
1.289 private:
1.290 // The agent handling this content