79
|
1 |
/*
|
|
2 |
* Copyright (c) 2002 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:
|
|
15 |
* List container user by message view.
|
|
16 |
* Derived from CMceListContainer.
|
|
17 |
*
|
|
18 |
*/
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
#ifndef MCEMESSAGELISTCONTAINER_H
|
|
23 |
#define MCEMESSAGELISTCONTAINER_H
|
|
24 |
|
|
25 |
// INCLUDES
|
|
26 |
#include <coecntrl.h> // CCoeControl
|
|
27 |
#include <msvapi.h>
|
|
28 |
//#include "MceListContainer.h"
|
|
29 |
#include "MceMessageListContainerBase.h"
|
|
30 |
#include "MceMessageListContTimer.h"
|
|
31 |
|
|
32 |
#include "mcetemplate.h"
|
|
33 |
#include "MceUtils.h"
|
|
34 |
#include "MceListItem.h"
|
|
35 |
#include <centralrepository.h> //CRepository
|
|
36 |
#include <bldvariant.hrh>
|
|
37 |
#include <eikcmobs.h>
|
|
38 |
#include <e32property.h>
|
|
39 |
|
|
40 |
// FORWARD DECLARATIONS
|
|
41 |
class CMceMessageListView;
|
|
42 |
class CPtiEngine;
|
|
43 |
class CMcePropertySubscriber;
|
|
44 |
class CMsvSession;
|
|
45 |
class CMceBitmapResolver;
|
|
46 |
class CMceMessageListItemArray;
|
|
47 |
class CMceMessageListBox;
|
|
48 |
class MEikListBoxObserver;
|
|
49 |
|
|
50 |
//CONSTS
|
|
51 |
const TInt KMceSelectionReplacementSize = 5;
|
|
52 |
|
|
53 |
|
|
54 |
// CLASS DECLARATION
|
|
55 |
|
|
56 |
/**
|
|
57 |
* List container user by message view.
|
|
58 |
* Derived from CMceListContainer.
|
|
59 |
*/
|
|
60 |
class CMceMessageListContainer :
|
|
61 |
public CMceMessageListContainerBase
|
|
62 |
// public CCoeControl,
|
|
63 |
// public MEikCommandObserver
|
|
64 |
{
|
|
65 |
public: // Constructors and destructor
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Two-phased constructor.
|
|
69 |
*/
|
|
70 |
static CMceMessageListContainer* NewL(
|
|
71 |
const TRect& aRect,
|
|
72 |
CMsvSessionPtr aSession,
|
|
73 |
TMsvId aFolderId,
|
|
74 |
CMceBitmapResolver& aBitmapResolver,
|
|
75 |
CMceMessageListView& aParentView );
|
|
76 |
|
|
77 |
/**
|
|
78 |
* Destructor.
|
|
79 |
*/
|
|
80 |
virtual ~CMceMessageListContainer();
|
|
81 |
|
|
82 |
public:
|
|
83 |
|
|
84 |
/**
|
|
85 |
* Returns list index of the current item
|
|
86 |
* @return Index of the current item
|
|
87 |
*/
|
|
88 |
TInt CurrentItemIndex() const;
|
|
89 |
|
|
90 |
/**
|
|
91 |
* Returns mce's info of the current message
|
|
92 |
* @return info
|
|
93 |
*/
|
|
94 |
TMceListItem CurrentItemListItem() const;
|
|
95 |
|
|
96 |
/**
|
|
97 |
* Tries to find item from the currently opened list and retuns
|
|
98 |
* list index if found. KErrNotFound if not found.
|
|
99 |
* @param aId: item id to be searched
|
|
100 |
* @return List index of the item.
|
|
101 |
*/
|
|
102 |
TInt ItemIndex( TMsvId aId ) const;
|
|
103 |
|
|
104 |
/**
|
|
105 |
* Sets MSK label according to a focused item
|
|
106 |
* Since 3.2
|
|
107 |
*/
|
|
108 |
void SetMskL();
|
|
109 |
|
|
110 |
/**
|
|
111 |
* Is Outbox open?
|
|
112 |
*/
|
|
113 |
TBool IsOutboxOpened() const;
|
|
114 |
|
|
115 |
/**
|
|
116 |
* Returns ETrue if Syncml outbox opened
|
|
117 |
*/
|
|
118 |
TBool SyncMlOutboxOpened() const;
|
|
119 |
|
|
120 |
|
|
121 |
public: // Functions from base classes
|
|
122 |
|
|
123 |
/**
|
|
124 |
* From CMceMessageListContainerBase
|
|
125 |
*/
|
|
126 |
virtual TInt MceListId() const;
|
|
127 |
|
|
128 |
/**
|
|
129 |
* From CMceMessageListContainerBase
|
|
130 |
*/
|
|
131 |
virtual TInt Count() const;
|
|
132 |
|
|
133 |
/**
|
|
134 |
* From CMceMessageListContainerBase
|
|
135 |
*/
|
|
136 |
virtual TInt MessageCount() const;
|
|
137 |
|
|
138 |
/**
|
|
139 |
* From CMceMessageListContainerBase
|
|
140 |
*/
|
|
141 |
virtual TInt FolderCount() const;
|
|
142 |
|
|
143 |
/**
|
|
144 |
* From CMceMessageListContainerBase
|
|
145 |
*/
|
|
146 |
virtual TBool SetCurrentItemIdL( TMsvId aEntryId );
|
|
147 |
|
|
148 |
/**
|
|
149 |
* From CMceMessageListContainerBase
|
|
150 |
*/
|
|
151 |
virtual void ResetCurrentItemL();
|
|
152 |
|
|
153 |
/**
|
|
154 |
* From CMceMessageListContainerBase
|
|
155 |
*/
|
|
156 |
TMsvId FindEntry( const TDesC& aMatchString ) const;
|
|
157 |
|
|
158 |
/**
|
|
159 |
* From CMceMessageListContainerBase
|
|
160 |
*/
|
|
161 |
virtual void ItemCountChangedL( TBool aItemsAdded,
|
|
162 |
CArrayFix<TInt>* aAddedIndexes = 0 );
|
|
163 |
|
|
164 |
/**
|
|
165 |
* From CMceMessageListContainerBase
|
|
166 |
*/
|
|
167 |
virtual void RefreshListbox();
|
|
168 |
|
|
169 |
/**
|
|
170 |
* From CMceMessageListContainerBase
|
|
171 |
*/
|
|
172 |
virtual void SetSortTypeL( TInt aSortType, TBool aOrdering );
|
|
173 |
|
|
174 |
/**
|
|
175 |
* From CMceMessageListContainerBase
|
|
176 |
*/
|
|
177 |
virtual void SetMtmUiDataRegistry( MMtmUiDataRegistryObserver* aRegistryObserver );
|
|
178 |
|
|
179 |
/**
|
|
180 |
* From CMceMessageListContainerBase
|
|
181 |
*/
|
|
182 |
virtual TBool FindFirstUnreadMessageL( TMsvId& aEntryId ) const;
|
|
183 |
|
|
184 |
/**
|
|
185 |
* From CMceMessageListContainerBase
|
|
186 |
*/
|
|
187 |
virtual TMessageListItemType CurrentItemType() const;
|
|
188 |
|
|
189 |
/**
|
|
190 |
* From CMceMessageListContainerBase
|
|
191 |
*/
|
|
192 |
void SetFolderL( TMsvId aFolderId );
|
|
193 |
|
|
194 |
/**
|
|
195 |
* From CMceMessageListContainerBase
|
|
196 |
*/
|
|
197 |
TMsvId CurrentFolderId() const;
|
|
198 |
|
|
199 |
/**
|
|
200 |
* From CMceMessageListContainerBase
|
|
201 |
*/
|
|
202 |
const TMsvEntry& FolderEntry() const;
|
|
203 |
|
|
204 |
/**
|
|
205 |
* From CMceMessageListContainerBase
|
|
206 |
*/
|
|
207 |
TMsvId CurrentItemId() const;
|
|
208 |
|
|
209 |
/**
|
|
210 |
* From CMceMessageListContainerBase
|
|
211 |
*/
|
|
212 |
CMsvEntrySelection* CurrentItemSelectionL();
|
|
213 |
|
|
214 |
/**
|
|
215 |
* From CMceMessageListContainerBase
|
|
216 |
*/
|
|
217 |
CMsvEntrySelection* CurrentItemSelectionRefreshL();
|
|
218 |
|
|
219 |
/**
|
|
220 |
* From CMceMessageListContainerBase
|
|
221 |
*/
|
|
222 |
TInt CurrentItemSelectionCount() const;
|
|
223 |
|
|
224 |
/**
|
|
225 |
* From CMceMessageListContainerBase
|
|
226 |
*/
|
|
227 |
TInt SelectionCount() const;
|
|
228 |
|
|
229 |
/**
|
|
230 |
* From CMceMessageListContainerBase
|
|
231 |
*/
|
|
232 |
virtual TBool IsItemSelected( TMsvId aItemId );
|
|
233 |
|
|
234 |
/**
|
|
235 |
* From CMceMessageListContainerBase
|
|
236 |
*/
|
|
237 |
void ClearSelection();
|
|
238 |
|
|
239 |
/**
|
|
240 |
* From CMceMessageListContainerBase
|
|
241 |
*/
|
|
242 |
void MarkItemSelectionL();
|
|
243 |
|
|
244 |
/**
|
|
245 |
* From CMceMessageListContainerBase
|
|
246 |
*/
|
|
247 |
void AddCurrentItemToSelectionL();
|
|
248 |
|
|
249 |
/**
|
|
250 |
* From CMceMessageListContainerBase
|
|
251 |
*/
|
|
252 |
void RemoveCurrentItemFromSelection();
|
|
253 |
|
|
254 |
/**
|
|
255 |
* From CMceMessageListContainerBase
|
|
256 |
* Updates selection indexes by reading selected message's TMsvIds from iSelectedEntries
|
|
257 |
* and creates new CSelectionIndexArray.
|
|
258 |
* @param aForceUpdate: set ETrue if index update is wanted to be done even when
|
|
259 |
* listbox's selection does not include any items.
|
|
260 |
* Usually this is set true only when calling from CMceBaseListView::HandleEntriesDeletedL
|
|
261 |
*/
|
|
262 |
void RefreshSelectionIndexesL( TBool aForceUpdate = EFalse );
|
|
263 |
|
|
264 |
/**
|
|
265 |
* From CMceMessageListContainerBase
|
|
266 |
*/
|
|
267 |
void AddAllToSelectionL();
|
|
268 |
|
|
269 |
/**
|
|
270 |
* From CMceMessageListContainerBase
|
|
271 |
*/
|
|
272 |
void MarkAllReadMessagesL();
|
|
273 |
|
|
274 |
/**
|
|
275 |
* From CMceMessageListContainerBase
|
|
276 |
*/
|
|
277 |
TInt MarkedItemsCount();
|
|
278 |
|
|
279 |
/**
|
|
280 |
* From CMceMessageListContainerBase
|
|
281 |
*/
|
|
282 |
TBool IsCurrentItemFolder() const;
|
|
283 |
|
|
284 |
/**
|
|
285 |
* From CMceMessageListContainerBase
|
|
286 |
*/
|
|
287 |
TBool IsItemFolder( TMsvId aItemId ) const;
|
|
288 |
|
|
289 |
/**
|
|
290 |
* From CMceMessageListContainerBase
|
|
291 |
*/
|
|
292 |
TBool IsItemRemote( TMsvId aItemId ) const;
|
|
293 |
|
|
294 |
/**
|
|
295 |
* Checks is item folder.
|
|
296 |
* @param aIndex index of the item to be checked.
|
|
297 |
* @return ETrue if item is folder.
|
|
298 |
*/
|
|
299 |
TBool IsItemFolder(TInt aIndex) const;
|
|
300 |
|
|
301 |
/**
|
|
302 |
* From CMceMessageListContainerBase
|
|
303 |
*/
|
|
304 |
TBool IsOpenedFolder( TMsvId aFolderId ) const;
|
|
305 |
|
|
306 |
/**
|
|
307 |
* From CMceMessageListContainerBase
|
|
308 |
*/
|
|
309 |
void SetListEmptyTextL(const TDesC& aText);
|
|
310 |
|
|
311 |
/**
|
|
312 |
* From CMceMessageListContainerBase
|
|
313 |
*/
|
|
314 |
void SetAnchorItemIdL(
|
|
315 |
TMessageListOperationType aOperationType );
|
|
316 |
|
|
317 |
/**
|
|
318 |
* From CMceMessageListContainerBase
|
|
319 |
*/
|
|
320 |
void HandleMsvSessionEventL(
|
|
321 |
MMsvSessionObserver::TMsvSessionEvent aEvent,
|
|
322 |
CMsvEntrySelection& aSelection,
|
|
323 |
TBool aDraw );
|
|
324 |
|
|
325 |
/**
|
|
326 |
* From CMceMessageListContainerBase
|
|
327 |
*/
|
|
328 |
TBool DisplayOptionsMenuFromSelectionKey() const;
|
|
329 |
|
|
330 |
/**
|
|
331 |
* From CMceMessageListContainerBase
|
|
332 |
*/
|
|
333 |
TUint OptionsCommandSupported() const;
|
|
334 |
|
|
335 |
/**
|
|
336 |
* From CMceMessageListContainerBase
|
|
337 |
*/
|
|
338 |
void HandleOptionsCommandL( TInt aCommand );
|
|
339 |
|
|
340 |
/**
|
|
341 |
* From CMceMessageListContainerBase
|
|
342 |
*/
|
|
343 |
void DateTimeFormatChangedL( TInt aChangeFlag );
|
|
344 |
|
|
345 |
/**
|
|
346 |
* From CMceMessageListContainerBase
|
|
347 |
*/
|
|
348 |
TInt SetSpecialMskL();
|
|
349 |
|
|
350 |
/**
|
|
351 |
* From CMceMessageListContainerBase
|
|
352 |
*/
|
|
353 |
void UpdateIconArrayL();
|
|
354 |
|
|
355 |
/**
|
|
356 |
* From CCoeControl
|
|
357 |
*/
|
|
358 |
void GetHelpContext(TCoeHelpContext& aContext) const;
|
|
359 |
|
|
360 |
/**
|
|
361 |
* From CMceMessageListContainerBase
|
|
362 |
*/
|
|
363 |
void SetContainerFlag( TMceContainerFlags aFlag, TBool aState );
|
|
364 |
|
|
365 |
/**
|
|
366 |
* From CMceMessageListContainerBase
|
|
367 |
*/
|
|
368 |
void SetMarkingModeOff();
|
|
369 |
|
|
370 |
public: // Functions from base classes
|
|
371 |
|
|
372 |
/**
|
|
373 |
* From CCoeControl
|
|
374 |
*/
|
|
375 |
virtual TKeyResponse OfferKeyEventL(
|
|
376 |
const TKeyEvent& aKeyEvent,
|
|
377 |
TEventCode aType);
|
|
378 |
|
|
379 |
|
|
380 |
/**
|
|
381 |
* From CCoeControl
|
|
382 |
*/
|
|
383 |
void SizeChanged();
|
|
384 |
|
|
385 |
/**
|
|
386 |
* From
|
|
387 |
*/
|
|
388 |
void HandleResourceChange( TInt aType );
|
|
389 |
|
|
390 |
/**
|
|
391 |
* From MEikCommandObserver
|
|
392 |
*/
|
|
393 |
virtual void ProcessCommandL(TInt aCommand);
|
|
394 |
|
|
395 |
/**
|
|
396 |
* From CCoeControl.
|
|
397 |
* Handles pointer events.
|
|
398 |
* @param aPointerEvent The pointer event.
|
|
399 |
*/
|
|
400 |
virtual void HandlePointerEventL( const TPointerEvent& aPointerEvent );
|
|
401 |
|
|
402 |
/**
|
|
403 |
* From CCoeControl
|
|
404 |
*/
|
|
405 |
TInt CountComponentControls() const;
|
|
406 |
|
|
407 |
/**
|
|
408 |
* From CCoeControl
|
|
409 |
*/
|
|
410 |
CCoeControl* ComponentControl(TInt aIndex) const;
|
|
411 |
|
|
412 |
|
|
413 |
protected: // Functions from base classes
|
|
414 |
|
|
415 |
/**
|
|
416 |
* From CMceListContainer
|
|
417 |
*/
|
|
418 |
// virtual CEikTextListBox* CreateListBoxL( );
|
|
419 |
|
|
420 |
// From CCoeControl
|
|
421 |
void FocusChanged(TDrawNow aDrawNow);
|
|
422 |
|
|
423 |
private:
|
|
424 |
|
|
425 |
/**
|
|
426 |
* Symbian OS constructor.
|
|
427 |
*/
|
|
428 |
void ConstructL(
|
|
429 |
const TRect& aRect,
|
|
430 |
CMsvSessionPtr aSession,
|
|
431 |
CMceBitmapResolver& aBitmapResolver,
|
|
432 |
TMsvId aFolderId );
|
|
433 |
|
|
434 |
/**
|
|
435 |
* Constructor is private.
|
|
436 |
*/
|
|
437 |
CMceMessageListContainer(
|
|
438 |
CMceMessageListView& aParentView );
|
|
439 |
|
|
440 |
|
|
441 |
/**
|
|
442 |
* Function that check if a key can be search
|
|
443 |
* @param aPointerEvent The pointer event
|
|
444 |
* @return ETrue if it can
|
|
445 |
* since 3.2
|
|
446 |
*/
|
|
447 |
TBool IsValidSearchKey(const TKeyEvent& aKeyEvent);
|
|
448 |
|
|
449 |
/**
|
|
450 |
* Handles a change in qwerty input mode setting.
|
|
451 |
* @return KErrNone if ok.
|
|
452 |
*/
|
|
453 |
TInt HandleQwertyModeChangeNotification();
|
|
454 |
|
|
455 |
/**
|
|
456 |
* Handles a change in qwerty input mode setting.
|
|
457 |
* @return KErrNone if ok.
|
|
458 |
*/
|
|
459 |
static TInt QwertyModeChangeNotification( TAny* aObj );
|
|
460 |
|
|
461 |
|
|
462 |
/**
|
|
463 |
* Adds item to iSelectedEntries
|
|
464 |
* @param aEntryId: id of the entry to be added.
|
|
465 |
*/
|
|
466 |
void AddItemToSelectionL( TMsvId aEntryId );
|
|
467 |
|
|
468 |
/**
|
|
469 |
* Removes item from iSelectedEntries
|
|
470 |
* @param aEntryId: id of the entry to be removed.
|
|
471 |
*/
|
|
472 |
void RemoveItemFromSelection( TMsvId aEntryId );
|
|
473 |
|
|
474 |
/**
|
|
475 |
* Handles focus when operation is completed.
|
|
476 |
* This is called by SetAnchorItemIdL when it gets
|
|
477 |
* EMessageListOperationCompleted.
|
|
478 |
*/
|
|
479 |
void HandleOperationCompletedL();
|
|
480 |
|
|
481 |
/**
|
|
482 |
* Handles shortcut for search
|
|
483 |
* Since 5.0
|
|
484 |
*/
|
|
485 |
void HandleShortcutForSearchL( const TKeyEvent& aKeyEvent );
|
|
486 |
|
|
487 |
/*
|
|
488 |
* Function that check if * key can change msglist state
|
|
489 |
* @return ETrue if it can
|
|
490 |
* Since 5.0
|
|
491 |
*/
|
|
492 |
TBool StateCanBeChangedByStarKeyL() const;
|
|
493 |
|
|
494 |
/*
|
|
495 |
* Check if * key has been handled
|
|
496 |
* @return ETrue if it's handled
|
|
497 |
* Since 5.0
|
|
498 |
*/
|
|
499 |
TBool HasHandleStarKeyDoneL();
|
|
500 |
|
|
501 |
/*
|
|
502 |
* mark item read/unread
|
|
503 |
* Since 5.0
|
|
504 |
*/
|
|
505 |
void MarkReadUnreadWithStarKeyL();
|
|
506 |
/*
|
|
507 |
* Check if message list is sort by date
|
|
508 |
* @return ETrue if it is
|
|
509 |
* Since 5.0
|
|
510 |
*/
|
|
511 |
TBool IsSortByDate();
|
|
512 |
|
|
513 |
|
|
514 |
|
|
515 |
private:
|
|
516 |
CMceMessageListBox* iListBox;
|
|
517 |
CMceMessageListItemArray* iListItems;
|
|
518 |
// TMceListType iListType;
|
|
519 |
CMsvEntrySelection* iSelectedEntries;
|
|
520 |
TMsvId iAnchorItemId;
|
|
521 |
TInt iAnchorItemIndex;
|
|
522 |
|
|
523 |
TInt iCurrMskResource;
|
|
524 |
|
|
525 |
// CMceMessageListView& iOwningView;
|
|
526 |
CPtiEngine* iT9Interface;
|
|
527 |
CMceMessageListContainerKeyTimer* iT9Timer;
|
|
528 |
|
|
529 |
CMcePropertySubscriber* iQwertyModeStatusSubscriber;
|
|
530 |
RProperty iQwertyModeStatusProperty;
|
|
531 |
TBool iPreviousInputMethod;
|
|
532 |
TBool iInputMethodQwerty;
|
|
533 |
|
|
534 |
TMessageListOperationType iLastOperationType;
|
|
535 |
TBool iDialerEvent ;
|
|
536 |
|
|
537 |
CMsvEntrySelection* iAddedMsvIds;
|
|
538 |
|
|
539 |
};
|
|
540 |
|
|
541 |
#endif
|
|
542 |
|
|
543 |
// End of file
|