|
1 /* |
|
2 * Copyright (c) 2005-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 Content Agent |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef OMA2AGENTCONTENT_H |
|
20 #define OMA2AGENTCONTENT_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <f32file.h> |
|
24 #include <caf/caf.h> |
|
25 #include <caf/agentinterface.h> |
|
26 #include <dcfcommon.h> |
|
27 #include <drmnotifier.h> |
|
28 #include <drmrightsclient.h> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CAESDecryptor; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 namespace ContentAccess |
|
35 { |
|
36 |
|
37 /** |
|
38 * OMA DRM CAF Content Agent implementation |
|
39 * |
|
40 * @lib OmaDrmAgent.lib |
|
41 * @since Series 60 3.0 |
|
42 */ |
|
43 class COma2AgentContent : public CAgentContent, public MDRMEventObserver |
|
44 { |
|
45 public: |
|
46 static COma2AgentContent* NewL( |
|
47 const TDesC& aUri, |
|
48 TContentShareMode aShareMode); |
|
49 |
|
50 static COma2AgentContent* NewLC( |
|
51 const TDesC& aUri, |
|
52 TContentShareMode aShareMode); |
|
53 |
|
54 static COma2AgentContent* NewL( |
|
55 RFile& aFile); |
|
56 |
|
57 static COma2AgentContent* NewLC( |
|
58 RFile& aFile); |
|
59 |
|
60 void EmbedDomainRoL(); |
|
61 |
|
62 virtual ~COma2AgentContent(); |
|
63 |
|
64 public: |
|
65 // From CAgentContent |
|
66 virtual TInt OpenContainer( |
|
67 const TDesC& aUniqueId); |
|
68 |
|
69 virtual TInt CloseContainer(); |
|
70 |
|
71 virtual void GetEmbeddedObjectsL( |
|
72 RStreamablePtrArray<CEmbeddedObject>& aArray); |
|
73 |
|
74 virtual void GetEmbeddedObjectsL( |
|
75 RStreamablePtrArray<CEmbeddedObject>& aArray, |
|
76 TEmbeddedType aType); |
|
77 |
|
78 virtual TInt Search( |
|
79 RStreamablePtrArray<CEmbeddedObject>& aArray, |
|
80 const TDesC8& aMimeType, |
|
81 TBool aRecursive); |
|
82 |
|
83 virtual TInt GetAttribute( |
|
84 TInt aAttribute, |
|
85 TInt& aValue, |
|
86 const TDesC& aUniqueId); |
|
87 |
|
88 virtual TInt GetAttributeSet( |
|
89 RAttributeSet& aAttributeSet, |
|
90 const TDesC& aUniqueId); |
|
91 |
|
92 virtual TInt GetStringAttribute( |
|
93 TInt aAttribute, |
|
94 TDes& aValue, |
|
95 const TDesC& aUniqueId); |
|
96 |
|
97 virtual TInt GetStringAttributeSet( |
|
98 RStringAttributeSet& aStringAttributeSet, |
|
99 const TDesC& aUniqueId); |
|
100 |
|
101 virtual TInt AgentSpecificCommand( |
|
102 TInt aCommand, |
|
103 const TDesC8& aInputBuffer, |
|
104 TDes8& aOutputBuffer); |
|
105 |
|
106 virtual void AgentSpecificCommand( |
|
107 TInt aCommand, |
|
108 const TDesC8& aInputBuffer, |
|
109 TDes8& aOutputBuffer, |
|
110 TRequestStatus& aStatus); |
|
111 |
|
112 virtual void NotifyStatusChange( |
|
113 TEventMask aMask, |
|
114 TRequestStatus& aStatus, |
|
115 const TDesC& aUniqueId); |
|
116 |
|
117 virtual TInt CancelNotifyStatusChange( |
|
118 TRequestStatus& aStatus, |
|
119 const TDesC& aUniqueId); |
|
120 |
|
121 virtual void RequestRights( |
|
122 TRequestStatus& aStatus, |
|
123 const TDesC& aUniqueId); |
|
124 |
|
125 virtual TInt CancelRequestRights( |
|
126 TRequestStatus& aStatus, |
|
127 const TDesC& aUniqueId); |
|
128 |
|
129 virtual void DisplayInfoL( |
|
130 TDisplayInfo aInfo, |
|
131 const TDesC& aUniqueId); |
|
132 |
|
133 virtual TInt SetProperty( |
|
134 TAgentProperty aProperty, |
|
135 TInt aValue); |
|
136 |
|
137 public: // From MDRMEventObserver |
|
138 virtual void HandleEventL( |
|
139 MDRMEvent* aEvent); |
|
140 |
|
141 private: |
|
142 COma2AgentContent(); |
|
143 |
|
144 void NotifyStatusChangeL( |
|
145 TEventMask aMask, |
|
146 TRequestStatus& aStatus, |
|
147 const TDesC& aUniqueId); |
|
148 |
|
149 |
|
150 void ConstructL( |
|
151 const TDesC& aUri, |
|
152 TContentShareMode aShareMode); |
|
153 |
|
154 void ConstructL( |
|
155 RFile& aFile); |
|
156 |
|
157 protected: // Data |
|
158 CDcfCommon* iDcf; |
|
159 RFs iFs; |
|
160 RFile iFile; |
|
161 TInt iFilePosition; |
|
162 TInt iDataPosition; |
|
163 HBufC* iUri; |
|
164 |
|
165 // Content ID of the currently open container, |
|
166 // NULL for the outermost file |
|
167 HBufC* iCurrentContainer; |
|
168 |
|
169 // Request status for change notifications |
|
170 TRequestStatus* iStatus; |
|
171 |
|
172 // Notifier for change notifications |
|
173 CDRMNotifier* iNotifier; |
|
174 |
|
175 // Watched events |
|
176 TEventMask iWatchedEvents; |
|
177 |
|
178 // Watched content ID |
|
179 HBufC8* iWatchedId; |
|
180 |
|
181 // Rights client |
|
182 RDRMRightsClient iRdb; |
|
183 }; |
|
184 |
|
185 } |
|
186 |
|
187 #endif // OMA2AGENTCONTENT_H |
|
188 |
|
189 // End of File |