|
1 /* |
|
2 * Copyright (c) 2003-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: Declares view for Details class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef DRMRIGHTSMGRDETAILSVIEW_H |
|
21 #define DRMRIGHTSMGRDETAILSVIEW_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <aknview.h> |
|
25 #include "drmrightsmgrdetailscontainer.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CDRMRightsMgrDetailsContainer; |
|
29 class CDRMRights; |
|
30 class DRMCommon; |
|
31 |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * CDRMRightsMgrDetailsView |
|
37 * view class. |
|
38 */ |
|
39 class CDRMRightsMgrDetailsView : public CAknView |
|
40 { |
|
41 public: |
|
42 // Panic code used in this class |
|
43 enum TDRMUIViewPanicCodes |
|
44 { |
|
45 EDRMUIViewPanicNullPtr = 1 // Failed to create the container |
|
46 }; |
|
47 |
|
48 public: // Constructors and destructor |
|
49 /** |
|
50 * Constructor. |
|
51 * @param aStartEmbedded ETrue if it has to display details when DRMUI |
|
52 * was started embedded. |
|
53 * @param aViewId ID of the view |
|
54 * @param aContext The context for the help |
|
55 */ |
|
56 CDRMRightsMgrDetailsView( TBool aStartEmbedded ); |
|
57 |
|
58 /** |
|
59 * Symbian OS two-phased constructor |
|
60 * @param aStartEmbedded ETrue if it has to display details when DRMUI |
|
61 * was started embedded. |
|
62 * @return DRMUI DetailsView. |
|
63 */ |
|
64 static CDRMRightsMgrDetailsView* NewL( TBool aStartEmbedded ); |
|
65 |
|
66 /** |
|
67 * Symbian OS two-phased constructor |
|
68 * @param aStartEmbedded ETrue if it has to display details when DRMUI |
|
69 * was started embedded. |
|
70 * @return DRMUI DetailsView. |
|
71 */ |
|
72 static CDRMRightsMgrDetailsView* NewLC( TBool aStartEmbedded ); |
|
73 |
|
74 /** |
|
75 * Symbian default constructor. |
|
76 * @param aResourceId Title resource |
|
77 */ |
|
78 void ConstructL( const TInt aResourceId ); |
|
79 |
|
80 /** |
|
81 * Destructor. |
|
82 */ |
|
83 ~CDRMRightsMgrDetailsView(); |
|
84 |
|
85 |
|
86 public: // from CAknView |
|
87 |
|
88 /** |
|
89 * Returns view id. |
|
90 * @return TUid |
|
91 */ |
|
92 TUid Id() const; |
|
93 |
|
94 /** |
|
95 * Handles the changes of the client rect |
|
96 */ |
|
97 void HandleClientRectChange(); |
|
98 |
|
99 |
|
100 public: |
|
101 |
|
102 /** |
|
103 * From MEikCommandObserver. Handles commands. |
|
104 * @param aCommand Command to be handled. |
|
105 */ |
|
106 void HandleCommandL( TInt aCommand ); |
|
107 |
|
108 |
|
109 protected: |
|
110 /** |
|
111 * From AknView. Called when the view is going to be activated |
|
112 * @param aPrevViewId Previous View ID. Not used |
|
113 * @param aCustomMessageId Custom message ID. Not used |
|
114 * @param aCustomMessage Custom Message. Not used |
|
115 */ |
|
116 void DoActivateL(const TVwsViewId& aPrevViewId, |
|
117 TUid aCustomMessageId, |
|
118 const TDesC8& aCustomMessage); |
|
119 |
|
120 /** |
|
121 * From AknView. Called when the view is going to be deactivated |
|
122 */ |
|
123 void DoDeactivate(); |
|
124 |
|
125 /** |
|
126 * From MEikMenuObserver. Function called by the EIKON framework just |
|
127 * before it displays a menu pane. |
|
128 * @param aResourceId Menu pane resource ID |
|
129 * @param aMenuPane Menu pane pointer |
|
130 */ |
|
131 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
132 |
|
133 |
|
134 public: // new |
|
135 /** |
|
136 * Refreshes the content of the listbox. Used when it is requested to |
|
137 * view details from a RO, e.g. from Keys not in use view or when DRMUI |
|
138 * is started to show only Details View. |
|
139 * @param aRights The Rights Object |
|
140 * @param aTitle Title to be showed in the title pane |
|
141 * @param aFullName Full name of the object |
|
142 * @param aContentCanBeSent ETrue if the object can be sent |
|
143 * @param aIndividualConstraint ETrue if object has individual constraint |
|
144 * @param aUsageAllowed ETrue if object use allowed with current SIM |
|
145 */ |
|
146 void RefreshListBoxL( CDRMRights* aRights, const TDesC& aTitle, |
|
147 const TDesC& aFullName, |
|
148 const TBool aContentCanBeSent = EFalse, |
|
149 const TBool aIndividualConstraint = EFalse, |
|
150 const TBool aUsageAllowed = ETrue ); |
|
151 |
|
152 /** |
|
153 * Refreshes the content of the listbox. Used when it is requested to |
|
154 * view details from a Windows Media DRM license. |
|
155 * @param aArray The WM DRM Rights Object array |
|
156 * @param aTitle Title to be showed in the title pane |
|
157 * @param aFullName Full name of the object |
|
158 */ |
|
159 void RefreshListBoxL( |
|
160 ContentAccess::RStreamablePtrArray<ContentAccess::CRightsInfo>& aArray, |
|
161 const TDesC& aTitle, |
|
162 const TDesC& aFullName ); |
|
163 |
|
164 private: // new |
|
165 |
|
166 /** |
|
167 * Creates the details view container |
|
168 */ |
|
169 void CreateContainerL(); |
|
170 |
|
171 /** |
|
172 * Instantiates the new details view container. Called by DoActivateL. |
|
173 */ |
|
174 void NewContainerL(); |
|
175 |
|
176 /** |
|
177 * Removes the container |
|
178 */ |
|
179 void RemoveContainer(); |
|
180 |
|
181 /** |
|
182 * Sets the title of the view |
|
183 * @param aTitle Text to be showed as the title |
|
184 */ |
|
185 void SetTitlePaneL( const TDesC& aTitle ); |
|
186 |
|
187 /** |
|
188 * Sets Help context |
|
189 * @return The array of help contexts. |
|
190 */ |
|
191 CArrayFix<TCoeHelpContext>* HelpContextL() const; |
|
192 |
|
193 /** |
|
194 * Sets MSK id + label |
|
195 */ |
|
196 void SetMiddleSoftKeyLabelL( const TInt aResourceId, |
|
197 const TInt aCommandId ); |
|
198 |
|
199 /** |
|
200 * Makes the left softkey visible or invisible |
|
201 * @param aVisible ETrue when the left softkey should be visible. |
|
202 */ |
|
203 void MakeLeftSoftkeyVisible( TBool aVisible ); |
|
204 |
|
205 void DeleteConstraints(); |
|
206 |
|
207 /** |
|
208 * Initializes and prepares internal data for refreshing of the |
|
209 * list box. |
|
210 * @param aFullName Full name of the object |
|
211 * @param aDrmScheme Tells the DRM protection scheme of the file |
|
212 * @param aRights Data of a Rights Object |
|
213 * @param aContentCanBeSent ETrue if the object can be sent |
|
214 * @param aIndividualConstraint ETrue if object has individual constraint |
|
215 * @param aUsageAllowed ETrue if object use allowed with current SIM |
|
216 */ |
|
217 void PrepareRefreshL( const TDesC& aFullName, |
|
218 const TInt& aDrmScheme, |
|
219 TRights& aRights, |
|
220 const TBool& aContentCanBeSent, |
|
221 const TBool& aIndividualConstraint, |
|
222 const TBool& aUsageAllowed ); |
|
223 |
|
224 /** |
|
225 * Finalizes refreshing of the list box |
|
226 * @param aTitle Title to be showed in the title pane |
|
227 * @param aRights Data of a Rights Object |
|
228 */ |
|
229 void FinalizeRefreshL( const TDesC& aTitle, |
|
230 const TRights& aRights ); |
|
231 |
|
232 private: // Data |
|
233 |
|
234 // Pointer to the container |
|
235 CDRMRightsMgrDetailsContainer* iContainer; |
|
236 |
|
237 // ID of the view |
|
238 TUid iViewId; |
|
239 |
|
240 // Data about RO to be shown |
|
241 TDetails iDetails; |
|
242 |
|
243 // Tells if it has to display details when DRMUI was started embedded. |
|
244 TBool iStartEmbedded; |
|
245 }; |
|
246 |
|
247 |
|
248 #endif |
|
249 |
|
250 // End of File |