|
1 /* |
|
2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Declaration of the OMA DRM CAF Data Agent |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef OMA2AGENTDATA_H |
|
21 #define OMA2AGENTDATA_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <f32file.h> |
|
25 #include <caf/caf.h> |
|
26 #include <caf/agentinterface.h> |
|
27 #include <dcfcommon.h> |
|
28 #include <drmrightsclient.h> |
|
29 |
|
30 //this header can be removed when ASYNC_READ flag is removed |
|
31 #include "dcfcache.h" |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 |
|
35 class CDcfCache; |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 namespace ContentAccess |
|
40 { |
|
41 |
|
42 /** |
|
43 * OMA DRM CAF Data Agent |
|
44 * @lib omadrmagent.lib |
|
45 */ |
|
46 class COma2AgentData : public CAgentData |
|
47 { |
|
48 public: |
|
49 // Constructors and destructor |
|
50 |
|
51 /** |
|
52 * Two-phased constructor. |
|
53 */ |
|
54 static COma2AgentData* NewL( const TVirtualPathPtr& aVirtualPath, |
|
55 TContentShareMode aShareMode ); |
|
56 static COma2AgentData* NewLC( const TVirtualPathPtr& aVirtualPath, |
|
57 TContentShareMode aShareMode ); |
|
58 |
|
59 static COma2AgentData* NewL( RFile& aFile, const TDesC& aUniqueId ); |
|
60 static COma2AgentData* NewLC( RFile& aFile, const TDesC& aUniqueId ); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 ~COma2AgentData(); |
|
66 |
|
67 public: |
|
68 // From CAgentData |
|
69 TInt Read( TDes8& aDes ); |
|
70 TInt Read( TDes8& aDes, TInt aLength ); |
|
71 void Read( TDes8& aDes, TRequestStatus& aStatus ); |
|
72 void Read( TDes8& aDes, TInt aLength, TRequestStatus& aStatus ); |
|
73 void DataSizeL( TInt& aSize ); |
|
74 TInt Seek( TSeek aMode, TInt& aPos ); |
|
75 TInt SetProperty( TAgentProperty aProperty, TInt aValue ); |
|
76 TInt EvaluateIntent( TIntent aIntent ); |
|
77 TInt ExecuteIntent( TIntent aIntent ); |
|
78 TInt GetAttribute( TInt aAttribute, TInt& aValue ); |
|
79 TInt GetAttributeSet( RAttributeSet& aAttributeSet ); |
|
80 TInt GetStringAttribute( TInt aAttribute, TDes& aValue ); |
|
81 TInt GetStringAttributeSet( RStringAttributeSet& aStringAttributeSet ); |
|
82 #ifdef ASYNC_READ |
|
83 void ReadCancel( TRequestStatus& aStatus ); |
|
84 TInt Read( TInt aPos, TDes8& aDes, TInt aLength, |
|
85 TRequestStatus& aStatus ); |
|
86 #endif |
|
87 |
|
88 private: |
|
89 |
|
90 /** |
|
91 * C++ default constructor. |
|
92 */ |
|
93 COma2AgentData(); |
|
94 |
|
95 /** |
|
96 * By default Symbian 2nd phase constructor is private. |
|
97 */ |
|
98 void ConstructL( const TVirtualPathPtr& aVirtualPath, |
|
99 TContentShareMode aShareMode ); |
|
100 void ConstructL( RFile& aFile, const TDesC& aUniqueId ); |
|
101 void InitializeL(); |
|
102 |
|
103 // Prohibit copy constructor if not deriving from CBase. |
|
104 // COma2AgentData( const COma2AgentData& ); |
|
105 // Prohibit assigment operator if not deriving from CBase. |
|
106 // COma2AgentData& operator=( const COma2AgentData& ); |
|
107 |
|
108 protected: |
|
109 // Data |
|
110 CDcfCommon* iDcf; |
|
111 RFs iFs; |
|
112 RFile iFile; |
|
113 TInt iDataPosition; |
|
114 TInt iRightsStatus; |
|
115 RDRMRightsClient iRdb; |
|
116 TVirtualPathPtr iVirtualPath; |
|
117 CDcfCache* iCache; |
|
118 TBool iGroupKeyUsed; |
|
119 TInt iLastFileSize; |
|
120 HBufC* iUniqueId; |
|
121 |
|
122 }; |
|
123 |
|
124 } |
|
125 |
|
126 #endif // OMA2AGENTDATA_H |
|
127 // End of File |