1 /* |
|
2 * Copyright (c) 2008 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: View class for Events Management UI. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_EVTMGMTUISTARTUPVIEWAPPVIEW_H |
|
20 #define C_EVTMGMTUISTARTUPVIEWAPPVIEW_H |
|
21 |
|
22 // SYSTEM INCLUDES |
|
23 #include <aknview.h> |
|
24 #include <aknViewAppUi.h> |
|
25 #include <AknWaitNoteWrapper.h> // MAknBackgroundProcess |
|
26 |
|
27 #include "evtmgmtuiengine.h" |
|
28 #include "evtmgmtuicmdhdlr.h" |
|
29 |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CEvtMgmtUiStartupContainer; |
|
33 class CEvtMgmtUiLocSettingsLauncher; |
|
34 class CEvtMgmtUiModel; |
|
35 /** |
|
36 * Events Management UI Start-up view class. |
|
37 * |
|
38 * @lib evtmgmtui.exe |
|
39 * @since S60 v5.0 |
|
40 */ |
|
41 class CEvtMgmtUiStartupView : public CAknView, |
|
42 public MEvtMgmtUiEngineObserver, |
|
43 public MEvtMgmtUiCmdHdlr, |
|
44 public MAknBackgroundProcess |
|
45 { |
|
46 |
|
47 public: |
|
48 /** |
|
49 * Static Two phase constructor |
|
50 * |
|
51 * @return CEvtMgmtUiStartupView*, Pointer to the newly created object. |
|
52 */ |
|
53 static CEvtMgmtUiStartupView* NewL(); |
|
54 |
|
55 /** |
|
56 * C++ Destructor. |
|
57 */ |
|
58 virtual ~CEvtMgmtUiStartupView(); |
|
59 |
|
60 private://new functions |
|
61 /** |
|
62 * It will update view |
|
63 */ |
|
64 void UpdateViewL(); |
|
65 |
|
66 /** |
|
67 * It will delete event from database |
|
68 */ |
|
69 void DeleteEventL(); |
|
70 |
|
71 /** |
|
72 * It shows confirmation query dialog |
|
73 */ |
|
74 TBool DisplayConfirmationQueryDlgL( const TDesC& aMsg ); |
|
75 /** |
|
76 * Change status of the event |
|
77 * param[in] aStatus - value to which event status should be changed |
|
78 */ |
|
79 void ChangeEventStatusL(TEvtEventStatus aStatus); |
|
80 |
|
81 /** |
|
82 * Show all events with given status |
|
83 * param[in] aStatusFilter - status filter to display events |
|
84 */ |
|
85 void ShowEventsL( CEvtMgmtUiEngine::TEvtEventStatusFilter aStatusFilter ); |
|
86 |
|
87 /** |
|
88 * It will handle 'show on map' command. |
|
89 */ |
|
90 void HandleShowOnMapCommandL(); |
|
91 |
|
92 /** |
|
93 * It will handle 'navigate to place' command. |
|
94 */ |
|
95 void HandleNavigateToPlaceCommandL(); |
|
96 |
|
97 public: // Inherited from Base classes |
|
98 /** |
|
99 * Inherited from CAknView |
|
100 */ |
|
101 void DoActivateL( const TVwsViewId& aPrevViewId, |
|
102 TUid aCustomMessageId, |
|
103 const TDesC8& aCustomMessage ); |
|
104 |
|
105 /** |
|
106 * Inherited from CAknView |
|
107 */ |
|
108 void DoDeactivate(); |
|
109 |
|
110 /** |
|
111 * Inherited from CAknView |
|
112 */ |
|
113 TUid Id() const; |
|
114 |
|
115 /** |
|
116 * Inherited from CAknView |
|
117 */ |
|
118 void HandleCommandL( TInt aCommand ); |
|
119 |
|
120 /** |
|
121 * Inherited from CAknView |
|
122 */ |
|
123 void DynInitMenuPaneL( TInt aResourceId, |
|
124 CEikMenuPane* aMenuPane ); |
|
125 |
|
126 /** |
|
127 * Inherited from MEvtMgmtUiEngineObserver |
|
128 */ |
|
129 void NotifyEventChangeL(TInt aErrorCode, TInt aState ); |
|
130 |
|
131 /** |
|
132 * Inherited from MEvtMgmtUiEngineObserver |
|
133 */ |
|
134 void NotifyModelChangeL(); |
|
135 |
|
136 /** |
|
137 * Inherited from MEvtMgmtUiCmdHdlr |
|
138 */ |
|
139 void HandleCmdL( TEvtMgmtUiCmd aCommand ); |
|
140 |
|
141 private: |
|
142 /** |
|
143 * Overloaded C++ Contructor. |
|
144 */ |
|
145 CEvtMgmtUiStartupView(); |
|
146 |
|
147 /** |
|
148 * Second phase of the two phase constructor. |
|
149 */ |
|
150 void ConstructL(); |
|
151 |
|
152 /** |
|
153 * Handles the visbility of the S60 Help feature. |
|
154 * |
|
155 * @param aMenuPane, Menu pane object on which the Help feature must |
|
156 * be evaluated. |
|
157 */ |
|
158 void HandleHelpFeature( CEikMenuPane& aMenuPane ) const; |
|
159 |
|
160 /** |
|
161 * To change the CBA |
|
162 */ |
|
163 void SetCba( TInt aResourceId ); |
|
164 |
|
165 /** |
|
166 * It will return the event-id of the selected item. |
|
167 */ |
|
168 TEvtEventId EventIdOfCurrentItem(); |
|
169 |
|
170 /** |
|
171 * It will return the event id of event. |
|
172 */ |
|
173 TEvtEventId EventId( TInt aIndex ); |
|
174 |
|
175 /* |
|
176 * It will return type of marked events |
|
177 */ |
|
178 TInt MarkedEventsStatus(); |
|
179 |
|
180 /* |
|
181 * It will start wait dialog. |
|
182 */ |
|
183 void StartWaitDialogL(); |
|
184 |
|
185 /* |
|
186 * Check wether map functionality can be enabled. |
|
187 * ret ETrue if map functionality should be enabled else EFalse |
|
188 */ |
|
189 TBool EnableMapFunctionalityL( ); |
|
190 |
|
191 private: // from MAknBackgroundProcess |
|
192 /** |
|
193 * Called by the wait note wrapper when the note is dismissed. |
|
194 * This is as a result of either the user cancelling the note, |
|
195 * or the process finishing. |
|
196 */ |
|
197 void DialogDismissedL(TInt /*aButtonId*/); |
|
198 |
|
199 /** |
|
200 * Called by the wait note wrapper following StepL. Unless the user has cancelled the note, |
|
201 * if this returns EFalse, it will call StepL again, otherwise, it will call ProcessFinished. |
|
202 * @return ETrue if processing is complete, EFalse otherwise |
|
203 */ |
|
204 TBool IsProcessDone() const; |
|
205 |
|
206 /** |
|
207 * Called by the wait note wrapper if the process is complete or if the user cancelled the note. |
|
208 * Completes the game save and resets the steps completed counter. |
|
209 */ |
|
210 void ProcessFinished(); |
|
211 |
|
212 /** |
|
213 * Called by the wait note wrapper if the processing is not yet complete. |
|
214 * Completes a step in the processing, by saving part of the game to a file, and incrementing the |
|
215 * number of steps completed. This is a synchronous method. |
|
216 */ |
|
217 void StepL(); |
|
218 |
|
219 /** |
|
220 * Handles error occurred in StepL |
|
221 * @param aError error code that occurred |
|
222 * @return translated error code. If this is != KErrNone process will be stopped. |
|
223 */ |
|
224 TInt CycleError(TInt aError); |
|
225 |
|
226 private: // Enumerations |
|
227 /** |
|
228 * Enumeration to Flag the Marked Event's Status. |
|
229 */ |
|
230 enum TMarkedEventsStatus |
|
231 { |
|
232 EMarkedEventsStatusActive, |
|
233 EMarkedEventsStatusDraft, |
|
234 EMarkedEventsStatusCompleted, |
|
235 EMarkedEventsStatusInvalid, |
|
236 EMarkedEventsStatusMix |
|
237 }; |
|
238 |
|
239 /** |
|
240 * Wait Dialog's States. |
|
241 */ |
|
242 enum TWaitDlgState |
|
243 { |
|
244 EWaitDlgLaunchToDelete, |
|
245 EWaitDlgLaunchToChangeStatus, |
|
246 EWaitDlgInitiateProcess, |
|
247 EWaitDlgDestroy |
|
248 }; |
|
249 |
|
250 private: // Data members |
|
251 /** |
|
252 * Events Management UI Start-up container. |
|
253 * Owns. |
|
254 */ |
|
255 CEvtMgmtUiStartupContainer* iContainer; |
|
256 |
|
257 /** |
|
258 * Model to perform all events (data only) manipulation |
|
259 */ |
|
260 CEvtMgmtUiEngine* iEngine; |
|
261 |
|
262 /* |
|
263 * Position Settings Launcher |
|
264 * Owns |
|
265 */ |
|
266 CEvtMgmtUiLocSettingsLauncher* iPosSetLauncher; |
|
267 |
|
268 /* |
|
269 * Boolean to maintain the application launch type |
|
270 */ |
|
271 TBool iIsEmbeddedApp; |
|
272 |
|
273 /* |
|
274 * Model |
|
275 * Owns |
|
276 */ |
|
277 CEvtMgmtUiModel* iModel; |
|
278 |
|
279 /* |
|
280 * List of events id to be deleted/updated |
|
281 * Owns |
|
282 */ |
|
283 RArray<TEvtEventId>* iEvtIdArray; |
|
284 |
|
285 /* |
|
286 * It is used as state-machine for wait dialog |
|
287 */ |
|
288 TInt iWaitState; |
|
289 |
|
290 /* |
|
291 * It stores event status .... used for 'change event status' |
|
292 */ |
|
293 TEvtEventStatus iEvtStatus; |
|
294 |
|
295 /* |
|
296 * It will determine if error note should be displayed |
|
297 * once 'Activate' operation is completed for multiple events |
|
298 * An error note is required when event doesnt contain mandatory fields. |
|
299 */ |
|
300 TBool iDisplayNote; |
|
301 }; |
|
302 |
|
303 #endif // C_EVTMGMTUISTARTUPVIEWAPPVIEW_H |
|
304 |
|