1 /* |
1 /* |
2 * Copyright (c) 2003-2007 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
68 Applications can use CContent to browse the hierarchy of content objects |
68 Applications can use CContent to browse the hierarchy of content objects |
69 within a file containing several content objects. |
69 within a file containing several content objects. |
70 |
70 |
71 During construction CContent loads the correct CAF Agent plugin to handle |
71 During construction CContent loads the correct CAF Agent plugin to handle |
72 the file specified by the URI. |
72 the file specified by the URI. |
73 |
|
74 @publishedPartner |
|
75 @released |
|
76 */ |
73 */ |
77 class CContent : public CBase |
74 class CContent : public CBase |
78 { |
75 { |
79 public: |
76 public: |
80 |
77 |
165 @leave ... One of the CAF error codes defined in \c caferr.h or one of the |
162 @leave ... One of the CAF error codes defined in \c caferr.h or one of the |
166 other system-wide error codes for any other errors. |
163 other system-wide error codes for any other errors. |
167 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted |
164 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted |
168 */ |
165 */ |
169 IMPORT_C static CContent* NewL(RFile& aFile); |
166 IMPORT_C static CContent* NewL(RFile& aFile); |
|
167 |
|
168 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
|
169 /** |
|
170 Constructs a new CContent object. |
|
171 |
|
172 @param aHeaderData Header data of WMDRM file/stream content. |
|
173 @return CContent object. |
|
174 @leave KErrMissingHeaderData if the header data is NULL or one of the CAF error codes defined in caferr.h |
|
175 or one of the system-wide error codes for any other errors. |
|
176 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted |
|
177 */ |
|
178 IMPORT_C static CContent* NewL(const TDesC8& aHeaderData); |
|
179 |
|
180 /** |
|
181 Constructs a new CContent object. |
|
182 |
|
183 @param aHeaderData Header data of WMDRM file/stream content. |
|
184 @return CContent object. |
|
185 @leave KErrMissingHeaderData if the header data is NULL or one of the CAF error codes defined in caferr.h or one of the |
|
186 system-wide error codes for any other errors. |
|
187 @capability DRM Access to DRM protected content is not permitted for processes without DRM capability. Access to unprotected content is unrestricted |
|
188 */ |
|
189 IMPORT_C static CContent* NewLC(const TDesC8& aHeaderData); |
|
190 |
|
191 #endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
170 |
192 |
171 /** destructor */ |
193 /** destructor */ |
172 virtual ~CContent(); |
194 virtual ~CContent(); |
173 |
195 |
174 /** Open a Container object within the file. |
196 /** Open a Container object within the file. |
924 IMPORT_C CData* OpenContentLC(TIntent aIntent, const TDesC& aUniqueId); |
946 IMPORT_C CData* OpenContentLC(TIntent aIntent, const TDesC& aUniqueId); |
925 |
947 |
926 |
948 |
927 /** Find out which agent is handling this file |
949 /** Find out which agent is handling this file |
928 @return The agent handling the File |
950 @return The agent handling the File |
929 @capability DRM Access to DRM agents is not permitted for processes without DRM capability |
|
930 */ |
951 */ |
931 IMPORT_C const TAgent& Agent() const; |
952 IMPORT_C const TAgent& Agent() const; |
|
953 |
|
954 /** Indicates the mode in which the content is shared. |
|
955 @return The content sharing mode |
|
956 */ |
|
957 inline TContentShareMode ShareMode() const; |
932 |
958 |
933 #ifndef REMOVE_CAF1 |
959 #ifndef REMOVE_CAF1 |
934 /** Create a CData object for reading the content |
960 /** Create a CData object for reading the content |
935 |
961 |
936 @see ContentAccess::TIntent |
962 @see ContentAccess::TIntent |
964 private: |
990 private: |
965 CContent(); |
991 CContent(); |
966 void ConstructL(RFile& aFile); |
992 void ConstructL(RFile& aFile); |
967 void ConstructL(const TDesC& aURI, TContentShareMode aShareMode); |
993 void ConstructL(const TDesC& aURI, TContentShareMode aShareMode); |
968 |
994 |
|
995 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
|
996 void ConstructL(const TDesC8& aHeaderData); |
|
997 |
|
998 /** |
|
999 Create a CData object for reading WMDRM content. |
|
1000 |
|
1001 @param aIntent The intended use of the content. |
|
1002 @param aHeaderData Header data of WMDRM file/stream content. |
|
1003 @return CData object. |
|
1004 @leave One of the CAF error codes defined in caferr.h or one of the system-wide error codes for any errors. |
|
1005 @capability DRM Access to DRM agents is not permitted for processes without DRM capability. |
|
1006 */ |
|
1007 |
|
1008 CData* OpenContentL(TIntent aIntent, const TDesC8& aHeaderData); |
|
1009 |
|
1010 /** |
|
1011 Create a CData object for reading WMDRM content. |
|
1012 |
|
1013 @param aIntent The intended use of the content. |
|
1014 @param aHeaderData Header data of WMDRM file/stream content. |
|
1015 @return CData object. |
|
1016 @leave One of the CAF error codes defined in caferr.h or one of the system-wide error codes for any errors. |
|
1017 @capability DRM Access to DRM agents is not permitted for processes without DRM capability. |
|
1018 */ |
|
1019 CData* OpenContentLC(TIntent aIntent, const TDesC8& aHeaderData); |
|
1020 |
|
1021 #endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
|
1022 |
969 private: |
1023 private: |
970 |
1024 |
971 /** CAgentFactory object is effectively the ECOM session handle */ |
1025 /** CAgentFactory object is effectively the ECOM session handle */ |
972 CAgentFactory* iAgentFactory; |
1026 CAgentFactory* iAgentFactory; |
973 |
1027 |
990 |
1044 |
991 /** The share mode used to open the content file*/ |
1045 /** The share mode used to open the content file*/ |
992 TContentShareMode iShareMode; |
1046 TContentShareMode iShareMode; |
993 |
1047 |
994 /** Reference to the file handle if the content was opened with a file handle */ |
1048 /** Reference to the file handle if the content was opened with a file handle */ |
|
1049 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
1050 RFile64 iFile; |
|
1051 #else |
995 RFile iFile; |
1052 RFile iFile; |
|
1053 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
1054 |
|
1055 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
|
1056 HBufC8* iHeaderData; |
|
1057 #endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
|
1058 |
996 }; |
1059 }; |
997 |
1060 |
|
1061 #include <caf/content.inl> |
998 } // namespace ContentAccess |
1062 } // namespace ContentAccess |
999 #endif /* __CONTENT_H__ */ |
1063 |
|
1064 #endif // __CONTENT_H__ |
|
1065 |