|
1 /* |
|
2 * Copyright (c) 2006 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: Definition of UI helper utility for DRM functions |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_CMPXDRMUIHELPER_H |
|
21 #define C_CMPXDRMUIHELPER_H |
|
22 |
|
23 #ifdef CAMESE_IN_DRM_UTILITY |
|
24 #include <drmuicheckrightsobserver.h> |
|
25 #endif |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CMPXMedia; |
|
29 #ifdef CAMESE_IN_DRM_UTILITY |
|
30 namespace DRM |
|
31 { |
|
32 class CDrmUiHandling; |
|
33 } |
|
34 #else |
|
35 class CDRMHelper; |
|
36 #endif |
|
37 |
|
38 class CMPXCommonUiHelper; |
|
39 |
|
40 #ifdef __CAMESE_SUPERDISTRIBUTION_SUPPORT |
|
41 class CCameseUiHelper; |
|
42 #endif |
|
43 |
|
44 // CLASS DECLARATION |
|
45 |
|
46 /** |
|
47 * DRM UI helper utility class. |
|
48 * |
|
49 * @lib mpxcommonui.lib |
|
50 * @since S60 v3.0 |
|
51 */ |
|
52 NONSHARABLE_CLASS( CMPXDrmUiHelper ) : public CBase |
|
53 #ifdef CAMESE_IN_DRM_UTILITY |
|
54 ,public DRM::MDrmUiCheckRightsObserver |
|
55 #endif |
|
56 { |
|
57 public: |
|
58 |
|
59 /** |
|
60 * Two-phased constructor. |
|
61 * |
|
62 * @since 3.0 |
|
63 * @return Pointer to newly created object. |
|
64 */ |
|
65 static CMPXDrmUiHelper* NewL( CMPXCommonUiHelper* aHelper ); |
|
66 |
|
67 /** |
|
68 * Destructor. |
|
69 */ |
|
70 virtual ~CMPXDrmUiHelper(); |
|
71 |
|
72 /** |
|
73 * Handles displaying the error message for given error code |
|
74 * according to the media object provided |
|
75 * |
|
76 * @since 3.1 |
|
77 * @param aError Error code |
|
78 * @param aMedia MPXMedia object |
|
79 * @param aFile Handle to file |
|
80 * @return KErrNone if no error, or else if a dialog is displayed will |
|
81 * return the Button ID used to dismiss dialog. |
|
82 */ |
|
83 TInt HandleDrmErrorL( TInt aError, |
|
84 const CMPXMedia* aMedia=NULL, |
|
85 RFile* aFile=NULL ); |
|
86 |
|
87 private: |
|
88 |
|
89 /** |
|
90 * C++ default constructor. |
|
91 */ |
|
92 CMPXDrmUiHelper( CMPXCommonUiHelper* aHelper ); |
|
93 |
|
94 /** |
|
95 * By default Symbian 2nd phase constructor is private. |
|
96 */ |
|
97 void ConstructL(); |
|
98 |
|
99 private: // New methods |
|
100 |
|
101 /** |
|
102 * Handles OMA specific error messages |
|
103 * @param aMedia MPXMedia object |
|
104 * @param aFile Handle to file |
|
105 * @return KErrNone if no error, or else if a dialog is displayed will |
|
106 * return the Button ID used to dismiss dialog. |
|
107 */ |
|
108 TInt HandleOMAErrorL( TInt aError, |
|
109 const CMPXMedia* aMedia, |
|
110 RFile* aFile ); |
|
111 |
|
112 /** |
|
113 * Handles WMA specific error messages |
|
114 * @param aMedia MPXMedia object |
|
115 * @param aFile Handle to file |
|
116 * @return KErrNone if no error, or else if a dialog is displayed will |
|
117 * return the Button ID used to dismiss dialog. |
|
118 */ |
|
119 TInt HandleWMAErrorL( TInt aError, |
|
120 const CMPXMedia* aMedia, |
|
121 RFile* aFile ); |
|
122 |
|
123 #ifdef CAMESE_IN_DRM_UTILITY |
|
124 private: // From MDrmUiCheckRightsObserver |
|
125 |
|
126 DRM::TCheckRightsAction RightsLeft( |
|
127 TInt aOperationId, |
|
128 TBool aUnconstrained, |
|
129 TTimeIntervalSeconds aTime, |
|
130 TInt aCounts, |
|
131 TTimeIntervalSeconds aAccumulated ); |
|
132 |
|
133 DRM::TCheckRightsAction RightsNotValid( |
|
134 TInt aOperationId, |
|
135 DRM::TCheckRightsStatus aRightsStatus, |
|
136 TInt aReason ); |
|
137 |
|
138 // Unused observation methods |
|
139 |
|
140 DRM::TEmbeddedPreviewAction EmbeddedPreviewAvailable( |
|
141 TInt aOperationId, |
|
142 const TDesC& aUniqueId, |
|
143 TInt aRightsStatus, |
|
144 TInt aReason ); |
|
145 |
|
146 DRM::TPreviewRightsAction PreviewRightsUrlAvailable( |
|
147 TInt aOperationId, |
|
148 const TDesC& aPreviewRightsUrl, |
|
149 TInt aRightsStatus, |
|
150 TInt aReason ); |
|
151 |
|
152 DRM::TSilentRightsAction SilentRightsUrlAvailable( |
|
153 TInt aOperationId, |
|
154 const TDesC& aSilentRightsUrl, |
|
155 TInt aRightsStatus, |
|
156 TInt aReason ); |
|
157 |
|
158 DRM::TRightsAction RightsUrlAvailable( |
|
159 TInt aOperationId, |
|
160 const TDesC& aRightsUrl, |
|
161 TInt aRightsStatus, |
|
162 TInt aReason, |
|
163 TInt aUrlType ); |
|
164 |
|
165 void PreviewRightsAvailable( |
|
166 TInt aOperationId, |
|
167 TInt aError ); |
|
168 |
|
169 void SilentRightsAvailable( |
|
170 TInt aOperationId, |
|
171 TInt aError ); |
|
172 |
|
173 void RightsAvailable( |
|
174 TInt aOperationId, |
|
175 TInt aError ); |
|
176 |
|
177 void PlayEmbeddedPreviewSelected( |
|
178 TInt aOperationId, |
|
179 const TDesC& aUniqueId ); |
|
180 |
|
181 void OperationCompleted( TInt aOperationId, TInt aOperationStatus ); |
|
182 #endif |
|
183 |
|
184 private: // Data |
|
185 #ifdef CAMESE_IN_DRM_UTILITY |
|
186 DRM::CDrmUiHandling* iDrmUiHandler; // owned |
|
187 |
|
188 TBool iRightsValid; |
|
189 #else |
|
190 CDRMHelper* iDrmHelper; // owned |
|
191 #ifdef __CAMESE_SUPERDISTRIBUTION_SUPPORT |
|
192 CCameseUiHelper* iCameseUiHelper; // own |
|
193 #endif |
|
194 #endif |
|
195 CMPXCommonUiHelper* iCommonUiHelper; // Not Owned |
|
196 }; |
|
197 |
|
198 #endif // C_CMPXDRMUIHELPER_H |
|
199 |
|
200 // End of File |