author | Pat Downey <patd@symbian.org> |
Wed, 01 Sep 2010 12:32:31 +0100 | |
branch | RCL_3 |
changeset 66 | bd7edf625bdd |
parent 65 | 12af337248b1 |
permissions | -rw-r--r-- |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
66 | 14 |
* Description: Controller class for deleting related UI behavior |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
66 | 19 |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#ifndef CALENDELETEUI_H |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#define CALENDELETEUI_H |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
|
66 | 23 |
// INCLUDES |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#include <e32base.h> |
66 | 25 |
#include <calcommon.h> |
26 |
#include <eikenv.h> |
|
27 |
#include <AknWaitDialog.h> |
|
28 |
#include <calprogresscallback.h> |
|
29 |
#include <calencommandhandler.h> |
|
30 |
#include <calennotificationhandler.h> |
|
31 |
#include <calenactionuiutils.h> |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
// FORWARD DECLARATIONS |
66 | 34 |
class CAknWaitDialog; |
35 |
class CCalenGlobalData; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
class CCalenController; |
66 | 37 |
class CCalInstanceView; |
38 |
class CCalInstance; |
|
39 |
class CCalEntry; |
|
40 |
class CCalEntryView; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
// CLASS DECLARATION |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
/** |
66 | 44 |
* CCalenDeleteUi encapsulates deleting related behavior |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
* in Calendar application. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
*/ |
66 | 47 |
NONSHARABLE_CLASS( CCalenDeleteUi ) : public CBase, |
48 |
public MCalProgressCallBack, |
|
49 |
public MCalenNotificationHandler, |
|
50 |
public MCalenCommandHandler, |
|
51 |
public MProgressDialogCallback |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
|
66 | 54 |
public: // public API |
55 |
||
56 |
/** |
|
57 |
* Symbian 1st phase constructor |
|
58 |
* @param aController Reference to CCalenController |
|
59 |
*/ |
|
60 |
static CCalenDeleteUi* NewL( CCalenController& aController ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
|
66 | 62 |
/** |
63 |
* Destructor |
|
64 |
*/ |
|
65 |
virtual ~CCalenDeleteUi(); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
|
66 | 67 |
public: // From MCalenCommandHandler |
68 |
||
69 |
/** |
|
70 |
* Handles key presses. |
|
71 |
* |
|
72 |
* @param aCommand The command Id of the key. |
|
73 |
*/ |
|
74 |
TBool HandleCommandL( const TCalenCommand& aCommand ); |
|
75 |
||
76 |
/** |
|
77 |
* Allows extending this API without breaking BC. |
|
78 |
* |
|
79 |
* @param aExtensionUid specifies |
|
80 |
* @return extension of the requested type |
|
81 |
*/ |
|
82 |
TAny* CalenCommandHandlerExtensionL( TUid aExtensionUid ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |
|
66 | 84 |
public: // New functions |
85 |
/** |
|
86 |
* UI sequence for deleting single entry. Shows UI queries and notes and |
|
87 |
* performs delete. Current entry is taken from Calendar Context |
|
88 |
*/ |
|
89 |
void DeleteCurrentEntryL(); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
|
66 | 91 |
/** |
92 |
* UI sequence for deleting all entries. Shows UI queries and notes and |
|
93 |
* performs delete asynchronosuly. |
|
94 |
*/ |
|
95 |
void DeleteAllEntriesL(); |
|
96 |
||
97 |
/** |
|
98 |
* UI sequence for deleting entries before given date. |
|
99 |
* Shows UI queries and notes and performs delete asynchronosuly. |
|
100 |
*/ |
|
101 |
void DeleteEntriesBeforeDateL(); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
102 |
|
66 | 103 |
/** |
104 |
* UI sequence for deleting series repeating entry |
|
105 |
* Becasue a ThisAndAll repeat type has already been chosen by user, |
|
106 |
* no repeat query is required. Performs delete asynchronosuly. |
|
107 |
*/ |
|
108 |
void DeleteThisOrAllL( CalCommon::TRecurrenceRange aRepeatType ); |
|
109 |
||
110 |
public: // from MCalenNotificationHandler |
|
111 |
/** |
|
112 |
* Handle notifications |
|
113 |
* @param aNotification Notification to be handled |
|
114 |
*/ |
|
115 |
void HandleNotification(const TCalenNotification aNotification ); |
|
116 |
||
117 |
private: // From MCalProgressCallBack |
|
118 |
/** |
|
119 |
* From MCalProgressCallBack |
|
120 |
*/ |
|
121 |
void Completed( TInt aError ); |
|
122 |
||
123 |
/** |
|
124 |
* From MCalProgressCallBack |
|
125 |
*/ |
|
126 |
TBool NotifyProgress(); |
|
127 |
||
128 |
/** |
|
129 |
* From MCalProgreeCallBack |
|
130 |
*/ |
|
131 |
void Progress( TInt aPercentageCompleted ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
132 |
|
66 | 133 |
private: // own methods |
134 |
/** |
|
135 |
* Handles deleting all entries in time range from aFirstDay to aLastDay. |
|
136 |
* Shows wait notification and given confirmation notifications. |
|
137 |
*/ |
|
138 |
void HandleDeleteMultipleEventsL( const TTime& aFirstDay, |
|
139 |
const TTime& aLastDay, |
|
140 |
TInt aConfNoteId ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
141 |
|
66 | 142 |
/** |
143 |
* Delete entries from given range |
|
144 |
*/ |
|
145 |
void DeleteDayRangeL( const TTime& aStart, const TTime& aEnd ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
146 |
|
66 | 147 |
/** |
148 |
* Delete entries than end at given midnight. |
|
149 |
* This is needed when deleting multiple entries, to handle |
|
150 |
* e.g all-day notes that extends to next day's midnight. |
|
151 |
*/ |
|
152 |
void DeleteEntriesEndingAtMidnightL( TTime aMidnight ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
153 |
|
66 | 154 |
/** |
155 |
* just a wrapper for leave |
|
156 |
*/ |
|
157 |
void DoCompletedL( TInt aFirstPassError ); |
|
158 |
||
159 |
/** |
|
160 |
* Delete entry by passing CCalEntryView and CCalEntry |
|
161 |
* Will query user for confirmation before deletion |
|
162 |
* @return ETrue user confirms to delete EFalse otherwise |
|
163 |
*/ |
|
164 |
TBool DeleteEntryL( CCalEntryView* aEntryView, CCalEntry* aEntry ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |
|
66 | 166 |
/** |
167 |
* Delete entry without querying the user |
|
168 |
*/ |
|
169 |
TBool DeleteEntryWithoutQueryL(); |
|
170 |
||
171 |
/** |
|
172 |
* Delete the given entry. Ask the user whether to delete the |
|
173 |
* instance or the entire series. |
|
174 |
*/ |
|
175 |
TBool DeleteSingleInstanceL( CCalInstance* aInstance ); |
|
176 |
||
177 |
/** |
|
178 |
* Delete the given entry, using aRepeatType to determine |
|
179 |
* whether to delete the instance or the entire series. |
|
180 |
*/ |
|
181 |
TBool DeleteSingleInstanceL( CCalInstance* aInstance, |
|
182 |
CalCommon::TRecurrenceRange aRepeatType ); |
|
183 |
||
184 |
/** |
|
185 |
* Show the confirmation query with confirmation type and number of entries this query is for |
|
186 |
* @param aType Type of query: EDeleteEntry/ EDeleteTodo/ EDeleteTodos/ EDeleteAll |
|
187 |
*/ |
|
188 |
TInt ShowDeleteConfirmationQueryL( const CalenActionUiUtils::TDeleteConfirmationType aType, |
|
189 |
const TInt aCount=0 ); |
|
190 |
||
191 |
/** |
|
192 |
* Delete single instance. |
|
193 |
* @param aInstance Pointer to the instance to be deleted |
|
194 |
* @param aHasRepeatType Whether or not the instance is repeating |
|
195 |
* @param aRepeatType Repeat type choosen to apply on delete |
|
196 |
* @return ETrue is user confirms to delete, EFalse otherwise |
|
197 |
*/ |
|
198 |
TBool DoDeleteSingleInstanceL( CCalInstance* aInstance, |
|
199 |
TBool aHasRepeatType, |
|
200 |
CalCommon::TRecurrenceRange aRepeatType ); |
|
201 |
||
202 |
/** |
|
203 |
* Attempt to delete the instance using the Meeting Request utilities, |
|
204 |
* if MR viewers is enabled. |
|
205 |
* @param aInstance Pointer to the instance to be delete |
|
206 |
* @param aRepeatType Repeat Type choosen to apply on delete |
|
207 |
* @return ETrue if user confirms to delete, EFalse otherwise |
|
208 |
*/ |
|
209 |
TBool TryDeleteWithMrUtilsL( CCalInstance* aInstance, |
|
210 |
CalCommon::TRecurrenceRange aRepeatType ); |
|
211 |
||
212 |
/** |
|
213 |
* Leaving function, handle ECalenNotifyViewCreated |
|
214 |
*/ |
|
215 |
void HandleECalenNotifyViewCreatedL(); |
|
216 |
||
217 |
/** |
|
218 |
* Multiple entries delete query |
|
219 |
*/ |
|
220 |
TInt ShowMultipleEntriesDeleteQueryL(TInt aCount); |
|
221 |
||
222 |
private: // own methods |
|
223 |
/** |
|
224 |
* C++ constructor |
|
225 |
*/ |
|
226 |
CCalenDeleteUi( CCalenController& aController ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
227 |
|
66 | 228 |
/** |
229 |
* Symbian 2nd phase constructor |
|
230 |
*/ |
|
231 |
void ConstructL(); |
|
232 |
||
233 |
protected: // Methods derived from MProgressDialogCallback |
|
234 |
/** |
|
235 |
* From MProgressDialogCallback |
|
236 |
* Callback method |
|
237 |
* called when a dialog is dismissed |
|
238 |
*/ |
|
239 |
void DialogDismissedL( const TInt aButtonId ); |
|
240 |
||
241 |
private: |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
242 |
|
66 | 243 |
/** |
244 |
* Delete entry using entry local uid |
|
245 |
*/ |
|
246 |
void DeleteEntryL(TCalLocalUid& aEntryLocalUid, TInt aColId ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
247 |
|
66 | 248 |
/** |
249 |
* Displays wait dialog while deleting marked entries |
|
250 |
*/ |
|
251 |
void DisplayWaitDialogL(); |
|
252 |
||
253 |
/** |
|
254 |
* Dismiss wait dialog and show information note |
|
255 |
*/ |
|
256 |
void MarkedEntriesDeletedL(); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
257 |
|
66 | 258 |
/** |
259 |
* Handles launching of the delete entries list query |
|
260 |
*/ |
|
261 |
void HandleDeleteAllEntriesL(); |
|
262 |
||
263 |
private: // data |
|
264 |
||
265 |
CEikonEnv* iEikEnv; |
|
266 |
CAknWaitDialog* iWaitDialog; |
|
267 |
||
268 |
TBool iIsDeleting; // True, if asynchronous delete is running |
|
269 |
TTime iStartTime; |
|
270 |
TTime iEndTime; |
|
271 |
// Confirmation note id is stored here. Note is shown when asynchronous |
|
272 |
// delete completes. |
|
273 |
TInt iConfirmationNoteId; |
|
274 |
CCalenGlobalData* iGlobalData; |
|
275 |
CCalenController& iController; |
|
276 |
||
277 |
// Stored command if the entry view |
|
278 |
// needs to constructed asyncronously |
|
279 |
TCalenCommand iStoredCommand; |
|
280 |
TInt iMutlipleContextIdsCount; |
|
281 |
TBool iMoreEntriesToDelete; |
|
282 |
TBool iDisplayQuery; |
|
283 |
TInt iEntriesToDelete; |
|
284 |
TInt iToShowDeleteNote; |
|
285 |
TInt iNumberOfCalendars; |
|
286 |
||
287 |
RArray<TInt> iDeleteColIds; |
|
288 |
CalCommon::TCalTimeRange *iDelAllRange; |
|
289 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
290 |
}; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
291 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
292 |
#endif // CALENDELETEUI_H |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
293 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
294 |
// End of File |