|
1 /* |
|
2 * Copyright (c) 2007-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: This file contains the header file of the CIAUpdateMainView class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef IAUPDATEMAINVIEW_H |
|
21 #define IAUPDATEMAINVIEW_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <aknview.h> |
|
25 #include <akntoolbarobserver.h> |
|
26 #include "iaupdatecontainerobserver.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CAknNavigationControlContainer; |
|
30 class CAknNavigationDecorator; |
|
31 class CAknToolbar; |
|
32 class CIAUpdateMainContainer; |
|
33 class CIAUpdateFWUpdateHandler; |
|
34 |
|
35 class MIAUpdateAnyNode; |
|
36 class MIAUpdateNode; |
|
37 class MIAUpdateFwNode; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 /** |
|
41 * This class represents the main view of IAUpdate |
|
42 * |
|
43 */ |
|
44 class CIAUpdateMainView : public CAknView, |
|
45 public MAknToolbarObserver, |
|
46 public MIAUpdateContainerObserver |
|
47 { |
|
48 public: |
|
49 /** |
|
50 * Symbian two phased constructor. |
|
51 * @return Instance of the created server object. |
|
52 */ |
|
53 static CIAUpdateMainView* NewL(const TRect& aRect ); |
|
54 |
|
55 /** |
|
56 * Symbian two phased constructor. |
|
57 * @return Instance of the created server object. |
|
58 */ |
|
59 static CIAUpdateMainView* NewLC(const TRect& aRect ); |
|
60 |
|
61 /** |
|
62 * Destructor |
|
63 */ |
|
64 ~CIAUpdateMainView(); |
|
65 |
|
66 /** |
|
67 * Refresh the list |
|
68 * @param aNodes Array of nodes |
|
69 * @param aError Error code |
|
70 */ |
|
71 void RefreshL( const RPointerArray<MIAUpdateNode>& aNodes, |
|
72 const RPointerArray<MIAUpdateFwNode>& aFwNodes, |
|
73 TInt aError ); |
|
74 |
|
75 /** |
|
76 * Returns node that's highlighted in a list |
|
77 * @return Current (highlighted) node |
|
78 */ |
|
79 MIAUpdateAnyNode* GetCurrentNode(); |
|
80 |
|
81 /** |
|
82 * Returns node that's selected (marked) in a list |
|
83 * Can be used only when it's known that only one node is selected (marked) |
|
84 * @return selected (marked) node |
|
85 */ |
|
86 MIAUpdateAnyNode* GetSelectedNode(); |
|
87 |
|
88 |
|
89 private: // from CAknView |
|
90 |
|
91 /** |
|
92 * Returns views id, intended for overriding by sub classes. |
|
93 * @return id for this view. |
|
94 */ |
|
95 TUid Id() const; |
|
96 |
|
97 /** |
|
98 * Command handling function intended for overriding by sub classes. |
|
99 * Default implementation is empty. |
|
100 * @param aCommand ID of the command to respond to. |
|
101 */ |
|
102 void HandleCommandL( TInt aCommand ); |
|
103 |
|
104 /** |
|
105 * Dynamic menu initiation |
|
106 * Called by framework before menu is shown. |
|
107 * @param aResourceId Menu resource id. |
|
108 * @param aMenuPane Pointer to the menu. |
|
109 */ |
|
110 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
111 |
|
112 |
|
113 /** |
|
114 * Handles a view activation and passes the message of type |
|
115 * @c aCustomMessageId. This function is intended for overriding by |
|
116 * sub classes. This function is called by @c AknViewActivatedL(). |
|
117 * Views should not launch waiting or modal notes or dialogs in |
|
118 * @c DoActivateL. |
|
119 * @param aPrevViewId Specifies the view previously active. |
|
120 * @param aCustomMessageId Specifies the message type. |
|
121 * @param aCustomMessage The activation message. |
|
122 */ |
|
123 void DoActivateL ( const TVwsViewId& aPrevViewId, |
|
124 TUid aCustomMessageId, |
|
125 const TDesC8& aCustomMessage ); |
|
126 |
|
127 /** |
|
128 * View deactivation function intended for overriding by sub classes. |
|
129 * This function is called by @c AknViewDeactivated(). |
|
130 */ |
|
131 void DoDeactivate(); |
|
132 |
|
133 private: // from MAknToolbarObserver |
|
134 |
|
135 /** |
|
136 * Should be used to set the properties of some toolbar components |
|
137 * before it is drawn. |
|
138 * @param aResourceId The resource ID for particular toolbar |
|
139 * @param aToolbar The toolbar object pointer |
|
140 */ |
|
141 void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar ); |
|
142 |
|
143 /** |
|
144 * Handles toolbar events for a certain toolbar item. |
|
145 * @param aCommand The command ID of some toolbar item. |
|
146 */ |
|
147 void OfferToolbarEventL( TInt aCommand ); |
|
148 |
|
149 private: // from MIAUpdateContainerObserver |
|
150 |
|
151 /** |
|
152 * Mark list item |
|
153 * @param aMark True if marking, False if unmarking |
|
154 * @param aIndex Index of the item |
|
155 * @return False value if marking/unmarking cancelled when dependencies/dependants not found |
|
156 */ |
|
157 TBool MarkListItemL( TBool aMark, TInt aIndex ); |
|
158 |
|
159 /** |
|
160 * Set text label to middle soft key |
|
161 * @param aVisible True value when MSK text is visible |
|
162 * @param aSelected True value when list item is selected( marked) |
|
163 */ |
|
164 void SetMiddleSKTextL( TBool aVisible, TBool aSelected ); |
|
165 |
|
166 private: // constructors |
|
167 |
|
168 /** |
|
169 * Constuctor |
|
170 * @param aRect Rectangular of the view |
|
171 */ |
|
172 void ConstructL(const TRect& aRect); |
|
173 |
|
174 /** |
|
175 * C++ constuctor |
|
176 */ |
|
177 CIAUpdateMainView(); |
|
178 |
|
179 private: // new methods |
|
180 /** |
|
181 * Get selected (marked) nodes in the list |
|
182 * @param aSelectedNodes Array of nodes |
|
183 */ |
|
184 void GetSelectedNodesL( RPointerArray<MIAUpdateAnyNode>& aSelectedNodes ) const; |
|
185 |
|
186 /** |
|
187 * Get mandatory nodes in the list |
|
188 * @param aMandNodes Array of nodes |
|
189 */ |
|
190 void GetMandatoryNodesL( RPointerArray<MIAUpdateAnyNode>& aMandNodes ) const; |
|
191 /** |
|
192 * Pass selected indices to the container |
|
193 */ |
|
194 void SetSelectedIndicesL(); |
|
195 |
|
196 /** |
|
197 * Get index of a node |
|
198 * |
|
199 * @param aNode Node |
|
200 * @return Index of the node |
|
201 */ |
|
202 TInt NodeIndex( const MIAUpdateAnyNode& aNode ) const; |
|
203 |
|
204 /** |
|
205 * Updates the status pane text |
|
206 */ |
|
207 void UpdateStatusPaneL(); |
|
208 |
|
209 /** |
|
210 * Updates selection information in navi pane |
|
211 */ |
|
212 void UpdateSelectionInfoInNaviPaneL(); |
|
213 |
|
214 /** |
|
215 * Removes selection info in navi pane |
|
216 */ |
|
217 void RemoveSelectionInfoInNaviPane(); |
|
218 |
|
219 /** |
|
220 * Shows dependencies found dialog |
|
221 * |
|
222 * @param aText Text shown in a dialog |
|
223 * @return True value if marking/unmarking accepted |
|
224 */ |
|
225 TBool ShowDependenciesFoundDialogL( TDesC& aText ) const; |
|
226 |
|
227 /** |
|
228 * Count of selected (marked) items |
|
229 * |
|
230 * @return Count of selected items |
|
231 */ |
|
232 TInt CountOfSelectedItems() const; |
|
233 |
|
234 void ShowUpdateCannotOmitDialogL() const; |
|
235 |
|
236 private: // Data |
|
237 |
|
238 CAknNavigationControlContainer* iNaviPane; //not owned |
|
239 |
|
240 CAknNavigationDecorator* iDecorator; |
|
241 |
|
242 CIAUpdateMainContainer* iContainer; |
|
243 |
|
244 RPointerArray<MIAUpdateAnyNode> iAllNodes; |
|
245 |
|
246 TBool iShowStatusDialogAgain; |
|
247 |
|
248 TInt iRefreshError; |
|
249 |
|
250 TInt iLastCommandId; |
|
251 |
|
252 CIAUpdateFWUpdateHandler* iFwUpdateHandler; |
|
253 |
|
254 TBool iIsDMSupported; |
|
255 |
|
256 }; |
|
257 |
|
258 |
|
259 #endif // IAUPDATEMAINVIEW_H |
|
260 |
|
261 // End of File |