author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:27:34 +0300 | |
branch | RCL_3 |
changeset 77 | da6ac9d688df |
parent 71 | 17302fa075e1 |
permissions | -rw-r--r-- |
60 | 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 CMceMessageListContainer. |
|
17 |
* |
|
18 |
*/ |
|
19 |
||
20 |
||
21 |
||
22 |
// INCLUDE FILES |
|
23 |
||
24 |
#include "mceui.h" |
|
25 |
#include "MceMessageListContainer.h" |
|
26 |
#include "MceMessageListbox.h" |
|
27 |
#include "MceMessageListView.h" |
|
28 |
#include "MceMessageListItemArray.h" |
|
29 |
#include "MceBitmapResolver.h" |
|
30 |
#include "MceCommands.hrh" |
|
31 |
#include "MceIds.hrh" |
|
32 |
#include <mce.rsg> |
|
33 |
#include "McePropertySubscriber.h" |
|
34 |
#include <PtiEngine.h> |
|
35 |
#include <AvkonInternalCRKeys.h> // KCRUidAvkon |
|
36 |
||
37 |
#include <msvids.h> |
|
38 |
#include <msvuids.h> // KUidMsvMessageEntry |
|
39 |
||
40 |
#include <bldvariant.hrh> |
|
41 |
||
42 |
#include <csxhelp/mce.hlp.hrh> |
|
43 |
#include <csxhelp/mbxs.hlp.hrh> |
|
44 |
#include "MceIds.h" |
|
45 |
#include <MuiuMsvUiServiceUtilities.h> |
|
46 |
||
47 |
#include <commonphoneparser.h> |
|
48 |
#include <featmgr.h> |
|
49 |
||
50 |
// For Muiu split |
|
51 |
#include <muiumsvuiserviceutilitiesinternal.h> |
|
52 |
||
53 |
// CONSTANTS |
|
54 |
||
55 |
const TInt KMceTextBufferLength = 10; // text buffer length |
|
56 |
const TInt KMceListContainerGranuality = 4; |
|
57 |
// ================= MEMBER FUNCTIONS ======================= |
|
58 |
||
59 |
// ---------------------------------------------------- |
|
60 |
// Constructor |
|
61 |
// ---------------------------------------------------- |
|
62 |
CMceMessageListContainer::CMceMessageListContainer( |
|
63 |
CMceMessageListView& aParentView ) |
|
64 |
: |
|
65 |
CMceMessageListContainerBase( aParentView ) |
|
66 |
{ |
|
67 |
} |
|
68 |
||
69 |
// ---------------------------------------------------- |
|
70 |
// Destructor |
|
71 |
// ---------------------------------------------------- |
|
72 |
CMceMessageListContainer::~CMceMessageListContainer() |
|
73 |
{ |
|
74 |
delete iT9Interface; |
|
75 |
delete iT9Timer; |
|
76 |
||
77 |
if (iQwertyModeStatusSubscriber) |
|
78 |
{ |
|
79 |
iQwertyModeStatusSubscriber->StopSubscribe(); |
|
80 |
} |
|
81 |
iQwertyModeStatusProperty.Close(); |
|
82 |
delete iQwertyModeStatusSubscriber; |
|
83 |
||
84 |
if ( iListBox ) |
|
85 |
{ |
|
86 |
// icon array is deleted by CMceUi class |
|
87 |
iListBox->ItemDrawer()->FormattedCellData()->SetIconArray( NULL ); |
|
88 |
} |
|
89 |
||
90 |
delete iListBox; |
|
91 |
delete iListItems; |
|
92 |
delete iSelectedEntries; |
|
93 |
} |
|
94 |
||
95 |
// ---------------------------------------------------- |
|
96 |
// CMceMessageListContainer::NewL |
|
97 |
// ---------------------------------------------------- |
|
98 |
CMceMessageListContainer* CMceMessageListContainer::NewL( |
|
99 |
const TRect& aRect, |
|
100 |
CMsvSessionPtr aSession, |
|
101 |
TMsvId aFolderId, |
|
102 |
CMceBitmapResolver& aBitmapResolver, |
|
103 |
CMceMessageListView& aParentView ) |
|
104 |
{ |
|
105 |
CMceMessageListContainer* self = new (ELeave) CMceMessageListContainer( |
|
106 |
aParentView ); |
|
107 |
CleanupStack::PushL(self); |
|
108 |
self->ConstructL( aRect, aSession, aBitmapResolver, aFolderId ); |
|
109 |
CleanupStack::Pop(); // self |
|
110 |
return self; |
|
111 |
} |
|
112 |
||
113 |
// ---------------------------------------------------- |
|
114 |
// CMceMessageListContainer::ConstructL |
|
115 |
// ---------------------------------------------------- |
|
116 |
void CMceMessageListContainer::ConstructL( |
|
117 |
const TRect& aRect, |
|
118 |
CMsvSessionPtr aSession, |
|
119 |
CMceBitmapResolver& aBitmapResolver, |
|
120 |
TMsvId aFolderId ) |
|
121 |
{ |
|
122 |
CreateWindowL(); |
|
123 |
SetRect( aRect ); |
|
124 |
||
125 |
iListBox = new (ELeave) CMceMessageListBox( *this ); |
|
126 |
if(aFolderId == KMsvGlobalOutBoxIndexEntryIdValue) |
|
127 |
iListBox->ConstructL( this, EAknListBoxStylusMarkableList|EAknListBoxItemSpecificMenuDisabled ); |
|
128 |
else |
|
129 |
iListBox->ConstructL( this, EAknListBoxStylusMarkableList ); |
|
130 |
||
131 |
iListBox->ItemDrawer()->SetItemMarkReverse( ETrue ); |
|
132 |
iListBox->EnableMSKObserver( EFalse ); |
|
133 |
||
134 |
iListItems = CMceMessageListItemArray::NewL( |
|
135 |
aSession, aFolderId, EMceListTypeMessage, aBitmapResolver ); |
|
136 |
||
137 |
iListBox->Model()->SetItemTextArray( iListItems ); |
|
138 |
iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
|
139 |
||
140 |
iListBox->SetListBoxObserver( &iOwningView ); |
|
77
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
141 |
|
60 | 142 |
iSelectedEntries = new (ELeave) CMsvEntrySelection; |
143 |
||
144 |
iListBox->CreateScrollBarFrameL( ETrue ); |
|
145 |
iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( |
|
146 |
CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); |
|
147 |
||
148 |
iListBox->ItemDrawer()->FormattedCellData() |
|
149 |
->SetIconArray( aBitmapResolver.IconArray() ); |
|
150 |
||
151 |
iPreviousInputMethod = EFalse; |
|
152 |
||
153 |
User::LeaveIfError( iQwertyModeStatusProperty.Attach( |
|
154 |
KCRUidAvkon, KAknQwertyInputModeActive )); |
|
155 |
||
156 |
HandleQwertyModeChangeNotification(); |
|
157 |
iQwertyModeStatusSubscriber = CMcePropertySubscriber::NewL( |
|
158 |
TCallBack( QwertyModeChangeNotification, this ), iQwertyModeStatusProperty ); |
|
159 |
||
160 |
iQwertyModeStatusSubscriber->SubscribeL(); |
|
161 |
iDialerEvent = EFalse ; |
|
162 |
||
163 |
} |
|
164 |
||
165 |
// ---------------------------------------------------- |
|
166 |
// CMceMessageListContainer::MceListId |
|
167 |
// ---------------------------------------------------- |
|
168 |
TInt CMceMessageListContainer::MceListId() const |
|
169 |
{ |
|
170 |
return EMceListTypeTwoRow; |
|
171 |
} |
|
172 |
||
173 |
||
174 |
// ---------------------------------------------------- |
|
175 |
// CMceMessageListContainer::CountComponentControls |
|
176 |
// ---------------------------------------------------- |
|
177 |
TInt CMceMessageListContainer::CountComponentControls() const |
|
178 |
{ |
|
179 |
return 1; // always only listbox |
|
180 |
} |
|
181 |
||
182 |
// ---------------------------------------------------- |
|
183 |
// CMceMessageListContainer::ComponentControl |
|
184 |
// ---------------------------------------------------- |
|
185 |
CCoeControl* CMceMessageListContainer::ComponentControl(TInt /*aIndex*/) const |
|
186 |
{ |
|
187 |
return iListBox; |
|
188 |
} |
|
189 |
||
190 |
// ---------------------------------------------------- |
|
191 |
// CMceMessageListContainer::SetFolderL |
|
192 |
// ---------------------------------------------------- |
|
193 |
void CMceMessageListContainer::SetFolderL( TMsvId aFolderId ) |
|
194 |
{ |
|
195 |
if ( iListItems ) |
|
196 |
{ |
|
197 |
iListItems->SetFolderL( aFolderId ); |
|
198 |
} |
|
199 |
} |
|
200 |
||
201 |
// ---------------------------------------------------- |
|
202 |
// CMceMessageListContainer::Count |
|
203 |
// ---------------------------------------------------- |
|
204 |
TInt CMceMessageListContainer::Count() const |
|
205 |
{ |
|
206 |
return iListItems->MdcaCount(); |
|
207 |
} |
|
208 |
||
209 |
// ---------------------------------------------------- |
|
210 |
// CMceMessageListContainer::MessageCount |
|
211 |
// ---------------------------------------------------- |
|
212 |
TInt CMceMessageListContainer::MessageCount() const |
|
213 |
{ |
|
214 |
return iListItems->MessageCount(); |
|
215 |
} |
|
216 |
||
217 |
// ---------------------------------------------------- |
|
218 |
// CMceMessageListContainer::FolderCount |
|
219 |
// ---------------------------------------------------- |
|
220 |
TInt CMceMessageListContainer::FolderCount() const |
|
221 |
{ |
|
222 |
return iListItems->FolderCount(); |
|
223 |
} |
|
224 |
||
225 |
// ---------------------------------------------------- |
|
226 |
// CMceMessageListContainer::CurrentFolderId |
|
227 |
// ---------------------------------------------------- |
|
228 |
TMsvId CMceMessageListContainer::CurrentFolderId() const |
|
229 |
{ |
|
230 |
TMsvId folderId = 0; |
|
231 |
if ( iListItems ) |
|
232 |
{ |
|
233 |
folderId = iListItems->FolderId(); |
|
234 |
} |
|
235 |
return folderId; |
|
236 |
} |
|
237 |
||
238 |
// ---------------------------------------------------- |
|
239 |
// CMceMessageListContainer::SetCurrentItemIdL |
|
240 |
// ---------------------------------------------------- |
|
241 |
TBool CMceMessageListContainer::SetCurrentItemIdL( TMsvId aEntryId ) |
|
242 |
{ |
|
243 |
const TInt selectedIndex = ItemIndex( aEntryId ); |
|
244 |
if ( selectedIndex != KErrNotFound ) |
|
245 |
{ |
|
246 |
iAnchorItemIndex = selectedIndex; |
|
247 |
iAnchorItemId = aEntryId; |
|
248 |
||
249 |
//calulate the top item index |
|
250 |
TInt topIndex = iListBox->View()->CalcNewTopItemIndexSoItemIsVisible( selectedIndex ); |
|
251 |
iListBox->SetTopItemIndex( topIndex ); |
|
252 |
iListBox->SetCurrentItemIndex( selectedIndex ); |
|
253 |
iListBox->UpdateScrollBarsL(); |
|
254 |
iListBox->DrawDeferred(); |
|
255 |
// iListBox->SetCurrentItemIndex( selectedIndex ); |
|
256 |
} |
|
257 |
return (selectedIndex != KErrNotFound); |
|
258 |
||
259 |
} |
|
260 |
||
261 |
// ---------------------------------------------------- |
|
262 |
// CMceMessageListContainer::RefreshListbox |
|
263 |
// ---------------------------------------------------- |
|
264 |
void CMceMessageListContainer::RefreshListbox() |
|
265 |
{ |
|
266 |
iListBox->DrawDeferred(); |
|
267 |
} |
|
268 |
||
269 |
// ---------------------------------------------------- |
|
270 |
// CMceMessageListContainer::ItemCountChangedL |
|
271 |
// ---------------------------------------------------- |
|
77
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
272 |
void CMceMessageListContainer::ItemCountChangedL( TBool aItemsAdded ) |
60 | 273 |
{ |
274 |
if ( aItemsAdded ) |
|
275 |
{ |
|
77
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
276 |
iListBox->HandleItemAdditionL(); |
60 | 277 |
} |
278 |
else |
|
279 |
{ |
|
280 |
iListBox->HandleItemRemovalL(); |
|
281 |
} |
|
282 |
} |
|
283 |
||
284 |
||
285 |
// ---------------------------------------------------- |
|
286 |
// CMceMessageListContainer::FolderEntry |
|
287 |
// ---------------------------------------------------- |
|
288 |
const TMsvEntry& CMceMessageListContainer::FolderEntry() const |
|
289 |
{ |
|
290 |
return iListItems->FolderEntry(); |
|
291 |
} |
|
292 |
||
293 |
// ---------------------------------------------------- |
|
294 |
// CMceMessageListContainer::CurrentItemIndex |
|
295 |
// ---------------------------------------------------- |
|
296 |
TInt CMceMessageListContainer::CurrentItemIndex() const |
|
297 |
{ |
|
298 |
return iListBox->CurrentItemIndex(); |
|
299 |
} |
|
300 |
||
301 |
// ---------------------------------------------------- |
|
302 |
// CMceMessageListContainer::CurrentItemId |
|
303 |
// ---------------------------------------------------- |
|
304 |
TMsvId CMceMessageListContainer::CurrentItemId() const |
|
305 |
{ |
|
306 |
return iListItems->ItemId( CurrentItemIndex() ); |
|
307 |
} |
|
308 |
||
309 |
// ---------------------------------------------------- |
|
310 |
// CMceMessageListContainer::CurrentItemListItem |
|
311 |
// ---------------------------------------------------- |
|
312 |
TMceListItem CMceMessageListContainer::CurrentItemListItem() const |
|
313 |
{ |
|
314 |
return iListItems->Item( CurrentItemIndex() ); |
|
315 |
} |
|
316 |
||
317 |
||
318 |
// ---------------------------------------------------- |
|
319 |
// CMceMessageListContainer::CurrentItemSelectionL |
|
320 |
// ---------------------------------------------------- |
|
321 |
CMsvEntrySelection* CMceMessageListContainer::CurrentItemSelectionL() |
|
322 |
{ |
|
323 |
return iSelectedEntries->CopyL(); |
|
324 |
} |
|
325 |
||
326 |
// ---------------------------------------------------- |
|
327 |
// CMceMessageListContainer::CurrentItemSelectionRefreshL |
|
328 |
// ---------------------------------------------------- |
|
329 |
CMsvEntrySelection* CMceMessageListContainer::CurrentItemSelectionRefreshL() |
|
330 |
{ |
|
331 |
MarkItemSelectionL(); |
|
332 |
return CurrentItemSelectionL(); |
|
333 |
} |
|
334 |
||
335 |
// ---------------------------------------------------- |
|
336 |
// CMceMessageListContainer::CurrentItemSelectionCount |
|
337 |
// ---------------------------------------------------- |
|
338 |
TInt CMceMessageListContainer::CurrentItemSelectionCount() const |
|
339 |
{ |
|
340 |
if ( iListItems->MdcaCount() == 0 ) |
|
341 |
{ |
|
342 |
return 0; |
|
343 |
} |
|
344 |
return Max( 1, iListBox->View()->SelectionIndexes()->Count() ); |
|
345 |
} |
|
346 |
||
347 |
||
348 |
// ---------------------------------------------------- |
|
349 |
// CMceOneRowMessageListContainer::SelectionCount |
|
350 |
// ---------------------------------------------------- |
|
351 |
TInt CMceMessageListContainer::SelectionCount() const |
|
352 |
{ |
|
353 |
return iListBox->View()->SelectionIndexes()->Count(); |
|
354 |
} |
|
355 |
||
356 |
// ---------------------------------------------------- |
|
357 |
// CMceMessageListContainer::ClearSelection |
|
358 |
// ---------------------------------------------------- |
|
359 |
void CMceMessageListContainer::ClearSelection() |
|
360 |
{ |
|
361 |
iSelectedEntries->Reset(); |
|
362 |
iListBox->View()->ClearSelection(); |
|
363 |
} |
|
364 |
||
365 |
// ---------------------------------------------------- |
|
366 |
// CMceMessageListContainer::ItemIndex |
|
367 |
// ---------------------------------------------------- |
|
368 |
TInt CMceMessageListContainer::ItemIndex( TMsvId aId ) const |
|
369 |
{ |
|
370 |
return iListItems->ItemIndex( aId ); |
|
371 |
} |
|
372 |
||
373 |
||
374 |
// ---------------------------------------------------- |
|
375 |
// CMceMessageListContainer::MarkItemSelectionL |
|
376 |
// ---------------------------------------------------- |
|
377 |
void CMceMessageListContainer::MarkItemSelectionL() |
|
378 |
{ |
|
379 |
const CListBoxView::CSelectionIndexArray* selection = |
|
380 |
iListBox->View()->SelectionIndexes(); |
|
381 |
TInt count = selection->Count(); |
|
382 |
iSelectedEntries->Reset(); |
|
383 |
if ( count != 0 ) |
|
384 |
{ |
|
385 |
for (TInt loop=0; loop < count; loop++ ) |
|
386 |
{ |
|
387 |
TMsvId id = iListItems->ItemId( (*selection)[loop] ); |
|
388 |
if ( id != KErrNotFound ) |
|
389 |
{ |
|
390 |
iSelectedEntries->AppendL( id ); |
|
391 |
} |
|
392 |
} |
|
393 |
} |
|
394 |
else |
|
395 |
{ |
|
396 |
TMsvId id = CurrentItemId(); |
|
397 |
if ( id != KErrNotFound ) |
|
398 |
{ |
|
399 |
// nothing in selection so add item under "cursor" |
|
400 |
iSelectedEntries->AppendL( id ); |
|
401 |
} |
|
402 |
} |
|
403 |
} |
|
404 |
||
405 |
// ---------------------------------------------------- |
|
406 |
// CMceMessageListContainer::AddItemToSelectionL |
|
407 |
// ---------------------------------------------------- |
|
408 |
void CMceMessageListContainer::AddItemToSelectionL( TMsvId aEntryId ) |
|
409 |
{ |
|
410 |
if ( aEntryId > KMsvRootIndexEntryId ) |
|
411 |
{ |
|
412 |
iSelectedEntries->AppendL( aEntryId ); |
|
413 |
} |
|
414 |
} |
|
415 |
// ---------------------------------------------------- |
|
416 |
// CMceMessageListContainer::AddCurrentItemToSelectionL |
|
417 |
// ---------------------------------------------------- |
|
418 |
void CMceMessageListContainer::AddCurrentItemToSelectionL() |
|
419 |
{ |
|
420 |
iListBox->View()->SelectItemL( CurrentItemIndex() ); |
|
421 |
AddItemToSelectionL( CurrentItemId() ); |
|
422 |
} |
|
423 |
||
424 |
// ---------------------------------------------------- |
|
425 |
// CMceMessageListContainer::RemoveItemFromSelection |
|
426 |
// ---------------------------------------------------- |
|
427 |
void CMceMessageListContainer::RemoveItemFromSelection( TMsvId aEntryId ) |
|
428 |
{ |
|
429 |
TInt index = iSelectedEntries->Find( aEntryId ); |
|
430 |
if ( index >= 0 ) |
|
431 |
{ |
|
432 |
iSelectedEntries->Delete( index ); |
|
433 |
} |
|
434 |
} |
|
435 |
||
436 |
// ---------------------------------------------------- |
|
437 |
// CMceMessageListContainer::RemoveCurrentItemFromSelection |
|
438 |
// ---------------------------------------------------- |
|
439 |
void CMceMessageListContainer::RemoveCurrentItemFromSelection() |
|
440 |
{ |
|
441 |
iListBox->View()->DeselectItem( CurrentItemIndex() ); |
|
442 |
RemoveItemFromSelection( CurrentItemId() ); |
|
443 |
} |
|
444 |
||
445 |
// ---------------------------------------------------- |
|
446 |
// CMceMessageListContainer::RefreshSelectionIndexesL |
|
447 |
// ---------------------------------------------------- |
|
77
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
448 |
void CMceMessageListContainer::RefreshSelectionIndexesL( TBool aForceUpdate ) |
60 | 449 |
{ |
77
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
450 |
const CListBoxView::CSelectionIndexArray* selection = |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
451 |
iListBox->View()->SelectionIndexes(); |
60 | 452 |
|
77
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
453 |
if ( selection->Count() > 0 || aForceUpdate ) |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
454 |
{ |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
455 |
CArrayFixFlat<TInt>* newSelection = new ( ELeave ) |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
456 |
CArrayFixFlat<TInt>( KMceListContainerGranuality ); |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
457 |
CleanupStack::PushL( newSelection ); |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
458 |
const TInt count = iSelectedEntries->Count(); |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
459 |
for ( TInt loop = count; loop >0; loop--) |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
460 |
{ |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
461 |
TInt index = iListItems->ItemIndex( (*iSelectedEntries)[loop-1] ); |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
462 |
if ( index > KErrNotFound ) |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
463 |
{ |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
464 |
newSelection->AppendL( index ); |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
465 |
} |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
466 |
else |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
467 |
{ |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
468 |
iSelectedEntries->Delete( loop-1 ); |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
469 |
} |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
470 |
} |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
471 |
iListBox->SetSelectionIndexesL( newSelection ); |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
472 |
CleanupStack::PopAndDestroy( newSelection ); |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
473 |
} |
60 | 474 |
|
475 |
} |
|
476 |
||
477 |
// ---------------------------------------------------- |
|
478 |
// CMceMessageListContainer::AddAllToSelectionL |
|
479 |
// ---------------------------------------------------- |
|
480 |
void CMceMessageListContainer::AddAllToSelectionL() |
|
481 |
{ |
|
482 |
CArrayFixFlat<TInt>* indexArray = new( ELeave ) CArrayFixFlat<TInt>( |
|
483 |
KMceListContainerGranuality ); |
|
484 |
CleanupStack::PushL( indexArray ); |
|
485 |
iSelectedEntries->Reset(); |
|
486 |
const TInt count = iListItems->MdcaCount(); |
|
487 |
for ( TInt loop = 0; loop < count; loop++ ) |
|
488 |
{ |
|
489 |
TMsvId id = iListItems->ItemId( loop ); |
|
490 |
if ( !iListItems->IsItemFolder( id ) ) |
|
491 |
{ |
|
492 |
indexArray->AppendL( loop ); |
|
493 |
iSelectedEntries->AppendL( id ); |
|
494 |
} |
|
495 |
} |
|
496 |
iListBox->SetSelectionIndexesL( indexArray ); |
|
497 |
CleanupStack::PopAndDestroy( indexArray ); |
|
498 |
} |
|
499 |
||
500 |
||
501 |
// ---------------------------------------------------- |
|
502 |
// CMceMessageListContainer::MarkAllReadMessagesL |
|
503 |
// ---------------------------------------------------- |
|
504 |
void CMceMessageListContainer::MarkAllReadMessagesL() |
|
505 |
{ |
|
506 |
CArrayFixFlat<TInt>* msgIndexArray = new( ELeave ) CArrayFixFlat<TInt>( 4 ); |
|
507 |
CleanupStack::PushL( msgIndexArray ); |
|
508 |
iSelectedEntries->Reset(); |
|
509 |
iListBox->View()->ClearSelection(); |
|
510 |
||
511 |
const TInt count = iListItems->MdcaCount(); |
|
512 |
for ( TInt loop = 0; loop < count; loop++ ) |
|
513 |
{ |
|
514 |
TMsvEntry entry; |
|
515 |
TMsvId entryId = iListItems->ItemId( loop ); |
|
516 |
if ( iListItems->GetEntry( entryId, entry ) == KErrNone ) |
|
517 |
{ |
|
518 |
if ( entry.iType == KUidMsvMessageEntry && |
|
519 |
!entry.Unread() ) |
|
520 |
{ |
|
521 |
msgIndexArray->AppendL( loop ); |
|
522 |
} |
|
523 |
} |
|
524 |
} |
|
525 |
||
526 |
if ( msgIndexArray->Count() > 0 ) |
|
527 |
{ |
|
528 |
iListBox->SetSelectionIndexesL( msgIndexArray ); |
|
529 |
iListBox->DrawDeferred(); |
|
530 |
} |
|
531 |
CleanupStack::PopAndDestroy( msgIndexArray ); |
|
532 |
} |
|
533 |
||
534 |
||
535 |
// ---------------------------------------------------- |
|
536 |
// CMceMessageListContainer::IsItemSelected |
|
537 |
// ---------------------------------------------------- |
|
538 |
TBool CMceMessageListContainer::IsItemSelected( TMsvId aItemId ) |
|
539 |
{ |
|
540 |
// Find selected items |
|
541 |
const CListBoxView::CSelectionIndexArray* items = |
|
542 |
iListBox->SelectionIndexes(); |
|
543 |
TInt itemIndex = iListItems->ItemIndex( aItemId ); |
|
544 |
TKeyArrayFix key(0, ECmpTInt); |
|
545 |
TInt pos; |
|
546 |
||
547 |
// Is item in selection array |
|
548 |
if ( items->Find(itemIndex, key, pos) != KErrNone ) |
|
549 |
{ |
|
550 |
return EFalse; |
|
551 |
} |
|
552 |
else |
|
553 |
{ |
|
554 |
return ETrue; |
|
555 |
} |
|
556 |
} |
|
557 |
||
558 |
||
559 |
// ---------------------------------------------------- |
|
560 |
// CMceMessageListContainer::SetMskL |
|
561 |
// ---------------------------------------------------- |
|
562 |
void CMceMessageListContainer::SetMskL() |
|
563 |
{ |
|
564 |
TInt currentItem = CurrentItemIndex(); |
|
565 |
TInt resourceId = currentItem == 0 ? |
|
566 |
R_MCE_MSK_BUTTON_SELECT:R_MCE_MSK_BUTTON_OPEN; |
|
567 |
||
568 |
if ( resourceId != iCurrMskResource ) |
|
569 |
{ |
|
570 |
iCurrMskResource = resourceId; |
|
571 |
CEikButtonGroupContainer* cba; |
|
572 |
cba = CEikButtonGroupContainer::Current(); |
|
573 |
const TInt KMSKPosition = 3; |
|
574 |
cba->SetCommandL( KMSKPosition, iCurrMskResource ); |
|
575 |
cba->DrawDeferred(); |
|
576 |
} |
|
577 |
} |
|
578 |
||
579 |
||
580 |
// ---------------------------------------------------- |
|
581 |
// CMceMessageListContainer::FocusChanged |
|
582 |
// ---------------------------------------------------- |
|
583 |
void CMceMessageListContainer::FocusChanged(TDrawNow /*aDrawNow*/) |
|
584 |
{ |
|
585 |
if (iListBox) |
|
586 |
{ |
|
587 |
iListBox->SetFocus(IsFocused()); |
|
588 |
} |
|
589 |
} |
|
590 |
||
591 |
||
592 |
// ---------------------------------------------------- |
|
593 |
// CMceMessageListContainer::MarkedItemsCount() |
|
594 |
// ---------------------------------------------------- |
|
595 |
TInt CMceMessageListContainer::MarkedItemsCount() |
|
596 |
{ |
|
597 |
return iListBox->View()->SelectionIndexes()->Count(); |
|
598 |
} |
|
599 |
||
600 |
||
601 |
// ---------------------------------------------------- |
|
602 |
// CMceMessageListContainer::OfferKeyEventL |
|
603 |
// ---------------------------------------------------- |
|
604 |
TKeyResponse CMceMessageListContainer::OfferKeyEventL( |
|
605 |
const TKeyEvent& aKeyEvent, |
|
606 |
TEventCode aType ) |
|
607 |
{ |
|
608 |
||
609 |
if ( !iT9Interface ) |
|
610 |
{ |
|
611 |
iT9Interface = CPtiEngine::NewL(); |
|
612 |
if ( iInputMethodQwerty ) |
|
613 |
{ |
|
614 |
iT9Interface->SetInputMode( EPtiEngineQwerty ); |
|
615 |
iT9Interface->ActivateLanguageL( User::Language(), EPtiEngineQwerty ); |
|
616 |
} |
|
617 |
else |
|
618 |
{ |
|
619 |
iT9Interface->SetInputMode( EPtiEngineMultitapping ); |
|
620 |
iT9Interface->ActivateLanguageL( User::Language(), EPtiEngineMultitapping ); |
|
621 |
} |
|
622 |
iPreviousInputMethod = iInputMethodQwerty; |
|
623 |
} |
|
624 |
else |
|
625 |
{ |
|
626 |
if ( iInputMethodQwerty != iPreviousInputMethod ) |
|
627 |
{ |
|
628 |
if ( iInputMethodQwerty ) |
|
629 |
{ |
|
630 |
iT9Interface->SetInputMode( EPtiEngineQwerty ); |
|
631 |
iT9Interface->ActivateLanguageL( User::Language(), EPtiEngineQwerty ); |
|
632 |
} |
|
633 |
else |
|
634 |
{ |
|
635 |
iT9Interface->SetInputMode( EPtiEngineMultitapping ); |
|
636 |
iT9Interface->ActivateLanguageL( User::Language(), EPtiEngineMultitapping ); |
|
637 |
} |
|
638 |
iPreviousInputMethod = iInputMethodQwerty; |
|
639 |
} |
|
640 |
} |
|
641 |
||
642 |
if ( !iT9Timer ) |
|
643 |
{ |
|
644 |
iT9Timer = CMceMessageListContainerKeyTimer::NewL( *iT9Interface ); |
|
645 |
} |
|
646 |
||
647 |
if ( iListBox ) |
|
648 |
{ |
|
649 |
||
650 |
if ( aType == EEventKeyUp ) |
|
651 |
{ |
|
652 |
iOwningView.SetMSKButtonL(); |
|
653 |
iDialerEvent = EFalse ; |
|
654 |
} |
|
655 |
||
656 |
if ( aType == EEventKeyDown && iDialerEvent ) |
|
657 |
{ |
|
658 |
iDialerEvent = EFalse ; |
|
659 |
} |
|
660 |
if ( aType == EEventKey ) |
|
661 |
{ |
|
662 |
||
663 |
iOwningView.CancelMailboxTimer(); |
|
664 |
||
665 |
if ( aKeyEvent.iCode == EKeyLeftArrow || aKeyEvent.iCode == EKeyRightArrow ) |
|
666 |
{ |
|
667 |
return EKeyWasNotConsumed; |
|
668 |
} |
|
669 |
||
71
17302fa075e1
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
670 |
|
17302fa075e1
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
671 |
if ( ( iOwningView.MenuBar()->ItemSpecificCommandsEnabled() || SelectionCount() ) && aKeyEvent.iCode == EKeyBackspace ) |
60 | 672 |
{ |
673 |
MarkItemSelectionL(); |
|
674 |
SetAnchorItemIdL( |
|
675 |
CMceMessageListContainerBase::EMessageListOperationGeneral ); |
|
676 |
const TInt itemCount = CurrentItemSelectionCount(); |
|
677 |
if ( itemCount != 0 && |
|
678 |
( itemCount != 1 || |
|
679 |
CurrentItemId() != KMceTemplatesEntryIdValue ) |
|
680 |
) |
|
681 |
{ |
|
682 |
if ( !iListItems->DeleteDiscard( CurrentItemId() ) ) |
|
683 |
{ |
|
684 |
//if outbox and mms/sms connected, not delete |
|
685 |
iOwningView.HandleCommandL( EMceCmdDelete ); |
|
686 |
} |
|
687 |
} |
|
688 |
return EKeyWasConsumed; |
|
689 |
} |
|
690 |
else if ( aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == EKeyEnter ) |
|
691 |
{ |
|
692 |
if ( aKeyEvent.iModifiers & EModifierShift || |
|
693 |
aKeyEvent.iModifiers & EModifierCtrl ) |
|
694 |
{ |
|
695 |
if ( iListItems->FolderId() != KMsvGlobalOutBoxIndexEntryIdValue && |
|
696 |
IsCurrentItemFolder() ) |
|
697 |
{ |
|
698 |
return EKeyWasNotConsumed; |
|
699 |
} |
|
700 |
} |
|
701 |
else |
|
702 |
{ |
|
703 |
iOwningView.SetHideExitCommand( ETrue ); |
|
704 |
if ( iListItems->FolderId() == KMsvGlobalOutBoxIndexEntryIdValue || |
|
705 |
iOwningView.SyncMlOutboxInbox( KMsvGlobalOutBoxIndexEntryId ) || |
|
706 |
CurrentItemSelectionCount() == 0 || |
|
707 |
iOwningView.CheckMMSNotificationOpenL() ) |
|
708 |
{ |
|
709 |
if(iListItems->FolderId() == KMsvGlobalOutBoxIndexEntryIdValue) |
|
710 |
{ |
|
711 |
iOwningView.SetContextCommandFlag(ETrue); |
|
712 |
} |
|
713 |
// list is empty, open options menu |
|
714 |
iOwningView.ProcessCommandL( EAknSoftkeyOptions ); |
|
715 |
return EKeyWasConsumed; |
|
716 |
} |
|
717 |
} |
|
718 |
} |
|
719 |
||
720 |
else if ( aKeyEvent.iCode == EKeyYes ) |
|
721 |
{ |
|
722 |
if (!iDialerEvent && aKeyEvent.iRepeats == 0) |
|
723 |
{ |
|
724 |
// send key has been pressed in Inbox or in Documents folder |
|
725 |
TMsvId folderId = iListItems->FolderId(); |
|
726 |
if ( folderId != KMsvDraftEntryId && |
|
727 |
folderId != KMsvGlobalOutBoxIndexEntryId && |
|
728 |
folderId != KMsvSentEntryId && |
|
729 |
folderId != KMceTemplatesEntryId |
|
730 |
&& ( CurrentItemSelectionCount() == 1 ) ) |
|
731 |
{ |
|
732 |
if ( !( iListItems->IsFolderRemote() ) ) |
|
733 |
{ |
|
734 |
TMsvId id = CurrentItemId(); |
|
735 |
TBool validNumber = EFalse; |
|
736 |
TBuf<KMceVisibleTextLength> recipientstring; |
|
737 |
TPhCltTelephoneNumber number; |
|
738 |
CMceUi* mceUi = static_cast<CMceUi*>( iEikonEnv->AppUi() ); |
|
739 |
validNumber = MceUtils::ValidPhoneNumberL( id, mceUi->Session(), number, &recipientstring ); |
|
740 |
if (KErrNotFound != number.Match( recipientstring )) |
|
741 |
{ |
|
742 |
recipientstring = KNullDesC; |
|
743 |
} |
|
744 |
||
745 |
// |
|
746 |
// Callback number is supported in CDMA mode. If there isn't a phone |
|
747 |
// book match for the sender, it gets confusing to display the sender's |
|
748 |
// number (contained in recipientstring) and the callback number |
|
749 |
// (contained in the number field) via CallToSenderQueryL. |
|
750 |
// Therefore, if the recipientstring differs from the phone number |
|
751 |
// to be used to call the sender and recipientstring is also a phone |
|
752 |
// number, we won't display recipientstring when running in CDMA mode. |
|
753 |
// |
|
754 |
if ( FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) ) |
|
755 |
{ |
|
756 |
if ( CommonPhoneParser::IsValidPhoneNumber( recipientstring, CommonPhoneParser::ESMSNumber ) ) |
|
757 |
{ |
|
758 |
recipientstring = KNullDesC; |
|
759 |
} |
|
760 |
} |
|
761 |
||
762 |
if ( validNumber ) |
|
763 |
{ |
|
764 |
iAvkonAppUi->SetKeyEventFlags( CAknAppUiBase::EDisableSendKeyShort | CAknAppUiBase::EDisableSendKeyLong ); |
|
765 |
MsvUiServiceUtilitiesInternal::CallToSenderQueryL( number, recipientstring, EFalse ); |
|
766 |
iAvkonAppUi->SetKeyEventFlags( 0x00 ); |
|
767 |
} |
|
768 |
} |
|
769 |
else //(iiListItems->IsFolderRemote()) Enable Sendkey in Mail List |
|
770 |
{ |
|
771 |
iAvkonAppUi->SetKeyEventFlags( CAknAppUiBase::EDisableSendKeyShort | CAknAppUiBase::EDisableSendKeyLong ); |
|
772 |
iOwningView.HandleSendkeyInMailboxL( CurrentItemId() ); |
|
773 |
iAvkonAppUi->SetKeyEventFlags( 0x00 ); |
|
774 |
} |
|
775 |
} |
|
776 |
SetAnchorItemIdL( |
|
777 |
CMceMessageListContainerBase::EMessageListOperationGeneral ); |
|
778 |
} |
|
779 |
return EKeyWasConsumed; |
|
780 |
} |
|
781 |
||
782 |
else if ( IsValidSearchKey( aKeyEvent ) ) |
|
783 |
{ |
|
784 |
if ( !( FeatureManager::FeatureSupported(KFeatureIdJapanese) || |
|
785 |
FeatureManager::FeatureSupported(KFeatureIdChinese) ) ) |
|
786 |
{ |
|
787 |
HandleShortcutForSearchL( aKeyEvent ); |
|
788 |
} |
|
789 |
} |
|
790 |
else if ( aKeyEvent.iCode == (TUint)EPtiKeyStar ) |
|
791 |
{ |
|
792 |
if ( HasHandleStarKeyDoneL() ) // * key |
|
793 |
{ |
|
794 |
return EKeyWasConsumed; |
|
795 |
} |
|
796 |
} |
|
797 |
} |
|
798 |
||
799 |
if ( iListItems->MdcaCount() > 0 && iListBox->View()->SelectionIndexes()->Count() == 0 ) |
|
800 |
{ |
|
801 |
iOwningView.SetHideExitCommand( EFalse ); |
|
802 |
} |
|
803 |
TKeyResponse ret = iListBox->OfferKeyEventL(aKeyEvent, aType); |
|
804 |
iOwningView.SetCurrentItemId(); |
|
805 |
SetAnchorItemIdL( |
|
806 |
CMceMessageListContainerBase::EMessageListOperationGeneral ); |
|
807 |
if ( ( aKeyEvent.iModifiers & EModifierShift || |
|
808 |
aKeyEvent.iModifiers & EModifierCtrl ) && |
|
809 |
( aKeyEvent.iCode == EKeyOK || |
|
810 |
aKeyEvent.iCode == EKeyEnter || |
|
811 |
aKeyEvent.iCode == EKeyUpArrow || |
|
812 |
aKeyEvent.iCode == EKeyDownArrow ) ) |
|
813 |
{ |
|
814 |
MarkItemSelectionL(); |
|
815 |
iOwningView.SetMSKButtonL(); |
|
816 |
} |
|
817 |
else if ( iOwningView.IsMSKMailBox() && |
|
818 |
( aKeyEvent.iCode == EKeyUpArrow || aKeyEvent.iCode == EKeyDownArrow ) ) |
|
819 |
{ |
|
820 |
iOwningView.SetMSKButtonL(); |
|
821 |
} |
|
822 |
return ret; |
|
823 |
} |
|
824 |
else |
|
825 |
{ |
|
826 |
return EKeyWasNotConsumed; |
|
827 |
} |
|
828 |
||
829 |
} |
|
830 |
||
831 |
// ---------------------------------------------------- |
|
832 |
// CMceMessageListContainer::IsCurrentItemFolder |
|
833 |
// ---------------------------------------------------- |
|
834 |
TBool CMceMessageListContainer::IsCurrentItemFolder() const |
|
835 |
{ |
|
836 |
TBool isCurrentFolder = EFalse; |
|
837 |
const TMsvId id = CurrentItemId(); |
|
838 |
if ( id != KErrNotFound ) |
|
839 |
{ |
|
840 |
isCurrentFolder = iListItems->IsItemFolder( id ); |
|
841 |
} |
|
842 |
return isCurrentFolder; |
|
843 |
} |
|
844 |
||
845 |
||
846 |
// ---------------------------------------------------- |
|
847 |
// CMceMessageListContainer::IsCurrentItemFolder |
|
848 |
// ---------------------------------------------------- |
|
849 |
TBool CMceMessageListContainer::IsItemFolder( TMsvId aItemId ) const |
|
850 |
{ |
|
851 |
return iListItems->IsItemFolder( aItemId ); |
|
852 |
} |
|
853 |
||
854 |
||
855 |
// ---------------------------------------------------- |
|
856 |
// CMceMessageListContainer::IsItemFolder |
|
857 |
// ---------------------------------------------------- |
|
858 |
TBool CMceMessageListContainer::IsItemFolder(TInt aIndex) const |
|
859 |
{ |
|
860 |
TBool isCurrentFolder = EFalse; |
|
861 |
const TMsvId id = iListItems->ItemId( aIndex ); |
|
862 |
if ( id != KErrNotFound ) |
|
863 |
{ |
|
864 |
isCurrentFolder = iListItems->IsItemFolder( id ); |
|
865 |
} |
|
866 |
return isCurrentFolder; |
|
867 |
} |
|
868 |
||
869 |
||
870 |
// ---------------------------------------------------- |
|
871 |
// CMceOneRowMessageListContainer::IsItemRemote |
|
872 |
// ---------------------------------------------------- |
|
873 |
TBool CMceMessageListContainer::IsItemRemote( TMsvId aItemId ) const |
|
874 |
{ |
|
875 |
return iListItems->IsItemRemote( aItemId ); |
|
876 |
} |
|
877 |
||
878 |
||
879 |
// ---------------------------------------------------- |
|
880 |
// CMceMessageListContainer::IsOutboxOpened |
|
881 |
// ---------------------------------------------------- |
|
882 |
TBool CMceMessageListContainer::IsOutboxOpened() const |
|
883 |
{ |
|
884 |
return IsOpenedFolder( KMsvGlobalOutBoxIndexEntryIdValue ); |
|
885 |
} |
|
886 |
||
887 |
||
888 |
// ---------------------------------------------------- |
|
889 |
// CMceMessageListContainer:: |
|
890 |
// ---------------------------------------------------- |
|
891 |
TBool CMceMessageListContainer::IsOpenedFolder( TMsvId aFolderId ) const |
|
892 |
{ |
|
893 |
return ( iListItems->FolderId() == aFolderId ); |
|
894 |
} |
|
895 |
||
896 |
||
897 |
// ---------------------------------------------------- |
|
898 |
// CMceMessageListContainer::DisplayOptionsMenuFromSelectionKey |
|
899 |
// ---------------------------------------------------- |
|
900 |
TBool CMceMessageListContainer::DisplayOptionsMenuFromSelectionKey() const |
|
901 |
{ |
|
902 |
return ( iListItems->MdcaCount() == 0 || iListBox->View()->SelectionIndexes()->Count() ); |
|
903 |
} |
|
904 |
||
905 |
||
906 |
// ---------------------------------------------------- |
|
907 |
// CMceMessageListContainer::GetHelpContext |
|
908 |
// returns helpcontext as aContext |
|
909 |
// ---------------------------------------------------- |
|
910 |
void CMceMessageListContainer::GetHelpContext |
|
911 |
(TCoeHelpContext& aContext) const |
|
912 |
{ |
|
913 |
TMsvId folderId = iListItems->FolderId(); |
|
914 |
aContext.iMajor = KMceApplicationUid; |
|
915 |
||
916 |
TBool isRemoteFolder = iListItems->IsFolderRemote(); |
|
917 |
||
918 |
/*if ( iOwningView.SyncMlOutboxInbox( KMsvGlobalInBoxIndexEntryId ) ) |
|
919 |
{ |
|
920 |
aContext.iContext = KMCE_HLP_MESS_SYNCI; |
|
921 |
} |
|
922 |
else if ( iOwningView.SyncMlOutboxInbox( KMsvGlobalOutBoxIndexEntryId ) ) |
|
923 |
{ |
|
924 |
aContext.iContext = KMCE_HLP_MESS_SYNCO; |
|
925 |
} |
|
926 |
||
927 |
else if ( iOwningView.IsSyncMl() ) |
|
928 |
{ |
|
929 |
aContext.iContext = KMCE_HLP_MESS_SYNC; |
|
930 |
} |
|
931 |
||
932 |
else*/ |
|
933 |
if ( folderId == KMsvDraftEntryId ) |
|
934 |
{ |
|
935 |
aContext.iContext = KMCE_HLP_DRAFTS; |
|
936 |
} |
|
937 |
else if ( folderId == KMsvGlobalOutBoxIndexEntryId ) |
|
938 |
{ |
|
939 |
aContext.iContext = KMCE_HLP_OUTBOX; |
|
940 |
} |
|
941 |
else if ( folderId == KMsvGlobalInBoxIndexEntryId ) |
|
942 |
{ |
|
943 |
aContext.iContext = KMCE_HLP_INBOX; |
|
944 |
} |
|
945 |
else if ( folderId == KMsvSentEntryId ) |
|
946 |
{ |
|
947 |
aContext.iContext = KMCE_HLP_SENT_ITEMS; |
|
948 |
} |
|
949 |
else if ( folderId == KMceDocumentsEntryId ) |
|
950 |
{ |
|
951 |
aContext.iContext = KMCE_HLP_DOCUMENTS; |
|
952 |
} |
|
953 |
else if ( folderId == KMceTemplatesEntryId ) |
|
954 |
{ |
|
955 |
aContext.iContext = KMCE_HLP_TEMPLATES; |
|
956 |
} |
|
957 |
else if ( !isRemoteFolder ) |
|
958 |
{ |
|
959 |
// own folder |
|
960 |
aContext.iContext = KMCE_HLP_FOLDER; |
|
961 |
} |
|
962 |
else |
|
963 |
{ |
|
964 |
// remote account |
|
965 |
TBool isConnected = iListItems->IsConnected(); |
|
966 |
if ( isConnected ) |
|
967 |
{ |
|
968 |
aContext.iContext = KMCE_HLP_MAILBOX_ONLINE; |
|
969 |
} |
|
970 |
else |
|
971 |
{ |
|
972 |
aContext.iContext = KMCE_HLP_MAILBOX_OFFLINE; |
|
973 |
} |
|
974 |
} |
|
975 |
||
976 |
} |
|
977 |
||
978 |
// ---------------------------------------------------- |
|
979 |
// CMceMessageListContainer::SyncMlOutboxOpened |
|
980 |
// ---------------------------------------------------- |
|
981 |
TBool CMceMessageListContainer::SyncMlOutboxOpened() const |
|
982 |
{ |
|
983 |
return ( iOwningView.SyncMlOutboxInbox( KMsvGlobalOutBoxIndexEntryId ) ); |
|
984 |
} |
|
985 |
||
986 |
||
987 |
||
988 |
// ---------------------------------------------------- |
|
989 |
// CMceMessageListContainer::HandleResourceChange |
|
990 |
// ---------------------------------------------------- |
|
991 |
void CMceMessageListContainer::HandleResourceChange( TInt aType ) |
|
992 |
{ |
|
993 |
CCoeControl::HandleResourceChange( aType ); |
|
994 |
if ( iListBox && aType == KEikDynamicLayoutVariantSwitch ) |
|
995 |
{ |
|
996 |
||
997 |
iListBox->ItemDrawer()->SetItemMarkReverse( ETrue ); |
|
998 |
SetRect( iOwningView.ClientRect() ); |
|
999 |
} |
|
1000 |
} |
|
1001 |
||
1002 |
||
1003 |
// ---------------------------------------------------- |
|
1004 |
// CMceMessageListContainer::SizeChanged |
|
1005 |
// ---------------------------------------------------- |
|
1006 |
void CMceMessageListContainer::SizeChanged() |
|
1007 |
{ |
|
1008 |
if (iListBox) |
|
1009 |
{ |
|
1010 |
iListBox->SetRect( Rect() ); |
|
1011 |
iListBox->ItemDrawer()->SetItemMarkReverse( ETrue ); |
|
1012 |
} |
|
1013 |
} |
|
1014 |
||
1015 |
// ---------------------------------------------------- |
|
1016 |
// CMceMessageListContainer::ProcessCommandL |
|
1017 |
// ---------------------------------------------------- |
|
1018 |
void CMceMessageListContainer::ProcessCommandL(TInt aCommand) |
|
1019 |
{ |
|
1020 |
if ( aCommand == EAknSoftkeyShiftMSK ) |
|
1021 |
{ |
|
1022 |
// Pass the MSK marking command as a key event to controls |
|
1023 |
const CListBoxView::CSelectionIndexArray* items = |
|
1024 |
iListBox->SelectionIndexes(); |
|
1025 |
||
1026 |
// check what state item under "cursor" is |
|
1027 |
TKeyArrayFix key(0, ECmpTInt); |
|
1028 |
TInt pos; |
|
1029 |
if ( !items->Find(CurrentItemIndex(), key, pos)) |
|
1030 |
{ |
|
1031 |
RemoveCurrentItemFromSelection(); |
|
1032 |
} |
|
1033 |
else |
|
1034 |
{ |
|
1035 |
AddCurrentItemToSelectionL(); |
|
1036 |
} |
|
1037 |
iOwningView.SetMSKButtonL(); |
|
1038 |
} |
|
1039 |
} |
|
1040 |
||
1041 |
||
1042 |
// ---------------------------------------------------- |
|
1043 |
// CMceMessageListContainer::StateCanBeChangedByStarKeyL() const |
|
1044 |
// Exam if it is the situation that * key can change message state |
|
1045 |
// Returns ETrue if it can |
|
1046 |
// Public |
|
1047 |
// ---------------------------------------------------- |
|
1048 |
TBool CMceMessageListContainer::StateCanBeChangedByStarKeyL() const |
|
1049 |
{ |
|
1050 |
TMsvId folderId = iListItems->FolderId(); |
|
1051 |
TBool isRemoteFolder = iListItems->IsFolderRemote(); |
|
1052 |
||
1053 |
if ( ( iListItems->MdcaCount() > 0 && |
|
1054 |
iListBox->View()->SelectionIndexes()->Count() == 0 && |
|
1055 |
!IsCurrentItemFolder() ) && |
|
1056 |
( folderId == KMsvGlobalInBoxIndexEntryId || //Inbox |
|
1057 |
folderId == KMceDocumentsEntryId || //Documents |
|
1058 |
iListItems->GetParentFolderId() == KMceDocumentsEntryId || //Subfolder of Documents |
|
1059 |
isRemoteFolder ) ) // Mailbox & SyncMl |
|
1060 |
{ |
|
1061 |
if ( iOwningView.IsSyncMl() ) |
|
1062 |
{ |
|
1063 |
return( iOwningView.ListContainer()->FolderEntry().iRelatedId == KMsvGlobalInBoxIndexEntryId );//Inbox of SyncMail |
|
1064 |
} |
|
1065 |
return ETrue; |
|
1066 |
} |
|
1067 |
else |
|
1068 |
{ |
|
1069 |
return EFalse; |
|
1070 |
} |
|
1071 |
} |
|
1072 |
||
1073 |
// TODO: maybe worth of adding new function for these listbox->ItemDrawer()->SetItemMarkXXX function? |
|
1074 |
// MarkItemSelectionL(); does selection but not mark |
|
1075 |
// AddCurrentItemToSelectionL(); selects and marks |
|
1076 |
||
1077 |
||
1078 |
//------------------------------------------------------------------------------- |
|
1079 |
// CMceMessageListContainer::HandlePointerEventL( const TPointerEvent& aPointerEvent ) |
|
1080 |
//------------------------------------------------------------------------------- |
|
1081 |
void CMceMessageListContainer::HandlePointerEventL( const TPointerEvent& aPointerEvent ) |
|
1082 |
{ |
|
1083 |
if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) |
|
1084 |
{ |
|
1085 |
iOwningView.SetMSKButtonL(); |
|
1086 |
iOwningView.SetCurrentItemId(); |
|
1087 |
if ( ( iOwningView.IsMSKMailBox() || |
|
1088 |
iListItems->FolderId() == KMsvDraftEntryId ) && |
|
1089 |
iListBox->CurrentItemIndex() < 0 ) |
|
1090 |
{ |
|
1091 |
iOwningView.ProcessCommandL( EAknSoftkeyContextOptions ); |
|
1092 |
} |
|
1093 |
} |
|
1094 |
if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) |
|
1095 |
{ |
|
1096 |
if ( iOwningView.IsMSKMailBox() ) |
|
1097 |
{ |
|
1098 |
iOwningView.CancelMailboxTimer(); |
|
1099 |
} |
|
1100 |
} |
|
1101 |
iListBox->HandlePointerEventL( aPointerEvent ); |
|
1102 |
} |
|
1103 |
||
1104 |
||
1105 |
//------------------------------------------------------------------------------- |
|
1106 |
//CMceMessageListContainer::IsValidSearchKey(const TKeyEvent& aKeyEvent) |
|
1107 |
//------------------------------------------------------------------------------- |
|
1108 |
TBool CMceMessageListContainer::IsValidSearchKey( const TKeyEvent& aKeyEvent ) |
|
1109 |
{ |
|
1110 |
TBool response = EFalse; |
|
1111 |
if ( iInputMethodQwerty ) |
|
1112 |
{ |
|
1113 |
response = ETrue; |
|
1114 |
} |
|
1115 |
if ((( aKeyEvent.iCode >= (TUint)EPtiKey0 && |
|
1116 |
aKeyEvent.iCode <= (TUint)EPtiKey9 ) ) |
|
1117 |
&& !aKeyEvent.iRepeats ) |
|
1118 |
{ |
|
1119 |
response = ETrue; |
|
1120 |
} |
|
1121 |
if ( aKeyEvent.iCode == EKeyUpArrow || |
|
1122 |
aKeyEvent.iCode == EKeyDownArrow ) |
|
1123 |
{ |
|
1124 |
response = EFalse; |
|
1125 |
} |
|
1126 |
return response; |
|
1127 |
} |
|
1128 |
||
1129 |
||
1130 |
//------------------------------------------------------------------------------- |
|
1131 |
//CMceMessageListContainer::HandleQwertyModeChangeNotification() |
|
1132 |
//------------------------------------------------------------------------------- |
|
1133 |
TInt CMceMessageListContainer::HandleQwertyModeChangeNotification() |
|
1134 |
{ |
|
1135 |
TInt err = iQwertyModeStatusProperty.Get( iInputMethodQwerty ); |
|
1136 |
if ( err ) |
|
1137 |
{ |
|
1138 |
// Set defaut inputmethod. 0 = No Qwerty -> EPtiEngineMultitapping |
|
1139 |
iInputMethodQwerty = 0; |
|
1140 |
} |
|
1141 |
return err; |
|
1142 |
} |
|
1143 |
||
1144 |
||
1145 |
//------------------------------------------------------------------------------- |
|
1146 |
//CMceMessageListContainer::QwertyModeChangeNotification(TAny* aObj) |
|
1147 |
//------------------------------------------------------------------------------- |
|
1148 |
TInt CMceMessageListContainer::QwertyModeChangeNotification( TAny* aObj ) |
|
1149 |
{ |
|
1150 |
TInt err = KErrArgument; |
|
1151 |
if ( aObj != NULL ) |
|
1152 |
{ |
|
1153 |
err = static_cast<CMceMessageListContainer*>(aObj)->HandleQwertyModeChangeNotification(); |
|
1154 |
} |
|
1155 |
return err; |
|
1156 |
} |
|
1157 |
||
1158 |
// ---------------------------------------------------- |
|
1159 |
// CMceMessageListContainer:: |
|
1160 |
// ---------------------------------------------------- |
|
1161 |
void CMceMessageListContainer::SetSortTypeL( TInt aSortType, TBool aOrdering ) |
|
1162 |
{ |
|
1163 |
iListItems->SetOrderingL( aSortType, aOrdering ); |
|
1164 |
} |
|
1165 |
||
1166 |
// ---------------------------------------------------- |
|
1167 |
// CMceMessageListContainer:: |
|
1168 |
// ---------------------------------------------------- |
|
1169 |
void CMceMessageListContainer::SetMtmUiDataRegistry( MMtmUiDataRegistryObserver* aRegistryObserver ) |
|
1170 |
{ |
|
1171 |
iListItems->SetRegistryObserver( aRegistryObserver ); |
|
1172 |
} |
|
1173 |
||
1174 |
// ---------------------------------------------------- |
|
1175 |
// CMceMessageListContainer:: |
|
1176 |
// ---------------------------------------------------- |
|
1177 |
TMsvId CMceMessageListContainer::FindEntry( const TDesC& aMatchString ) const |
|
1178 |
{ |
|
1179 |
TMsvId foundEntry = KErrNotFound; |
|
1180 |
TInt index = iListItems->FindEntryIndex( aMatchString ); |
|
1181 |
if ( index >= 0 ) |
|
1182 |
{ |
|
1183 |
foundEntry = iListItems->ItemId( index ); |
|
1184 |
} |
|
1185 |
return foundEntry; |
|
1186 |
||
1187 |
} |
|
1188 |
||
1189 |
// ---------------------------------------------------- |
|
1190 |
// CMceMessageListContainer:: |
|
1191 |
// ---------------------------------------------------- |
|
1192 |
TBool CMceMessageListContainer::FindFirstUnreadMessageL( TMsvId& aEntryId ) const |
|
1193 |
{ |
|
1194 |
return iListItems->FindFirstUnreadMessageL( aEntryId ); |
|
1195 |
} |
|
1196 |
||
1197 |
// ---------------------------------------------------- |
|
1198 |
// CMceMessageListContainer:: |
|
1199 |
// ---------------------------------------------------- |
|
1200 |
void CMceMessageListContainer::ResetCurrentItemL() |
|
1201 |
{ |
|
1202 |
if ( iListItems->MdcaCount() ) |
|
1203 |
{ |
|
1204 |
//calulate the top item index |
|
1205 |
TInt topIndex = iListBox->View()->CalcNewTopItemIndexSoItemIsVisible( 0 ); |
|
1206 |
iListBox->SetTopItemIndex( topIndex ); |
|
1207 |
iListBox->SetCurrentItemIndex( 0 ); |
|
1208 |
} |
|
1209 |
iListBox->UpdateScrollBarsL(); |
|
1210 |
} |
|
1211 |
||
1212 |
// ---------------------------------------------------- |
|
1213 |
// CMceMessageListContainer:: |
|
1214 |
// ---------------------------------------------------- |
|
1215 |
CMceMessageListContainerBase::TMessageListItemType CMceMessageListContainer::CurrentItemType() const |
|
1216 |
{ |
|
1217 |
if ( iListItems->MdcaCount() ) |
|
1218 |
{ |
|
1219 |
return CMceMessageListContainerBase::EMessageListItemMsvItem; |
|
1220 |
} |
|
1221 |
return CMceMessageListContainerBase::EMessageListItemUnknown; |
|
1222 |
} |
|
1223 |
||
1224 |
// ---------------------------------------------------- |
|
1225 |
// CMceMessageListContainer:: |
|
1226 |
// ---------------------------------------------------- |
|
1227 |
void CMceMessageListContainer::SetListEmptyTextL(const TDesC& aText) |
|
1228 |
{ |
|
1229 |
iListBox->View()->SetListEmptyTextL( aText ); |
|
1230 |
} |
|
1231 |
||
1232 |
// ---------------------------------------------------- |
|
1233 |
// CMceMessageListContainer:: |
|
1234 |
// ---------------------------------------------------- |
|
1235 |
void CMceMessageListContainer::SetAnchorItemIdL( |
|
1236 |
TMessageListOperationType aOperationType ) |
|
1237 |
{ |
|
1238 |
if ( iListItems->MdcaCount() == 0 ) |
|
1239 |
{ |
|
1240 |
iAnchorItemId = KErrNotFound; |
|
1241 |
iAnchorItemIndex = KErrNotFound; |
|
1242 |
iLastOperationType = aOperationType; |
|
1243 |
return; |
|
1244 |
} |
|
1245 |
||
1246 |
switch ( aOperationType ) |
|
1247 |
{ |
|
1248 |
case EMessageListOperationGeneral: |
|
1249 |
iAnchorItemIndex = iListBox->CurrentItemIndex(); |
|
1250 |
iAnchorItemId = iListItems->ItemId( iAnchorItemIndex ); |
|
1251 |
break; |
|
1252 |
case EMessageListOperationConnect: |
|
1253 |
iAnchorItemIndex = iListBox->CurrentItemIndex(); |
|
1254 |
iAnchorItemId = iListItems->ItemId( iAnchorItemIndex ); |
|
1255 |
break; |
|
1256 |
case EMessageListOperationFetchSelected: |
|
1257 |
// find first from the marked messages list...? What if that is deleted when connected??? |
|
1258 |
if ( iSelectedEntries->Count() ) |
|
1259 |
{ |
|
1260 |
// pick first one |
|
1261 |
iAnchorItemId = (*iSelectedEntries)[0]; |
|
1262 |
iAnchorItemIndex = iListItems->ItemIndex( iAnchorItemId ); |
|
1263 |
} |
|
1264 |
else |
|
1265 |
{ |
|
1266 |
iAnchorItemIndex = iListBox->CurrentItemIndex(); |
|
1267 |
iAnchorItemId = iListItems->ItemId( iAnchorItemIndex ); |
|
1268 |
} |
|
1269 |
break; |
|
1270 |
case EMessageListOperationFetchNew: |
|
1271 |
iAnchorItemIndex = iListBox->CurrentItemIndex(); |
|
1272 |
iAnchorItemId = iListItems->ItemId( iAnchorItemIndex ); |
|
1273 |
break; |
|
1274 |
case EMessageListOperationDelete: |
|
1275 |
iAnchorItemIndex = iListBox->CurrentItemIndex(); |
|
1276 |
iAnchorItemId = iListItems->ItemId( iAnchorItemIndex ); |
|
1277 |
break; |
|
1278 |
case EMessageListOperationCompleted: |
|
1279 |
HandleOperationCompletedL(); |
|
1280 |
break; |
|
1281 |
default: |
|
1282 |
// assert debug ? |
|
1283 |
break; |
|
1284 |
} |
|
1285 |
||
1286 |
#ifdef _DEBUG |
|
1287 |
RDebug::Print(_L("CMceMessageListContainer1: iAnchorItemId 0x%x, iAnchorItemIndex %d"), iAnchorItemId, iAnchorItemIndex); |
|
1288 |
#endif |
|
1289 |
if ( aOperationType != EMessageListOperationCompleted ) |
|
1290 |
{ |
|
1291 |
iLastOperationType = aOperationType; |
|
1292 |
} |
|
1293 |
} |
|
1294 |
||
1295 |
// ---------------------------------------------------- |
|
1296 |
// CMceMessageListContainer:: |
|
1297 |
// ---------------------------------------------------- |
|
1298 |
void CMceMessageListContainer::HandleOperationCompletedL() |
|
1299 |
{ |
|
1300 |
if ( /*iLastOperationType == EMessageListOperationConnect &&*/ |
|
1301 |
iAnchorItemIndex == KErrNotFound ) |
|
1302 |
{ |
|
1303 |
// set focus to first one... |
|
1304 |
if ( iListItems->MdcaCount() ) |
|
1305 |
{ |
|
1306 |
iListBox->SetCurrentItemIndex( 0 ); |
|
1307 |
iAnchorItemIndex = 0; |
|
1308 |
iAnchorItemId = iListItems->ItemId( iAnchorItemIndex ); |
|
1309 |
} |
|
1310 |
RefreshListbox(); |
|
1311 |
} |
|
1312 |
SetAnchorItemIdL( EMessageListOperationGeneral ); |
|
1313 |
} |
|
1314 |
||
1315 |
// ---------------------------------------------------- |
|
1316 |
// CMceMessageListContainer:: |
|
1317 |
// ---------------------------------------------------- |
|
1318 |
void CMceMessageListContainer::HandleMsvSessionEventL( |
|
1319 |
MMsvSessionObserver::TMsvSessionEvent aEvent, |
|
1320 |
CMsvEntrySelection& aSelection, |
|
1321 |
TBool aDraw ) |
|
1322 |
{ |
|
1323 |
#ifdef _DEBUG |
|
1324 |
RDebug::Print(_L("CMceMessageListContainer2: iAnchorItemId 0x%x, iAnchorItemIndex %d"), iAnchorItemId, iAnchorItemIndex); |
|
1325 |
#endif |
|
1326 |
switch ( aEvent ) |
|
1327 |
{ |
|
1328 |
case MMsvSessionObserver::EMsvEntriesDeleted: |
|
1329 |
{ |
|
1330 |
/* if ( iOwningView.IsMSKMailBox() ) // focus setting only for email |
|
1331 |
{ |
|
1332 |
} |
|
1333 |
else*/ |
|
1334 |
{ |
|
1335 |
ItemCountChangedL( EFalse ); |
|
1336 |
TInt selectedIndex = ItemIndex( iAnchorItemId ); |
|
1337 |
if ( selectedIndex == KErrNotFound ) |
|
1338 |
{ |
|
1339 |
// we could not find anchor item, lets try to set new focus using index |
|
1340 |
||
1341 |
if ( iAnchorItemIndex > iListItems->MdcaCount() - 1 ) |
|
1342 |
{ |
|
1343 |
iAnchorItemIndex = iListItems->MdcaCount() - 1; |
|
1344 |
} |
|
1345 |
iAnchorItemId = iListItems->ItemId( iAnchorItemIndex ); |
|
1346 |
} |
|
1347 |
if ( aDraw ) |
|
1348 |
{ |
|
1349 |
SetCurrentItemIdL( iAnchorItemId ); |
|
1350 |
} |
|
1351 |
iAnchorItemIndex = iListBox->CurrentItemIndex(); |
|
1352 |
} |
|
1353 |
if ( aDraw ) |
|
1354 |
{ |
|
1355 |
RefreshListbox(); |
|
1356 |
} |
|
1357 |
} |
|
1358 |
break; |
|
1359 |
case MMsvSessionObserver::EMsvEntriesCreated: |
|
1360 |
case MMsvSessionObserver::EMsvEntriesChanged: |
|
1361 |
{ |
|
77
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
1362 |
|
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
1363 |
ItemCountChangedL( ETrue ); |
da6ac9d688df
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
71
diff
changeset
|
1364 |
|
60 | 1365 |
if ( iLastOperationType != EMessageListOperationConnect && |
1366 |
iAnchorItemId != KErrNotFound ) |
|
1367 |
{ |
|
1368 |
if ( iOwningView.IsMSKMailBox() ) // focus setting only for email |
|
1369 |
{ |
|
1370 |
TInt selectedIndex = ItemIndex( iAnchorItemId ); |
|
1371 |
if ( selectedIndex == KErrNotFound ) |
|
1372 |
{ |
|
1373 |
// we could not find anchor item, lets try to set new focus using index |
|
1374 |
if ( iAnchorItemIndex > iListItems->MdcaCount() - 1 ) |
|
1375 |
{ |
|
1376 |
iAnchorItemIndex = iListItems->MdcaCount() - 1; |
|
1377 |
} |
|
1378 |
iAnchorItemId = iListItems->ItemId( iAnchorItemIndex ); |
|
1379 |
} |
|
1380 |
if (selectedIndex != iListBox->CurrentItemIndex() && |
|
1381 |
aEvent == MMsvSessionObserver::EMsvEntriesChanged ) |
|
1382 |
{ |
|
1383 |
iAnchorItemIndex = iListBox->CurrentItemIndex(); |
|
1384 |
iAnchorItemId = iListItems->ItemId( iAnchorItemIndex ); |
|
1385 |
} |
|
1386 |
if(aEvent==MMsvSessionObserver::EMsvEntriesCreated) |
|
1387 |
{ |
|
1388 |
iAnchorItemIndex=0; |
|
1389 |
iAnchorItemId = iListItems->ItemId( iAnchorItemIndex ); |
|
1390 |
} |
|
1391 |
if ( aDraw ) |
|
1392 |
{ |
|
1393 |
SetCurrentItemIdL( iAnchorItemId ); |
|
1394 |
} |
|
1395 |
iAnchorItemIndex = iListBox->CurrentItemIndex(); |
|
1396 |
#ifdef _DEBUG |
|
1397 |
RDebug::Print(_L("CMceMessageListContainer3: iAnchorItemId 0x%x, iAnchorItemIndex %d"), iAnchorItemId, iAnchorItemIndex); |
|
1398 |
#endif |
|
1399 |
//SetCurrentItemIdL( iAnchorItemId ); |
|
1400 |
} |
|
1401 |
else |
|
1402 |
{ |
|
1403 |
if ( aSelection.Count() ) |
|
1404 |
{ |
|
1405 |
// is this enough? |
|
1406 |
SetCurrentItemIdL( aSelection.At(0) ); |
|
1407 |
} |
|
1408 |
} |
|
1409 |
} |
|
1410 |
} |
|
1411 |
||
1412 |
||
1413 |
break; |
|
1414 |
case MMsvSessionObserver::EMsvEntriesMoved: |
|
1415 |
break; |
|
1416 |
default: |
|
1417 |
break; |
|
1418 |
}; |
|
1419 |
} |
|
1420 |
||
1421 |
// ---------------------------------------------------- |
|
1422 |
// CMceMessageListContainer::OptionsCommandSupported |
|
1423 |
// ---------------------------------------------------- |
|
1424 |
TUint CMceMessageListContainer::OptionsCommandSupported() const |
|
1425 |
{ |
|
1426 |
return TMessageListCommandNone; |
|
1427 |
} |
|
1428 |
||
1429 |
// ---------------------------------------------------- |
|
1430 |
// CMceMessageListContainer::HandleOptionsCommandL |
|
1431 |
// ---------------------------------------------------- |
|
1432 |
void CMceMessageListContainer::HandleOptionsCommandL( TInt /*aCommand*/ ) |
|
1433 |
{ |
|
1434 |
// Should we use assert debug here? |
|
1435 |
} |
|
1436 |
||
1437 |
// ---------------------------------------------------- |
|
1438 |
// CMceMessageListContainer::DateTimeFormatChangedL |
|
1439 |
// ---------------------------------------------------- |
|
1440 |
void CMceMessageListContainer::DateTimeFormatChangedL( TInt /*aChangeFlag*/ ) |
|
1441 |
{ |
|
1442 |
RefreshListbox(); |
|
1443 |
} |
|
1444 |
||
1445 |
// --------------------------------------------------------------------------- |
|
1446 |
// CMceMessageListContainer::SetMskL |
|
1447 |
// --------------------------------------------------------------------------- |
|
1448 |
// |
|
1449 |
TInt CMceMessageListContainer::SetSpecialMskL() |
|
1450 |
{ |
|
1451 |
return NULL; |
|
1452 |
} |
|
1453 |
||
1454 |
//------------------------------------------------------------------------------- |
|
1455 |
//CMceMessageListContainer::HandleShortcutForSearch( const TKeyEvent& aKeyEvent ) |
|
1456 |
//------------------------------------------------------------------------------- |
|
1457 |
void CMceMessageListContainer::HandleShortcutForSearchL( const TKeyEvent& aKeyEvent ) |
|
1458 |
{ |
|
1459 |
// in remote mailbox key has been pressed, find item if sorted |
|
1460 |
// by subject or sender |
|
1461 |
TInt Len = 0; |
|
1462 |
TBuf<KMceTextBufferLength> text; |
|
1463 |
text.Zero(); |
|
1464 |
if ( iT9Interface->LastEnteredKey() != ( TInt ) aKeyEvent.iScanCode ) |
|
1465 |
{ |
|
1466 |
iT9Interface->ClearCurrentWord(); |
|
1467 |
} |
|
1468 |
iT9Interface->AppendKeyPress( (TPtiKey)aKeyEvent.iScanCode ); |
|
1469 |
Len = iT9Interface->CurrentWord().Length(); |
|
1470 |
if ( Len < KMceTextBufferLength ) |
|
1471 |
{ |
|
1472 |
text = iT9Interface->CurrentWord(); |
|
1473 |
} |
|
1474 |
else |
|
1475 |
{ |
|
1476 |
text = iT9Interface->CurrentWord().Left(KMceTextBufferLength); |
|
1477 |
} |
|
1478 |
||
1479 |
iOwningView.FindAndSelectEntryL( text ); |
|
1480 |
iT9Timer->Start(); |
|
1481 |
} |
|
1482 |
||
1483 |
//------------------------------------------------------------------------------- |
|
1484 |
//CMceMessageListContainer::HasHandleStarKeyDoneL() |
|
1485 |
//------------------------------------------------------------------------------- |
|
1486 |
TBool CMceMessageListContainer::HasHandleStarKeyDoneL() |
|
1487 |
{ |
|
1488 |
TBool starkeyIsHandled = EFalse; |
|
1489 |
if ( StateCanBeChangedByStarKeyL() ) |
|
1490 |
{ |
|
1491 |
if ( IsSortByDate() ) |
|
1492 |
{ |
|
1493 |
MarkReadUnreadWithStarKeyL(); |
|
1494 |
} |
|
1495 |
else |
|
1496 |
{ |
|
1497 |
// if sort by anything else other than by Date, handle focus change |
|
1498 |
iListBox->SetCurrentItemIndex( 0 ); |
|
1499 |
iListBox->DrawDeferred(); |
|
1500 |
} |
|
1501 |
starkeyIsHandled = ETrue; |
|
1502 |
} |
|
1503 |
return starkeyIsHandled; |
|
1504 |
} |
|
1505 |
||
1506 |
//------------------------------------------------------------------------------- |
|
1507 |
//CMceMessageListContainer::MarkReadUnreadWithStarKeyL() |
|
1508 |
//------------------------------------------------------------------------------- |
|
1509 |
void CMceMessageListContainer::MarkReadUnreadWithStarKeyL() |
|
1510 |
{ |
|
1511 |
MarkItemSelectionL(); |
|
1512 |
if( iOwningView.IsItemUnread( CurrentItemId() ) ) |
|
1513 |
{ |
|
1514 |
iOwningView.HandleCommandL( EMceCmdMarkAsRead ); |
|
1515 |
} |
|
1516 |
else |
|
1517 |
{ |
|
1518 |
iOwningView.HandleCommandL( EMceCmdMarkAsUnread ); |
|
1519 |
} |
|
1520 |
} |
|
1521 |
||
1522 |
//------------------------------------------------------------------------------- |
|
1523 |
//CMceMessageListContainer::IsSortByDate() |
|
1524 |
//------------------------------------------------------------------------------- |
|
1525 |
TBool CMceMessageListContainer::IsSortByDate() |
|
1526 |
{ |
|
1527 |
TMsvSelectionOrdering ordering = iListItems->SortType(); |
|
1528 |
return ( ( ordering.Sorting() == EMsvSortByDateReverse) || ( ordering.Sorting() == EMsvSortByDate ) ); |
|
1529 |
} |
|
1530 |
||
1531 |
// --------------------------------------------------------------------------- |
|
1532 |
// CMceMessageListContainer::SetContainerFlag |
|
1533 |
// --------------------------------------------------------------------------- |
|
1534 |
void CMceMessageListContainer::SetContainerFlag( TMceContainerFlags /*aFlag*/, TBool /*aState*/ ) |
|
1535 |
{ |
|
1536 |
} |
|
1537 |
||
1538 |
void CMceMessageListContainer::UpdateIconArrayL() |
|
1539 |
{ |
|
1540 |
// do nothing for two row list. |
|
1541 |
} |
|
1542 |
||
1543 |
// End of File |