author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:11:15 +0300 | |
branch | RCL_3 |
changeset 80 | 726fba06891a |
parent 73 | c8382f7b54ef |
permissions | -rw-r--r-- |
64 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: This file implements class CFSEmailUiSearchListVisualiser. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
// SYSTEM INCLUDES |
|
21 |
#include "emailtrace.h" |
|
22 |
#include <freestyleemailui.mbg> |
|
23 |
#include <AknUtils.h> |
|
24 |
#include <gulicon.h> |
|
25 |
#include <StringLoader.h> |
|
26 |
#include <FreestyleEmailUi.rsg> |
|
27 |
||
28 |
//<cmail> |
|
29 |
#include "cfsmailmessage.h" |
|
30 |
#include "cfsmailclient.h" |
|
31 |
#include "cfsmailfolder.h" |
|
32 |
#include "cfsmailbox.h" |
|
33 |
#include <alf/alfframebrush.h> |
|
34 |
#include <alf/alftextvisual.h> |
|
35 |
#include "fstreelist.h" |
|
36 |
#include "fstreevisualizerbase.h" |
|
37 |
#include "fstreeplaintwolineitemdata.h" |
|
38 |
#include "fstreeplaintwolineitemvisualizer.h" |
|
39 |
#include "fstreeplainonelinenodedata.h" |
|
40 |
#include "fstreeplainonelinenodevisualizer.h" |
|
41 |
||
42 |
//</cmail> |
|
43 |
#include <AknQueryDialog.h> |
|
44 |
//<cmail> |
|
45 |
#include "cfsmailcommon.h" |
|
46 |
#include <alf/alfanchorlayout.h> |
|
47 |
#include <alf/alfdecklayout.h> |
|
48 |
#include <alf/alfcontrolgroup.h> |
|
49 |
#include <alf/alfevent.h> |
|
50 |
#include <alf/alfbrusharray.h> |
|
51 |
// </cmail> |
|
52 |
#include <alf/alfenv.h> |
|
53 |
#include <alf/alfcommand.h> |
|
54 |
#include <aknnotewrappers.h> |
|
55 |
// <cmail> |
|
56 |
#include <layoutmetadata.cdl.h> |
|
57 |
#include <aknlayoutscalable_apps.cdl.h> |
|
58 |
// </cmail> |
|
59 |
#include <featmgr.h> |
|
60 |
//</cmail> |
|
61 |
#include <aknstyluspopupmenu.h> |
|
62 |
||
63 |
//<cmail> |
|
64 |
#include "mfsccontactactionmenumodel.h" |
|
65 |
#include "fscontrolbar.h" |
|
66 |
#include "fscontrolbuttoninterface.h" |
|
67 |
#include "fscontrolbuttonvisualiser.h" |
|
68 |
#include <csxhelp/cmail.hlp.hrh> |
|
69 |
// </cmail> |
|
70 |
||
71 |
// Meeting request headers |
|
72 |
#include <MeetingRequestUids.hrh> |
|
73 |
//<cmail> |
|
74 |
#include "cesmricalviewer.h" |
|
75 |
//</cmail> |
|
76 |
||
77 |
// INTERNAL INCLUDES |
|
78 |
#include "FreestyleEmailUiLayoutHandler.h" |
|
79 |
#include "FreestyleEmailUiMailListModel.h" |
|
80 |
#include "FreestyleEmailUiMailListVisualiser.h" |
|
81 |
#include "FreestyleEmailUiSearchListVisualiser.h" |
|
82 |
#include "FreestyleEmailUiSearchListControl.h" |
|
83 |
#include "FreestyleEmailUiFileSystemInfo.h" |
|
84 |
#include "FreestyleEmailUiAppui.h" |
|
85 |
#include "FreestyleEmailUi.hrh" |
|
86 |
#include "FreestyleEmailUiTextureManager.h" |
|
87 |
#include "FreestyleEmailUiUtilities.h" |
|
88 |
#include "FreestyleEmailUiLiterals.h" |
|
89 |
#include "FreestyleEmailUiShortcutBinding.h" |
|
90 |
#include "FreestyleEmailUiMsgDetailsVisualiser.h" |
|
91 |
#include "freestyleemailcenrephandler.h" |
|
92 |
#include "FreestyleEmailUiHtmlViewerView.h" |
|
93 |
#include "FSEmail.pan" |
|
94 |
||
95 |
// CONST VALUES |
|
96 |
static const TInt KMaxLengthOfSearchString = 255; |
|
97 |
//<cmail> s60 platform layouts |
|
98 |
//static const TInt KSearchIconWidth = 30; |
|
99 |
//const TReal KFSHeaderTextBackgroundOpacity = 0.3f; |
|
100 |
//</cmail> |
|
101 |
static const TInt KItemExpansionDelay = 400; |
|
102 |
static const TInt KListScrollingDelay = 200; |
|
103 |
static const TInt KMaxPreviewPaneLength = 60; |
|
104 |
||
105 |
//<cmail> define search required priorities |
|
106 |
#define KStandardSearchPriority CActive::EPriorityStandard |
|
107 |
#define KCallingSearchPriority ( CActive::EPriorityIdle - 1 ) |
|
108 |
||
109 |
||
110 |
CFSEmailUiSearchListVisualiser* CFSEmailUiSearchListVisualiser::NewL(CAlfEnv& aEnv, |
|
111 |
CFreestyleEmailUiAppUi* aAppUi, |
|
112 |
CAlfControlGroup& aSearchListControlGroup ) |
|
113 |
{ |
|
114 |
FUNC_LOG; |
|
115 |
CFSEmailUiSearchListVisualiser* self = CFSEmailUiSearchListVisualiser::NewLC(aEnv, aAppUi, aSearchListControlGroup ); |
|
116 |
CleanupStack::Pop(self); |
|
117 |
return self; |
|
118 |
} |
|
119 |
||
120 |
CFSEmailUiSearchListVisualiser* CFSEmailUiSearchListVisualiser::NewLC(CAlfEnv& aEnv, |
|
121 |
CFreestyleEmailUiAppUi* aAppUi, |
|
122 |
CAlfControlGroup& aSearchListControlGroup) |
|
123 |
{ |
|
124 |
FUNC_LOG; |
|
125 |
CFSEmailUiSearchListVisualiser* self = new (ELeave) CFSEmailUiSearchListVisualiser(aAppUi, aEnv, aSearchListControlGroup); |
|
126 |
CleanupStack::PushL(self); |
|
127 |
self->ConstructL(); |
|
128 |
return self; |
|
129 |
} |
|
130 |
||
131 |
void CFSEmailUiSearchListVisualiser::ConstructL() |
|
132 |
{ |
|
133 |
FUNC_LOG; |
|
134 |
BaseConstructL( R_FSEMAILUI_MAIL_SEARCH_VIEW ); |
|
135 |
||
136 |
// Set list as initial focused control |
|
137 |
iThisViewActive = EFalse; |
|
138 |
iFirstStartCompleted = EFalse; |
|
139 |
} |
|
140 |
||
141 |
// CFSEmailUiSearchListVisualiser::DoFirstStartL() |
|
142 |
// Purpose of this function is to do first start only when search list is |
|
143 |
// really needed to be shown. Implemented to make app startuo faster. |
|
144 |
void CFSEmailUiSearchListVisualiser::DoFirstStartL() |
|
145 |
{ |
|
146 |
FUNC_LOG; |
|
147 |
TRect screenRect; |
|
148 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect ); |
|
149 |
||
150 |
// Create control and anchor layout |
|
151 |
iSearchListControl = CFreestyleEmailUiSearchListControl::NewL( *iEnv, this ); |
|
152 |
iScreenAnchorLayout = CAlfAnchorLayout::AddNewL( *iSearchListControl ); |
|
153 |
iScreenAnchorLayout->SetFlags(EAlfVisualFlagAutomaticLocaleMirroringEnabled); |
|
154 |
SetSearchListLayoutAnchors(); |
|
155 |
||
156 |
||
157 |
/*<cmail> paltform layout changes to cmail |
|
158 |
TAlfTimedValue barBgTextureOpacity; |
|
159 |
barBgTextureOpacity.SetValueNow( 1 ); |
|
160 |
iBarBgVisual->SetOpacity( barBgTextureOpacity ); |
|
161 |
CAlfTexture* barBgTexture = &iAppUi.FsTextureManager()->TextureByIndex( EMailListBarBgIcon ); |
|
162 |
barBgTexture->Size().SetSize( screenRect.Width(), iAppUi.LayoutHandler()->ControlBarHeight() ); |
|
163 |
iBarBgVisual->SetImage( TAlfImage( *barBgTexture ) ); |
|
164 |
*/ //</cmail> |
|
165 |
||
166 |
/*<cmail> magnifier image is not in cmail |
|
167 |
// Add bar image component |
|
168 |
iBarFindImage = CAlfImageVisual::AddNewL( *iSearchListControl, iScreenAnchorLayout ); |
|
169 |
TAlfTimedValue barFindImageOpacity; |
|
170 |
barFindImageOpacity.SetValueNow( 1 ); |
|
171 |
iBarFindImage->SetOpacity( barFindImageOpacity ); |
|
172 |
CAlfTexture* barFindTexture = &iAppUi.FsTextureManager()->TextureByIndex( ESearchLookingGlassIcon ); |
|
173 |
barFindTexture->Size().SetSize( 15, 15 ); |
|
174 |
iBarFindImage->SetImage( TAlfImage( *barFindTexture ) ); |
|
175 |
*/ //</cmail> |
|
176 |
||
177 |
// <cmail> |
|
178 |
// Add bar text component |
|
179 |
iBarTextVisual = CAlfTextVisual::AddNewL( *iSearchListControl, iScreenAnchorLayout ); |
|
180 |
iBarTextVisual->EnableShadow(EFalse); |
|
181 |
iBarTextVisual->SetWrapping( CAlfTextVisual::ELineWrapTruncate ); |
|
182 |
// </cmail> |
|
183 |
||
184 |
/*<cmail> no initial text or opacity required in cmail |
|
185 |
HBufC* initialSearchText = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_FIND_DLG_SEARCH ); |
|
186 |
iBarTextVisual->SetTextL( *initialSearchText ); |
|
187 |
CleanupStack::PopAndDestroy( initialSearchText ); |
|
188 |
TAlfTimedValue barTextVisualOpacity; |
|
189 |
barTextVisualOpacity.SetValueNow( 1 ); |
|
190 |
iBarTextVisual->SetOpacity( barTextVisualOpacity ); |
|
191 |
||
192 |
CAlfTextStyle* textStyle = iAppUi.LayoutHandler()->FSTextStyleFromIdL( EFSFontTypeSmallBold ); |
|
193 |
iBarTextVisual->SetTextStyle ( textStyle->Id() );*/ //</cmail> |
|
194 |
if ( !AknLayoutUtils::LayoutMirrored() ) |
|
195 |
{ |
|
196 |
iBarTextVisual->SetAlign(EAlfAlignHLeft, EAlfAlignVCenter); |
|
197 |
} |
|
198 |
else |
|
199 |
{ |
|
200 |
iBarTextVisual->SetAlign(EAlfAlignHRight, EAlfAlignVCenter); |
|
201 |
} |
|
202 |
||
203 |
// Create model |
|
204 |
iModel = CFSEmailUiMailListModel::NewL( &iAppUi, ETrue ); |
|
205 |
||
206 |
// Create list and append to control group and anchor layout |
|
207 |
iSearchListLayout = CAlfDeckLayout::AddNewL( *iSearchListControl, iScreenAnchorLayout ); |
|
208 |
iSearchListLayout->SetSize( TSize( screenRect.Width(), screenRect.Height()- |
|
209 |
iAppUi.LayoutHandler()->ControlBarHeight() ) ); |
|
210 |
iSearchTreeListVisualizer = CFsTreeVisualizerBase::NewL(iSearchListControl, *iSearchListLayout); |
|
211 |
iSearchList = CFsTreeList::NewL(*iSearchTreeListVisualizer, *iEnv ); |
|
212 |
iSearchList->SetScrollbarVisibilityL( EFsScrollbarHideAlways ); |
|
213 |
||
214 |
// Set mark type and icon |
|
215 |
iSearchList->SetMarkTypeL( CFsTreeList::EFsTreeListMultiMarkable ); |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
216 |
iSearchTreeListVisualizer->SetMarkIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMarkIcon ) ); |
64 | 217 |
iSearchTreeListVisualizer->SetMenuIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMenuIcon ) ); |
218 |
iSearchTreeListVisualizer->SetFlipState( iKeyboardFlipOpen ); |
|
219 |
iSearchTreeListVisualizer->SetFocusVisibility( iFocusVisible ); |
|
220 |
iSearchList->SetIndentationL(0); |
|
221 |
||
222 |
//<cmail> events are now offered to controls in different order |
|
223 |
ControlGroup().AppendL( iSearchListControl ); |
|
224 |
ControlGroup().AppendL( iSearchList->TreeControl() ); |
|
225 |
//</cmail> |
|
226 |
//<cmail> touch |
|
227 |
iSearchList->AddObserverL(*this); |
|
228 |
//</cmail> |
|
229 |
iSearchOngoing = EFalse; |
|
230 |
||
231 |
||
232 |
// Initializing the default stylus long tap popup menu |
|
233 |
if( !iStylusPopUpMenu ) |
|
234 |
{ |
|
235 |
TPoint point( 0, 0 ); |
|
236 |
iStylusPopUpMenu = CAknStylusPopUpMenu::NewL( this , point ); |
|
237 |
TResourceReader reader; |
|
238 |
iCoeEnv->CreateResourceReaderLC( reader, |
|
239 |
R_STYLUS_POPUP_MENU_SEARCH_LIST_VIEW ); |
|
240 |
iStylusPopUpMenu->ConstructFromResourceL( reader ); |
|
241 |
CleanupStack::PopAndDestroy(); |
|
242 |
} |
|
243 |
||
244 |
// Set mail list background |
|
245 |
//<cmail> S60 skin support |
|
246 |
//iSearchTreeListVisualizer->SetBackgroundTextureL( iAppUi.FsTextureManager()->TextureByIndex( EBackgroundTextureMailList ) ); |
|
247 |
//</cmail> |
|
248 |
||
249 |
iSearchTreeListVisualizer->SetItemExpansionDelay( KItemExpansionDelay ); |
|
250 |
iSearchList->SetScrollTime( KListScrollingDelay, 0.5 ); |
|
251 |
||
252 |
// Set empty text |
|
253 |
HBufC* emptyText = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_EMPTY_MSG_LIST_TEXT ); |
|
254 |
iSearchTreeListVisualizer->SetEmptyListTextL( *emptyText ); |
|
255 |
CleanupStack::PopAndDestroy( emptyText ); |
|
256 |
TRgb normalColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor(); |
|
257 |
iSearchTreeListVisualizer->RootNodeVisualizer()->SetNormalStateTextColor( normalColor ); |
|
258 |
||
259 |
// Create startup timer |
|
260 |
iStartupCallbackTimer = CFSEmailUiGenericTimer::NewL( this ); |
|
261 |
||
262 |
// Set page up and page down keys |
|
263 |
iSearchTreeListVisualizer->AddCustomPageUpKey( EStdKeyPageUp ); |
|
264 |
iSearchTreeListVisualizer->AddCustomPageDownKey( EStdKeyPageDown ); |
|
265 |
||
266 |
CAlfBrush* selectorBrush = iAppUi.FsTextureManager()->ListSelectorBrushL(); |
|
267 |
iSearchTreeListVisualizer->SetSelectorPropertiesL( selectorBrush, 1.0, CFsTreeVisualizerBase::EFsSelectorMoveSmoothly ); |
|
268 |
||
269 |
iAppUi.LayoutHandler()->SetListMarqueeBehaviour( iSearchList ); |
|
270 |
||
271 |
iFirstStartCompleted = ETrue; |
|
272 |
} |
|
273 |
||
274 |
void CFSEmailUiSearchListVisualiser::TimerEventL( CFSEmailUiGenericTimer* /*aTriggeredTimer*/ ) |
|
275 |
{ |
|
276 |
FUNC_LOG; |
|
277 |
LaunchSearchDialogL(); |
|
278 |
} |
|
279 |
||
280 |
CFSEmailUiSearchListVisualiser::CFSEmailUiSearchListVisualiser( CFreestyleEmailUiAppUi* aAppUi, |
|
281 |
CAlfEnv& aEnv, |
|
282 |
CAlfControlGroup& aSearchListControlGroup ) |
|
283 |
:CFsEmailUiViewBase( aSearchListControlGroup, *aAppUi ), |
|
284 |
iEnv( &aEnv ), |
|
285 |
iLatestSearchText( 0 ), |
|
286 |
iListAddedToControlGroup( EFalse ), |
|
287 |
iPreparedForExit( EFalse ), |
|
288 |
iConsumeStdKeyYes_KeyUp( EFalse ), // for consuming the call event if call for contact processed |
|
289 |
iRequiredSearchPriority( KStandardSearchPriority ) // for search email priority decreasing |
|
290 |
{ |
|
291 |
FUNC_LOG; |
|
292 |
} |
|
293 |
||
294 |
CFSEmailUiSearchListVisualiser::~CFSEmailUiSearchListVisualiser() |
|
295 |
{ |
|
296 |
FUNC_LOG; |
|
297 |
if ( iStartupCallbackTimer ) |
|
298 |
{ |
|
299 |
iStartupCallbackTimer->Cancel(); |
|
300 |
delete iStartupCallbackTimer; |
|
301 |
} |
|
302 |
iSearchStrings.ResetAndDestroy(); |
|
303 |
iSearchListItemArray.Reset(); |
|
304 |
delete iModel; |
|
305 |
delete iLatestSearchText; |
|
306 |
delete iSearchList; |
|
307 |
delete iStylusPopUpMenu; |
|
308 |
} |
|
309 |
||
310 |
void CFSEmailUiSearchListVisualiser::PrepareForExit() |
|
311 |
{ |
|
312 |
FUNC_LOG; |
|
313 |
//<cmail> Not needed anymore as controls aren't removed from control group |
|
314 |
/*if(!iListAddedToControlGroup) |
|
315 |
{ |
|
316 |
if(iSearchList && iSearchList->TreeControl()) |
|
317 |
TRAP_IGNORE(ControlGroup().AppendL( iSearchList->TreeControl() )); |
|
318 |
if(iSearchListControl) |
|
319 |
TRAP_IGNORE(ControlGroup().AppendL( iSearchListControl )); |
|
320 |
iListAddedToControlGroup = ETrue; |
|
321 |
}*/ |
|
322 |
//<cmail> |
|
323 |
if ( iSearchOngoing ) |
|
324 |
{ |
|
325 |
TRAP_IGNORE( StopSearchL() ); |
|
326 |
} |
|
327 |
delete iMailBox; |
|
328 |
iMailBox = NULL; |
|
329 |
TRAP_IGNORE( ResetResultListL() ); |
|
330 |
iPreparedForExit = ETrue; |
|
331 |
} |
|
332 |
||
333 |
TInt CFSEmailUiSearchListVisualiser::HighlightedIndex() const |
|
334 |
{ |
|
335 |
FUNC_LOG; |
|
336 |
TFsTreeItemId focusedId = static_cast<TFsTreeItemId>( iSearchList->FocusedItem() ); |
|
337 |
// Map id to the index in model |
|
338 |
TInt ret( KErrNotFound ); |
|
339 |
for ( TInt i=0; i<iSearchListItemArray.Count();i++ ) |
|
340 |
{ |
|
341 |
if ( focusedId == iSearchListItemArray[i].iSearchListItemId) |
|
342 |
{ |
|
343 |
ret = i; |
|
344 |
break; |
|
345 |
} |
|
346 |
} |
|
347 |
return ret; |
|
348 |
} |
|
349 |
||
350 |
||
351 |
TUid CFSEmailUiSearchListVisualiser::Id() const |
|
352 |
{ |
|
353 |
FUNC_LOG; |
|
354 |
return SearchListViewId; |
|
355 |
} |
|
356 |
||
357 |
// <cmail> Toolbar |
|
358 |
/*void CFSEmailUiSearchListVisualiser::DoActivateL(const TVwsViewId& aPrevViewId, |
|
359 |
TUid aCustomMessageId, |
|
360 |
const TDesC8& aCustomMessage)*/ |
|
361 |
void CFSEmailUiSearchListVisualiser::ChildDoActivateL(const TVwsViewId& aPrevViewId, |
|
362 |
TUid aCustomMessageId, |
|
363 |
const TDesC8& aCustomMessage) |
|
364 |
// </cmail> Toolbar |
|
365 |
{ |
|
366 |
FUNC_LOG; |
|
367 |
if ( !iFirstStartCompleted ) |
|
368 |
{ |
|
369 |
DoFirstStartL(); |
|
370 |
} |
|
371 |
||
372 |
// <cmail> |
|
373 |
//iSearchList->SetScrollbarVisibilityL( EFsScrollbarHideAlways ); |
|
374 |
if ( aCustomMessageId != KStartListReturnToPreviousFolder ) |
|
375 |
{ |
|
376 |
iBarTextVisual->SetTextL(KNullDesC); |
|
377 |
} |
|
378 |
||
379 |
if ( &aCustomMessage && aCustomMessageId == KStartNewSearch ) |
|
380 |
{ |
|
381 |
// If new search, clear old search list |
|
382 |
iSearchCount=0; |
|
383 |
iMsgDataCouldBeChanged = EFalse; |
|
384 |
// <cmail> fixed CS high cat. finding |
|
385 |
ResetResultListL(); |
|
386 |
} |
|
387 |
// </cmail> |
|
388 |
||
389 |
// Store previous view ID |
|
390 |
iPreviousViewUid = aPrevViewId.iViewUid; |
|
391 |
TSearchListActivationData subView; |
|
392 |
TPckgBuf<TSearchListActivationData> viewData( subView ); |
|
393 |
viewData.Copy( aCustomMessage ); |
|
394 |
subView = viewData(); |
|
395 |
||
396 |
// Update settings and set list mode according to settings |
|
397 |
UpdateMailListSettingsL(); |
|
398 |
||
399 |
if ( iMailBox ) |
|
400 |
{ |
|
401 |
delete iMailBox; |
|
402 |
iMailBox = NULL; |
|
403 |
} |
|
404 |
iMailBox = iAppUi.GetMailClient()->GetMailBoxByUidL( subView.iMailBoxId ); |
|
405 |
// If mailbox data is not, try to get default MCE account |
|
406 |
if ( !iMailBox ) |
|
407 |
{ |
|
408 |
CMsvSession* msvSession = iAppUi.GetMsvSession(); |
|
409 |
CFSMailClient* client = iAppUi.GetMailClient(); |
|
410 |
iMailBox = TFsEmailUiUtility::GetMceDefaultMailboxL( *client, *msvSession ); |
|
411 |
} |
|
412 |
||
413 |
if ( iMailBox ) |
|
414 |
{ |
|
415 |
iThisViewActive = ETrue; |
|
416 |
//<cmail> visible/unvisible is not controlled by opacity in cmail |
|
417 |
//TAlfTimedValue opacity; |
|
418 |
//opacity.SetValueNow( 1 ); |
|
419 |
//iScreenAnchorLayout->SetOpacity( opacity ); |
|
420 |
//</cmail> |
|
421 |
iSearchList->ShowListL(); |
|
422 |
iSearchList->SetFocusedL(ETrue); |
|
423 |
// Set empty text color |
|
424 |
TRgb normalColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor(); |
|
425 |
iSearchTreeListVisualizer->RootNodeVisualizer()->SetNormalStateTextColor( normalColor ); |
|
426 |
||
427 |
// Launch search dialog automatically when activated |
|
428 |
if ( &aCustomMessage && aCustomMessageId == KStartNewSearch ) |
|
429 |
{ |
|
430 |
// <cmail> list reseting moved into the begining of the function |
|
431 |
// requeset async launching of the search dialog because DoActivateL must |
|
432 |
// not be blocked |
|
433 |
iStartupCallbackTimer->Cancel(); // just in case |
|
434 |
iStartupCallbackTimer->Start( iAppUi.LayoutHandler()->ViewSlideEffectTime() ); |
|
435 |
} |
|
436 |
else if ( iModel && iModel->Count() ) |
|
437 |
{ |
|
438 |
// Need to make sure that return to this view works even if following function leaves. |
|
439 |
TRAP_IGNORE( CheckAndUpdateFocusedMessageL() ); |
|
440 |
} |
|
441 |
||
442 |
// Set mailbox name to status pane |
|
443 |
iAppUi.SetActiveMailboxNameToStatusPaneL(); |
|
444 |
} |
|
445 |
CAknEnv::Static()->GetCurrentGlobalUiZoom( iCurrentZoomLevel ); |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
446 |
// Set msk always empty when view is activated. |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
447 |
SetMskL(); |
64 | 448 |
// <cmail> |
449 |
ReScaleUiL(); // In case that Landscape/Portrait has changed. |
|
450 |
// </cmail> |
|
451 |
||
452 |
// <cmail> Touch |
|
453 |
iSearchList->SetFocusedL(ETrue); |
|
454 |
FocusVisibilityChange( iAppUi.IsFocusShown() ); |
|
455 |
// </cmail> |
|
456 |
} |
|
457 |
||
458 |
void CFSEmailUiSearchListVisualiser::ChildDoDeactivate() |
|
459 |
{ |
|
460 |
FUNC_LOG; |
|
461 |
if(iListAddedToControlGroup && (!iPreparedForExit)) |
|
462 |
{ |
|
463 |
iListAddedToControlGroup = EFalse; |
|
464 |
} |
|
465 |
iThisViewActive = EFalse; |
|
466 |
||
467 |
if ( !iAppUi.AppUiExitOngoing() ) |
|
468 |
{ |
|
469 |
if ( iSearchList->IsFocused() ) |
|
470 |
{ |
|
471 |
TRAP_IGNORE(iSearchList->SetFocusedL(EFalse)); |
|
472 |
} |
|
473 |
iSearchTreeListVisualizer->NotifyControlVisibilityChange( EFalse ); |
|
474 |
} |
|
475 |
} |
|
476 |
||
477 |
CFSEmailUiMailListModel* CFSEmailUiSearchListVisualiser::Model() |
|
478 |
{ |
|
479 |
FUNC_LOG; |
|
480 |
return iModel; |
|
481 |
} |
|
482 |
||
483 |
void CFSEmailUiSearchListVisualiser::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane ) |
|
484 |
{ |
|
485 |
FUNC_LOG; |
|
486 |
if ( iSearchList->Count() && iModel ) |
|
487 |
{ |
|
488 |
if ( aResourceId == R_FSEMAILUI_SEARCHLIST_MENUPANE ) |
|
489 |
{ |
|
490 |
if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) ) |
|
491 |
{ |
|
492 |
// remove help support in pf5250 |
|
493 |
aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue); |
|
494 |
} |
|
495 |
||
496 |
CFSEmailUiMailListModelItem* item = dynamic_cast<CFSEmailUiMailListModelItem*>(iModel->Item(HighlightedIndex())); |
|
497 |
if ( item && item->ModelItemType() == ETypeMailItem && |
|
498 |
item->MessagePtr().IsFlagSet( EFSMsgFlag_CalendarMsg ) ) |
|
499 |
{ |
|
500 |
// Highlighted mail is calendar msg |
|
501 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdMailActions, ETrue); |
|
502 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdCalActions, EFalse); |
|
503 |
} |
|
504 |
else |
|
505 |
{ |
|
506 |
// Highlighted mail is mail msg |
|
507 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdMailActions, EFalse); |
|
508 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdCalActions, ETrue); |
|
509 |
} |
|
510 |
||
511 |
// showing of mail-related options is dependent on focus |
|
512 |
// important for touch-only devices |
|
513 |
if ( IsFocusShown() ) |
|
514 |
{ |
|
515 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdOpen, EFalse); |
|
516 |
} |
|
517 |
else |
|
518 |
{ |
|
519 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdMore, ETrue); |
|
520 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdMailActions, ETrue); |
|
521 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdCalActions, ETrue); |
|
522 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdOpen, ETrue); |
|
523 |
} |
|
524 |
||
525 |
// remove message reader support because of problems with reading HTML mails |
|
526 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdReadEmail, ETrue); |
|
527 |
} |
|
528 |
} |
|
529 |
else |
|
530 |
{ |
|
531 |
if ( aResourceId == R_FSEMAILUI_SEARCHLIST_MENUPANE ) |
|
532 |
{ |
|
533 |
||
534 |
if (FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration )) |
|
535 |
{ |
|
536 |
// remove help support in pf5250 |
|
537 |
aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue); |
|
538 |
} |
|
539 |
||
540 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdMore, ETrue); |
|
541 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdMailActions, ETrue); |
|
542 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdCalActions, ETrue); |
|
543 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdOpen, ETrue); |
|
544 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdReadEmail, ETrue); |
|
545 |
} |
|
546 |
} |
|
547 |
||
548 |
if ( aResourceId == R_FSEMAILUI_SEARCHLIST_SUBMENU_ACTIONS || |
|
549 |
aResourceId == R_FSEMAILUI_SEARCHLIST_SUBMENU_CALEVENT_ACTIONS) |
|
550 |
{ |
|
551 |
if ( iSearchList->Count() ) |
|
552 |
{ |
|
553 |
CFSEmailUiMailListModelItem* item = dynamic_cast<CFSEmailUiMailListModelItem*>(iModel->Item(HighlightedIndex())); |
|
554 |
if ( item && item->ModelItemType() == ETypeMailItem ) |
|
555 |
{ |
|
556 |
CFSMailMessage* messagePtr = &item->MessagePtr(); |
|
557 |
if ( messagePtr && messagePtr->IsFlagSet( EFSMsgFlag_Read ) ) |
|
558 |
{ |
|
559 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdMarkAsRead, ETrue); |
|
560 |
} |
|
561 |
else |
|
562 |
{ |
|
563 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdMarkAsUnread, ETrue); |
|
564 |
} |
|
565 |
} |
|
566 |
} |
|
567 |
} |
|
568 |
||
569 |
if ( aResourceId == R_FSEMAILUI_SEARCHLIST_SUBMENU_CALEVENT_ACTIONS) |
|
570 |
{ |
|
571 |
if ( iSearchList->Count() ) |
|
572 |
{ |
|
573 |
CFSEmailUiMailListModelItem* item = dynamic_cast<CFSEmailUiMailListModelItem*>(iModel->Item(HighlightedIndex())); |
|
574 |
if ( item && item->ModelItemType() == ETypeMailItem ) |
|
575 |
{ |
|
576 |
CFSMailMessage* messagePtr = &item->MessagePtr(); |
|
577 |
if ( messagePtr && messagePtr->IsFlagSet( EFSMsgFlag_CalendarMsg ) ) |
|
578 |
{ |
|
579 |
TESMRMeetingRequestMethod mrMethod( EESMRMeetingRequestMethodUnknown ); |
|
580 |
if ( iAppUi.MrViewerInstanceL() ) |
|
581 |
{ |
|
582 |
// Search must be stopped, otherwise resolve will lead to crash |
|
583 |
if ( iSearchOngoing ) |
|
584 |
{ |
|
585 |
StopSearchL(); |
|
586 |
} |
|
587 |
mrMethod = iAppUi.MrViewerInstanceL()->ResolveMeetingRequestMethodL( item->MessagePtr() ); |
|
588 |
} |
|
589 |
switch ( mrMethod ) |
|
590 |
{ |
|
591 |
case EESMRMeetingRequestMethodRequest: |
|
592 |
{ |
|
593 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdCalRemoveFromCalendar, ETrue); |
|
594 |
} |
|
595 |
break; |
|
596 |
case EESMRMeetingRequestMethodCancellation: |
|
597 |
{ |
|
598 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdCalActionsAccept, ETrue); |
|
599 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdCalActionsTentative, ETrue); |
|
600 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdCalActionsDecline, ETrue); |
|
601 |
||
602 |
TBool supportsRemove = iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaRemoveFromCalendar ); |
|
603 |
if( !supportsRemove ) |
|
604 |
{ |
|
605 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdCalRemoveFromCalendar, ETrue); |
|
606 |
} |
|
607 |
} |
|
608 |
break; |
|
609 |
default: |
|
610 |
case EESMRMeetingRequestMethodUnknown: |
|
611 |
case EESMRMeetingRequestMethodResponse: |
|
612 |
{ |
|
613 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdCalRemoveFromCalendar, ETrue); |
|
614 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdCalActionsAccept, ETrue); |
|
615 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdCalActionsTentative, ETrue); |
|
616 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdCalActionsDecline, ETrue); |
|
617 |
} |
|
618 |
break; |
|
619 |
} |
|
620 |
} |
|
621 |
} |
|
622 |
||
623 |
} |
|
624 |
} |
|
625 |
||
626 |
||
627 |
if ( aResourceId == R_FSEMAILUI_SEARCHLIST_SUBMENU_MORE ) |
|
628 |
{ |
|
629 |
// <cmail> Prevent Download Manager opening with attachments |
|
630 |
// if ( iAppUi.DownloadInfoMediator() && !iAppUi.DownloadInfoMediator()->IsAnyAttachmentDownloads() ) |
|
631 |
// { |
|
632 |
// aMenuPane->SetItemDimmed(EFsEmailUiCmdDownloadManager, ETrue); |
|
633 |
// } |
|
634 |
// </cmail> |
|
635 |
} |
|
636 |
||
637 |
if (aResourceId == R_FSEMAILUI_SEARCHLIST_SUBMENU_ACTIONS) |
|
638 |
{ |
|
639 |
CFSEmailUiMailListModelItem* item = dynamic_cast<CFSEmailUiMailListModelItem*>(iModel->Item(HighlightedIndex())); |
|
640 |
if(item) // Coverity error fix Item could have been NULL |
|
641 |
{ |
|
642 |
CFSMailMessage* messagePtr = &item->MessagePtr(); |
|
643 |
TInt menuIndex( 0 ); |
|
644 |
||
645 |
//Get # of recipients |
|
646 |
TInt numRecipients(0); |
|
647 |
if ( messagePtr ) |
|
648 |
{ |
|
649 |
numRecipients =TFsEmailUiUtility::CountRecepients( messagePtr ); |
|
650 |
if ( numRecipients == 1 ) |
|
651 |
{ |
|
652 |
//check if the malbox ownmailaddress is same as the recipients email address. If not, then assume that the |
|
653 |
//email is a distribution list and we need to inc num of Recipients so that "Reply ALL" option appears in UI. |
|
654 |
if ( messagePtr->GetToRecipients().Count() ) |
|
655 |
{ |
|
656 |
if ( iAppUi.GetActiveMailbox()->OwnMailAddress().GetEmailAddress().Compare(messagePtr->GetToRecipients()[0]->GetEmailAddress()) ) |
|
657 |
{ |
|
658 |
numRecipients++; |
|
659 |
} |
|
660 |
} |
|
661 |
if ( messagePtr->GetCCRecipients().Count() ) |
|
662 |
{ |
|
663 |
if ( iAppUi.GetActiveMailbox()->OwnMailAddress().GetEmailAddress().Compare(messagePtr->GetCCRecipients()[0]->GetEmailAddress()) ) |
|
664 |
{ |
|
665 |
numRecipients++; |
|
666 |
} |
|
667 |
} |
|
668 |
if ( messagePtr->GetBCCRecipients().Count() ) |
|
669 |
{ |
|
670 |
if ( iAppUi.GetActiveMailbox()->OwnMailAddress().GetEmailAddress().Compare(messagePtr->GetBCCRecipients()[0]->GetEmailAddress()) ) |
|
671 |
{ |
|
672 |
numRecipients++; |
|
673 |
} |
|
674 |
} |
|
675 |
} |
|
676 |
||
677 |
} |
|
678 |
||
679 |
if ( numRecipients > 1 ) |
|
680 |
{ |
|
681 |
aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReplyAll, EFalse ); |
|
682 |
} |
|
683 |
else if ( aMenuPane->MenuItemExists( EFsEmailUiCmdActionsReplyAll, menuIndex ) ) |
|
684 |
{ |
|
685 |
aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReplyAll, ETrue ); |
|
686 |
} |
|
687 |
} |
|
688 |
} |
|
689 |
||
690 |
if ( !iSearchOngoing && aResourceId == R_FSEMAILUI_SEARCHLIST_MENUPANE ) |
|
691 |
{ |
|
692 |
if (FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration )) |
|
693 |
{ |
|
694 |
// remove help support in pf5250 |
|
695 |
aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue); |
|
696 |
} |
|
697 |
||
698 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdStopSearch, ETrue); |
|
699 |
if ( iSearchCount == 0 ) |
|
700 |
{ |
|
701 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdNewSearch, ETrue); |
|
702 |
} |
|
703 |
else |
|
704 |
{ |
|
705 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdSearch, ETrue); |
|
706 |
} |
|
707 |
} |
|
708 |
||
709 |
if ( iSearchOngoing && aResourceId == R_FSEMAILUI_SEARCHLIST_MENUPANE ) |
|
710 |
{ |
|
711 |
if (FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration )) |
|
712 |
{ |
|
713 |
// remove help support in pf5250 |
|
714 |
aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue); |
|
715 |
} |
|
716 |
||
717 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdSearch, ETrue); |
|
718 |
aMenuPane->SetItemDimmed(EFsEmailUiCmdNewSearch, ETrue); |
|
719 |
} |
|
720 |
||
721 |
iAppUi.ShortcutBinding().AppendShortcutHintsL( *aMenuPane, CFSEmailUiShortcutBinding::EContextSearchResults ); |
|
722 |
} |
|
723 |
||
724 |
void CFSEmailUiSearchListVisualiser::RefreshL() |
|
725 |
{ |
|
726 |
FUNC_LOG; |
|
727 |
if ( iFirstStartCompleted ) //Safety |
|
728 |
{ |
|
729 |
if ( iModel && iModel->Count() ) |
|
730 |
{ |
|
731 |
// Check if zoom level has been switched and refresh items if so |
|
732 |
TAknUiZoom prevZoomLevel = iCurrentZoomLevel; |
|
733 |
CAknEnv::Static()->GetCurrentGlobalUiZoom( iCurrentZoomLevel ); |
|
734 |
if ( prevZoomLevel != iCurrentZoomLevel ) |
|
735 |
{ |
|
736 |
for ( TInt i=0; i<iModel->Count(); i++ ) |
|
737 |
{ |
|
738 |
// Set font height |
|
739 |
iSearchListItemArray[i].iTreeItemVisualiser-> |
|
740 |
SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() ); |
|
741 |
iSearchTreeListVisualizer->UpdateItemL( iSearchListItemArray[i].iSearchListItemId ); |
|
742 |
} |
|
743 |
} |
|
744 |
} |
|
745 |
} |
|
746 |
} |
|
747 |
||
748 |
||
749 |
void CFSEmailUiSearchListVisualiser::CreatePlainNodeL( const TDesC& aItemDataBuff, |
|
750 |
CFsTreePlainOneLineNodeData* &aItemData, |
|
751 |
CFsTreePlainOneLineNodeVisualizer* &aNodeVisualizer ) const |
|
752 |
{ |
|
753 |
FUNC_LOG; |
|
754 |
aItemData = CFsTreePlainOneLineNodeData::NewL(); |
|
755 |
aItemData->SetDataL( aItemDataBuff ); |
|
756 |
aItemData->SetIconExpanded( iAppUi.FsTextureManager()->TextureByIndex(EListTextureNodeExpanded) ); |
|
757 |
aItemData->SetIconCollapsed( iAppUi.FsTextureManager()->TextureByIndex(EListTextureNodeCollapsed) ); |
|
758 |
aNodeVisualizer = CFsTreePlainOneLineNodeVisualizer::NewL( *iSearchList->TreeControl() ); |
|
759 |
TRect screenRect; |
|
760 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect ); |
|
761 |
TInt nodeHeight = iAppUi.LayoutHandler()->OneLineListNodeHeight(); |
|
762 |
aNodeVisualizer->SetSize( TSize(screenRect.Width(), nodeHeight) ); |
|
763 |
aNodeVisualizer->SetExtendable(EFalse); |
|
764 |
// Set correct skin text colors for the list items |
|
765 |
TRgb focusedColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor(); |
|
766 |
TRgb normalColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor(); |
|
767 |
aNodeVisualizer->SetFocusedStateTextColor( focusedColor ); |
|
768 |
aNodeVisualizer->SetNormalStateTextColor( normalColor ); |
|
769 |
} |
|
770 |
||
771 |
||
772 |
void CFSEmailUiSearchListVisualiser::HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType ) |
|
773 |
{ |
|
774 |
FUNC_LOG; |
|
775 |
CFsEmailUiViewBase::HandleDynamicVariantSwitchL( aType ); |
|
776 |
if ( iFirstStartCompleted ) // Safety |
|
777 |
{ |
|
778 |
if ( aType == EScreenLayoutChanged ) |
|
779 |
{ |
|
780 |
SetStatusBarLayout(); |
|
781 |
} |
|
782 |
||
783 |
if ( iSearchTreeListVisualizer ) |
|
784 |
{ |
|
785 |
TRgb normalColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor(); |
|
786 |
iSearchTreeListVisualizer->RootNodeVisualizer()->SetNormalStateTextColor( normalColor ); |
|
787 |
ReScaleUiL(); |
|
788 |
} |
|
789 |
} |
|
790 |
} |
|
791 |
||
792 |
void CFSEmailUiSearchListVisualiser::GetParentLayoutsL( RPointerArray<CAlfVisual>& aLayoutArray ) const |
|
793 |
{ |
|
794 |
aLayoutArray.Append( iScreenAnchorLayout ); |
|
795 |
} |
|
796 |
||
797 |
// --------------------------------------------------------------------------- |
|
798 |
// hide or show CAlfVisuals ( used for activation or deactivation ) |
|
799 |
// |
|
800 |
void CFSEmailUiSearchListVisualiser::FadeOut(TBool aDirectionOut ) |
|
801 |
{ |
|
802 |
FUNC_LOG; |
|
803 |
if ( iScreenAnchorLayout != NULL ) |
|
804 |
{ |
|
805 |
TAlfTimedValue timedValue( 0, 0 ); |
|
806 |
if ( !aDirectionOut ) |
|
807 |
{ |
|
808 |
timedValue.SetTarget( 1, 0 ); |
|
809 |
} |
|
810 |
iScreenAnchorLayout->SetOpacity( timedValue ); |
|
811 |
} |
|
812 |
} |
|
813 |
||
814 |
||
815 |
// ----------------------------------------------------------------------------- |
|
816 |
// CFSEmailUiMailListVisualiser::FlipStateChangedL |
|
817 |
// Called when keyboard flip state is changed |
|
818 |
// ----------------------------------------------------------------------------- |
|
819 |
// |
|
820 |
void CFSEmailUiSearchListVisualiser::FlipStateChangedL( TBool aKeyboardFlipOpen ) |
|
821 |
{ |
|
822 |
CFsEmailUiViewBase::FlipStateChangedL( aKeyboardFlipOpen ); |
|
823 |
iSearchTreeListVisualizer->SetFlipState( iKeyboardFlipOpen ); |
|
824 |
} |
|
825 |
||
826 |
// ----------------------------------------------------------------------------- |
|
827 |
// CFSEmailUiSearchListVisualiser::FocusVisibilityChange |
|
828 |
// ----------------------------------------------------------------------------- |
|
829 |
// |
|
830 |
void CFSEmailUiSearchListVisualiser::FocusVisibilityChange( |
|
831 |
TBool aVisible ) |
|
832 |
{ |
|
833 |
CFsEmailUiViewBase::FocusVisibilityChange( aVisible ); |
|
834 |
||
835 |
if ( iStylusPopUpMenuVisible && !aVisible ) |
|
836 |
{ |
|
837 |
// Do not allow to remove the focus from a list element if the pop up |
|
838 |
// menu was just launched. |
|
839 |
return; |
|
840 |
} |
|
841 |
||
842 |
iSearchTreeListVisualizer->SetFocusVisibility( aVisible ); |
|
843 |
} |
|
844 |
||
845 |
// --------------------------------------------------------------------------- |
|
846 |
// CFSEmailUiSearchListVisualiser::SetStatusBarLayout() |
|
847 |
// Sets status bar layout |
|
848 |
// --------------------------------------------------------------------------- |
|
849 |
// |
|
850 |
void CFSEmailUiSearchListVisualiser::SetStatusBarLayout() |
|
851 |
{ |
|
852 |
TInt res = R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT; |
|
853 |
if( Layout_Meta_Data::IsLandscapeOrientation() ) |
|
854 |
{ |
|
855 |
// landscape must use different layout |
|
856 |
res = R_AVKON_STATUS_PANE_LAYOUT_USUAL_EXT; |
|
857 |
} |
|
858 |
||
859 |
if ( StatusPane()->CurrentLayoutResId() != res ) |
|
860 |
{ |
|
861 |
TRAP_IGNORE( |
|
862 |
StatusPane()->SwitchLayoutL( res )); |
|
863 |
} |
|
864 |
} |
|
865 |
||
866 |
void CFSEmailUiSearchListVisualiser::HandleCommandL( TInt aCommand ) |
|
867 |
{ |
|
868 |
FUNC_LOG; |
|
869 |
||
870 |
||
871 |
switch ( aCommand ) |
|
872 |
{ |
|
873 |
case EAknSoftkeySelect: |
|
874 |
{ |
|
875 |
TInt modelCount(0); |
|
876 |
if ( iModel ) |
|
877 |
{ |
|
878 |
modelCount = iModel->Count(); |
|
879 |
} |
|
880 |
if ( modelCount ) // Safety check |
|
881 |
{ |
|
882 |
CFSEmailUiMailListModelItem* item = dynamic_cast<CFSEmailUiMailListModelItem*>(iModel->Item(HighlightedIndex())); |
|
883 |
if ( item && item->ModelItemType() == ETypeMailItem ) |
|
884 |
{ |
|
885 |
CFSMailMessage* messagePtr = &item->MessagePtr(); |
|
886 |
if ( messagePtr ) |
|
887 |
{ |
|
888 |
OpenHighlightedMailL(); |
|
889 |
} |
|
890 |
} |
|
891 |
} |
|
892 |
} |
|
893 |
break; |
|
894 |
case EAknSoftkeyBack: |
|
895 |
{ |
|
896 |
if ( !iAppUi.ViewSwitchingOngoing()) |
|
897 |
{ |
|
898 |
if ( iSearchOngoing ) |
|
899 |
{ |
|
900 |
StopSearchL(); |
|
901 |
} |
|
902 |
//<cmail> useless code removed |
|
903 |
//HBufC* searchText = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_FIND_DLG_SEARCH ); |
|
904 |
//iBarTextVisual->SetTextL( *searchText ); |
|
905 |
//CleanupStack::PopAndDestroy( searchText ); |
|
906 |
//</cmail> |
|
907 |
TVwsViewId viewId = TVwsViewId( KFSEmailUiUid, MailListId ); |
|
908 |
TMailListActivationData tmp; |
|
909 |
if ( iMsgDataCouldBeChanged ) |
|
910 |
{ |
|
911 |
tmp.iRequestRefresh = ETrue; |
|
912 |
iMsgDataCouldBeChanged = EFalse; // List starts a new search |
|
913 |
} |
|
914 |
const TPckgBuf<TMailListActivationData> pkgOut( tmp ); |
|
915 |
iAppUi.ReturnToPreviousViewL( pkgOut ); |
|
916 |
} |
|
917 |
} |
|
918 |
break; |
|
919 |
case EEikCmdExit: |
|
920 |
case EAknSoftkeyExit: |
|
921 |
case EFsEmailUiCmdExit: |
|
922 |
iAppUi.Exit(); |
|
923 |
break; |
|
924 |
case EFsEmailUiCmdCalActionsReplyAsMail: |
|
925 |
case EFsEmailUiCmdActionsReply: |
|
926 |
{ |
|
927 |
if ( iSearchList->Count() ) |
|
928 |
{ |
|
929 |
iMsgDataCouldBeChanged = ETrue; |
|
930 |
ReplyL( NULL ); // Function will check marked/highlighted msg |
|
931 |
} |
|
932 |
} |
|
933 |
break; |
|
934 |
case EFsEmailUiCmdActionsReplyAll: |
|
935 |
{ |
|
936 |
if ( iSearchList->Count() ) |
|
937 |
{ |
|
938 |
iMsgDataCouldBeChanged = ETrue; |
|
939 |
ReplyAllL( NULL ); // Function will check marked/highlighted msg |
|
940 |
} |
|
941 |
} |
|
942 |
break; |
|
943 |
case EFsEmailUiCmdCalActionsForwardAsMail: |
|
944 |
case EFsEmailUiCmdActionsForward: |
|
945 |
{ |
|
946 |
if ( iSearchList->Count() ) |
|
947 |
{ |
|
948 |
iMsgDataCouldBeChanged = ETrue; |
|
949 |
ForwardL( NULL ); // Function will check marked/highlighted msg |
|
950 |
} |
|
951 |
} |
|
952 |
break; |
|
953 |
case EFsEmailUiCmdGoToTop: |
|
954 |
{ |
|
955 |
if ( iSearchListItemArray.Count() ) |
|
956 |
{ |
|
957 |
TInt bottomItemId = iSearchListItemArray[0].iSearchListItemId; |
|
958 |
iSearchTreeListVisualizer->SetFocusedItemL( bottomItemId ); |
|
959 |
} |
|
960 |
} |
|
961 |
break; |
|
962 |
case EFsEmailUiCmdGoToBottom: |
|
963 |
{ |
|
964 |
if ( iSearchListItemArray.Count() ) |
|
965 |
{ |
|
966 |
TInt bottomItemId = iSearchListItemArray[ iSearchListItemArray.Count()-1 ].iSearchListItemId; |
|
967 |
iSearchTreeListVisualizer->SetFocusedItemL( bottomItemId ); |
|
968 |
} |
|
969 |
} |
|
970 |
break; |
|
971 |
case EFsEmailUiCmdPageUp: |
|
972 |
{ |
|
973 |
TKeyEvent simEvent = { EKeyPageUp, EStdKeyPageUp, 0, 0 }; |
|
974 |
iCoeEnv->SimulateKeyEventL( simEvent, EEventKey ); |
|
975 |
} |
|
976 |
break; |
|
977 |
case EFsEmailUiCmdPageDown: |
|
978 |
{ |
|
979 |
TKeyEvent simEvent = { EKeyPageDown, EStdKeyPageDown, 0, 0 }; |
|
980 |
iCoeEnv->SimulateKeyEventL( simEvent, EEventKey ); |
|
981 |
} |
|
982 |
break; |
|
983 |
||
984 |
case EFsEmailUiCmdActionsDeleteCalEvent: |
|
985 |
case EFsEmailUiCmdActionsDelete: |
|
986 |
{ |
|
987 |
if ( iSearchList->Count() ) |
|
988 |
{ |
|
989 |
DeleteFocusedMessageL(); |
|
990 |
} |
|
991 |
} |
|
992 |
break; |
|
993 |
case EAknSoftkeyOpen: |
|
994 |
if (!iAppUi.IsFocusShown()) |
|
995 |
{ |
|
996 |
iAppUi.SetFocusVisibility( ETrue); |
|
997 |
break; |
|
998 |
} |
|
999 |
case EFsEmailUiCmdOpen: |
|
1000 |
{ |
|
1001 |
if ( iSearchList->Count() ) |
|
1002 |
{ |
|
1003 |
OpenHighlightedMailL(); |
|
1004 |
} |
|
1005 |
} |
|
1006 |
break; |
|
1007 |
case EFsEmailUiCmdNewSearch: |
|
1008 |
case EFsEmailUiCmdSearch: |
|
1009 |
{ |
|
1010 |
LaunchSearchDialogL(); |
|
1011 |
} |
|
1012 |
break; |
|
1013 |
case EFsEmailUiCmdStopSearch: |
|
1014 |
{ |
|
1015 |
StopSearchL(); |
|
1016 |
} |
|
1017 |
break; |
|
1018 |
case EFsEmailUiCmdMessageDetails: |
|
1019 |
{ |
|
1020 |
if ( iSearchList->Count() ) |
|
1021 |
{ |
|
1022 |
CFSEmailUiMailListModelItem* item = |
|
1023 |
static_cast<CFSEmailUiMailListModelItem*>( Model()->Item( HighlightedIndex() ) ); |
|
1024 |
if ( item ) // Safety |
|
1025 |
{ |
|
1026 |
CFSMailMessage& msg = item->MessagePtr(); |
|
1027 |
||
1028 |
TMsgDetailsActivationData msgDetailsData; |
|
1029 |
msgDetailsData.iMailBoxId = msg.GetMailBoxId(); |
|
1030 |
msgDetailsData.iFolderId = msg.GetFolderId(); |
|
1031 |
msgDetailsData.iMessageId = msg.GetMessageId(); |
|
1032 |
||
1033 |
const TPckgBuf<TMsgDetailsActivationData> pkgOut( msgDetailsData ); |
|
1034 |
iAppUi.EnterFsEmailViewL( MsgDetailsViewId, KStartMsgDetailsToBeginning, pkgOut); |
|
1035 |
} |
|
1036 |
} |
|
1037 |
} |
|
1038 |
break; |
|
1039 |
case EFsEmailUiCmdHelp: |
|
1040 |
{ |
|
1041 |
TFsEmailUiUtility::LaunchHelpL( KFSE_HLP_LAUNCHER_GRID ); |
|
1042 |
} |
|
1043 |
break; |
|
1044 |
case EFsEmailUiCmdActionsCallSender: |
|
1045 |
{ |
|
1046 |
if ( iSearchList->Count() ) |
|
1047 |
{ |
|
1048 |
CallToSenderL(); |
|
1049 |
} |
|
1050 |
} |
|
1051 |
break; |
|
1052 |
case EFsEmailUiCmdActionsAddContact: |
|
1053 |
{ |
|
1054 |
if ( iSearchList->Count() ) |
|
1055 |
{ |
|
1056 |
CFSEmailUiMailListModelItem* item = dynamic_cast<CFSEmailUiMailListModelItem*>(iModel->Item(HighlightedIndex())); |
|
1057 |
if ( item && item->ModelItemType() == ETypeMailItem ) |
|
1058 |
{ |
|
1059 |
CFSMailAddress* fromAddress = item->MessagePtr().GetSender(); |
|
1060 |
TDesC* emailAddress(0); |
|
1061 |
if ( fromAddress ) |
|
1062 |
{ |
|
1063 |
emailAddress = &fromAddress->GetEmailAddress(); |
|
1064 |
} |
|
1065 |
if ( emailAddress && emailAddress->Length() ) |
|
1066 |
{ |
|
1067 |
TAddToContactsType aType; |
|
1068 |
//Query to "update existing" or "Create new" --> EFALSE = user choosed "cancel" |
|
1069 |
if ( CFsDelayedLoader::InstanceL()->GetContactHandlerL()->AddtoContactsQueryL( aType ) ) |
|
1070 |
{ |
|
1071 |
CFsDelayedLoader::InstanceL()->GetContactHandlerL()->AddToContactL( |
|
1072 |
*emailAddress, EContactUpdateEmail, aType, this ); |
|
1073 |
} |
|
1074 |
} |
|
1075 |
} |
|
1076 |
} |
|
1077 |
} |
|
1078 |
break; |
|
1079 |
case EFsEmailUiCmdMarkAsReadUnreadToggle: |
|
1080 |
{ |
|
1081 |
if ( iSearchList->Count() ) |
|
1082 |
{ |
|
1083 |
CFSEmailUiMailListModelItem* item = |
|
1084 |
static_cast<CFSEmailUiMailListModelItem*>( iModel->Item( HighlightedIndex() )); |
|
1085 |
if ( item && item->ModelItemType() == ETypeMailItem ) |
|
1086 |
{ |
|
1087 |
if ( item->MessagePtr().IsFlagSet(EFSMsgFlag_Read) ) |
|
1088 |
{ |
|
1089 |
HandleCommandL( EFsEmailUiCmdMarkAsUnread ); |
|
1090 |
} |
|
1091 |
else |
|
1092 |
{ |
|
1093 |
HandleCommandL( EFsEmailUiCmdMarkAsRead ); |
|
1094 |
} |
|
1095 |
} |
|
1096 |
} |
|
1097 |
} |
|
1098 |
break; |
|
1099 |
case EFsEmailUiCmdMarkAsUnread: |
|
1100 |
{ |
|
1101 |
ChangeReadStatusOfHighlightedL( EFalse ); |
|
1102 |
} |
|
1103 |
break; |
|
1104 |
case EFsEmailUiCmdMarkAsRead: |
|
1105 |
{ |
|
1106 |
ChangeReadStatusOfHighlightedL( ETrue ); |
|
1107 |
} |
|
1108 |
break; |
|
1109 |
case EFsEmailUiCmdCalActionsAccept: |
|
1110 |
case EFsEmailUiCmdCalActionsTentative: |
|
1111 |
case EFsEmailUiCmdCalActionsDecline: |
|
1112 |
case EFsEmailUiCmdCalRemoveFromCalendar: |
|
1113 |
{ |
|
1114 |
CFSEmailUiMailListModelItem* item = dynamic_cast<CFSEmailUiMailListModelItem*>(iModel->Item(HighlightedIndex())); |
|
1115 |
if ( item && item->ModelItemType() == ETypeMailItem && |
|
1116 |
item->MessagePtr().IsFlagSet( EFSMsgFlag_CalendarMsg ) ) |
|
1117 |
{ |
|
1118 |
ChangeReadStatusOfHighlightedL( ETrue ); |
|
1119 |
iAppUi.MailViewer().HandleMrCommandL( aCommand, |
|
1120 |
iAppUi.GetActiveMailbox()->GetId(), |
|
1121 |
item->MessagePtr().GetFolderId(), |
|
1122 |
item->MessagePtr().GetMessageId() ); |
|
1123 |
} |
|
1124 |
} |
|
1125 |
break; |
|
1126 |
// <cmail> Prevent Download Manager opening with attachments |
|
1127 |
// case EFsEmailUiCmdDownloadManager: |
|
1128 |
// { |
|
1129 |
// if (iSearchOngoing) |
|
1130 |
// { |
|
1131 |
// StopSearchL(); |
|
1132 |
// } |
|
1133 |
// iAppUi.EnterFsEmailViewL( DownloadManagerViewId ); |
|
1134 |
// } |
|
1135 |
// break; |
|
1136 |
// </cmail> |
|
1137 |
case EFsEmailUiCmdReadEmail: |
|
1138 |
{ |
|
1139 |
iAppUi.StartReadingEmailsL(); |
|
1140 |
} |
|
1141 |
break; |
|
1142 |
default: |
|
1143 |
break; |
|
1144 |
} |
|
1145 |
||
1146 |
// Check if the focus needs to be removed after selecting an command from |
|
1147 |
// the stylus popup menu. |
|
1148 |
if ( ( iStylusPopUpMenuVisible ) && |
|
1149 |
( aCommand == KErrCancel || |
|
1150 |
aCommand == EFsEmailUiCmdActionsDelete || |
|
1151 |
aCommand == EFsEmailUiCmdMarkAsRead || |
|
1152 |
aCommand == EFsEmailUiCmdMarkAsUnread || |
|
1153 |
aCommand == EFsEmailUiCmdActionsMove || |
|
1154 |
aCommand == EFsEmailUiCmdMarkingModeFromPopUp ) ) |
|
1155 |
{ |
|
1156 |
// We end up here if the user selects an option from the pop up menu |
|
1157 |
// or exits the menu by tapping outside of it's area. |
|
1158 |
// Remove the focus from a list item if an item is focused. |
|
1159 |
iStylusPopUpMenuVisible = EFalse; |
|
1160 |
iAppUi.SetFocusVisibility( EFalse ); |
|
1161 |
} |
|
1162 |
||
1163 |
} |
|
1164 |
||
1165 |
||
1166 |
TInt CFSEmailUiSearchListVisualiser::LaunchSearchDialogL() |
|
1167 |
{ |
|
1168 |
FUNC_LOG; |
|
1169 |
if ( !iLatestSearchText ) |
|
1170 |
{ |
|
1171 |
iLatestSearchText = HBufC::NewL( KMaxLengthOfSearchString ); |
|
1172 |
} |
|
1173 |
TPtr16 textData = iLatestSearchText->Des(); |
|
1174 |
CAknQueryDialog* dlg = CAknQueryDialog::NewL( textData ); |
|
1175 |
HBufC* searchPrompt = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_FIND_DLG_LABEL ); |
|
1176 |
dlg->SetPromptL(*searchPrompt); |
|
1177 |
CleanupStack::PopAndDestroy( searchPrompt ); |
|
1178 |
TInt ret = dlg->ExecuteLD( R_FSEMAILUI_FIND_MAIL_DIALOG ); |
|
1179 |
if ( ret ) |
|
1180 |
{ |
|
1181 |
// Stop any ongoing search before starting a new one |
|
1182 |
if ( iSearchOngoing ) |
|
1183 |
{ |
|
1184 |
StopSearchL(); |
|
1185 |
} |
|
1186 |
//<cmail> make list and header visible by showing control group |
|
1187 |
else if( !iListAddedToControlGroup ) |
|
1188 |
{ |
|
1189 |
//ControlGroup().AppendL( iSearchListControl ); |
|
1190 |
//ControlGroup().AppendL( iSearchList->TreeControl() ); |
|
1191 |
iListAddedToControlGroup = ETrue; |
|
1192 |
} |
|
1193 |
iSearchList->SetScrollbarVisibilityL( EFsScrollbarAuto ); |
|
1194 |
//</cmail> |
|
1195 |
// Set searching text |
|
1196 |
HBufC* searchText = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_FIND_DLG_SEARCHING ); |
|
1197 |
HBufC* finalText = HBufC::NewLC( searchText->Length() + iLatestSearchText->Length() + KSpace().Length() ); |
|
1198 |
finalText->Des().Append( *searchText ); |
|
1199 |
finalText->Des().Append( KSpace ); |
|
1200 |
finalText->Des().Append( *iLatestSearchText ); |
|
1201 |
iBarTextVisual->SetTextL( *finalText ); |
|
1202 |
CleanupStack::PopAndDestroy( finalText ); |
|
1203 |
CleanupStack::PopAndDestroy( searchText ); |
|
1204 |
StartSearchL(); |
|
1205 |
} |
|
1206 |
return ret; |
|
1207 |
} |
|
1208 |
||
1209 |
||
1210 |
void CFSEmailUiSearchListVisualiser::UpdateMailListSettingsL() |
|
1211 |
{ |
|
1212 |
FUNC_LOG; |
|
1213 |
if ( iAppUi.GetCRHandler() ) |
|
1214 |
{ |
|
1215 |
iNodesInUse = iAppUi.GetCRHandler()->TitleDividers(); |
|
1216 |
TInt lineValue = iAppUi.GetCRHandler()->MessageListLayout(); |
|
1217 |
TInt bodyPreviewValue = iAppUi.GetCRHandler()->BodyPreview(); |
|
1218 |
if ( lineValue == 1 ) // 1-line layouts |
|
1219 |
{ |
|
1220 |
if ( bodyPreviewValue == 0 ) |
|
1221 |
{ |
|
1222 |
iListMode = EListControlTypeSingleLinePreviewOff; |
|
1223 |
} |
|
1224 |
else |
|
1225 |
{ |
|
1226 |
iListMode = EListControlTypeSingleLinePreviewOn; |
|
1227 |
} |
|
1228 |
} |
|
1229 |
else // |
|
1230 |
{ |
|
1231 |
if ( bodyPreviewValue == 0 ) |
|
1232 |
{ |
|
1233 |
iListMode = EListControlTypeDoubleLinePreviewOff; |
|
1234 |
} |
|
1235 |
else |
|
1236 |
{ |
|
1237 |
iListMode = EListControlTypeDoubleLinePreviewOn; |
|
1238 |
} |
|
1239 |
} |
|
1240 |
} |
|
1241 |
else |
|
1242 |
{ |
|
1243 |
iNodesInUse = EListControlSeparatorDisabled; |
|
1244 |
iListMode = EListControlTypeDoubleLinePreviewOff; |
|
1245 |
} |
|
1246 |
} |
|
1247 |
||
1248 |
||
1249 |
TBool CFSEmailUiSearchListVisualiser::OfferEventL(const TAlfEvent& aEvent) |
|
1250 |
{ |
|
1251 |
FUNC_LOG; |
|
1252 |
TBool result(EFalse); |
|
1253 |
// On KeyUp of EStdKeyYes usually Call application is called - prevent it if call for contact was previously called |
|
1254 |
if ( iConsumeStdKeyYes_KeyUp && aEvent.IsKeyEvent() && (aEvent.Code() == EEventKeyUp )) |
|
1255 |
{ |
|
1256 |
iConsumeStdKeyYes_KeyUp = EFalse; // in case call button was consumed elsewhere first key up enables calling Call application |
|
1257 |
if ( EStdKeyYes == aEvent.KeyEvent().iScanCode) |
|
1258 |
{ |
|
1259 |
result = ETrue; // consume not to switch to Call application when call to contact was processed |
|
1260 |
} |
|
1261 |
} |
|
1262 |
||
1263 |
if ( aEvent.IsKeyEvent() && aEvent.Code() == EEventKey ) |
|
1264 |
{ |
|
1265 |
TInt scanCode = aEvent.KeyEvent().iScanCode; |
|
1266 |
// Swap right and left controls in mirrored layout |
|
1267 |
if ( AknLayoutUtils::LayoutMirrored() ) |
|
1268 |
{ |
|
1269 |
if ( scanCode == EStdKeyRightArrow ) scanCode = EStdKeyLeftArrow; |
|
1270 |
else if ( scanCode == EStdKeyLeftArrow ) scanCode = EStdKeyRightArrow; |
|
1271 |
} |
|
1272 |
// Handle possible focus visibility change |
|
1273 |
if ((scanCode == EStdKeyRightArrow) |
|
1274 |
|| (scanCode == EStdKeyLeftArrow) |
|
1275 |
|| (scanCode == EStdKeyUpArrow) |
|
1276 |
|| (scanCode == EStdKeyDownArrow) |
|
1277 |
|| (scanCode == EStdKeyEnter) |
|
1278 |
|| (scanCode == EStdKeyDeviceA) |
|
1279 |
|| (scanCode == EStdKeyDevice3)) |
|
1280 |
{ |
|
1281 |
// If the focus was not active already, ignore the key press |
|
1282 |
if( !iAppUi.SetFocusVisibility( ETrue ) ) |
|
1283 |
{ |
|
1284 |
return ETrue; |
|
1285 |
} |
|
1286 |
||
1287 |
} |
|
1288 |
switch ( scanCode ) |
|
1289 |
{ |
|
1290 |
case EStdKeyDevice3: // CENTER CLICK |
|
1291 |
case EStdKeyEnter: // ENTER EITHER SELECTS ITEM IN TOOLBAR OR OPENS MAIL |
|
1292 |
case EStdKeyNkpEnter: |
|
1293 |
{ |
|
1294 |
if ( iSearchList->Count() ) |
|
1295 |
{ |
|
1296 |
OpenHighlightedMailL(); |
|
1297 |
} |
|
1298 |
result = ETrue; |
|
1299 |
} |
|
1300 |
break; |
|
1301 |
case EStdKeyYes: |
|
1302 |
{ |
|
1303 |
if ( iSearchList->Count() ) |
|
1304 |
{ |
|
1305 |
result = CallToSenderL(); |
|
1306 |
iConsumeStdKeyYes_KeyUp = result; |
|
1307 |
} |
|
1308 |
} |
|
1309 |
break; |
|
1310 |
default: |
|
1311 |
{ |
|
1312 |
// check keyboard shortcuts: |
|
1313 |
TInt command = |
|
1314 |
iAppUi.ShortcutBinding().CommandForShortcutKey( aEvent.KeyEvent(), |
|
1315 |
CFSEmailUiShortcutBinding::EContextSearchResults ); |
|
1316 |
if ( command >= 0 ) |
|
1317 |
{ |
|
1318 |
HandleCommandL( command ); |
|
1319 |
result = ETrue; |
|
1320 |
} |
|
1321 |
} |
|
1322 |
break; |
|
1323 |
} |
|
1324 |
} |
|
1325 |
else if ( aEvent.IsPointerEvent() ) |
|
1326 |
{ |
|
1327 |
// event should be forwarded to list only if it |
|
1328 |
// contains at least one item |
|
1329 |
if ( iModel->Count() ) |
|
1330 |
{ |
|
1331 |
result = iSearchList->TreeControl()->OfferEventL( aEvent ); |
|
1332 |
} |
|
1333 |
else |
|
1334 |
{ |
|
1335 |
// otherwise we consume it so no other ALF controls gets it |
|
1336 |
// e.g. ControlBar |
|
1337 |
result = ETrue; |
|
1338 |
} |
|
1339 |
} |
|
1340 |
||
1341 |
return result; |
|
1342 |
} |
|
1343 |
||
1344 |
||
1345 |
||
1346 |
void CFSEmailUiSearchListVisualiser::ReScaleUiL() |
|
1347 |
{ |
|
1348 |
FUNC_LOG; |
|
1349 |
if ( iFirstStartCompleted ) //Safety |
|
1350 |
{ |
|
1351 |
SetSearchListLayoutAnchors(); |
|
1352 |
iScreenAnchorLayout->UpdateChildrenLayout(); |
|
1353 |
iSearchListLayout->UpdateChildrenLayout(); |
|
1354 |
// Set bar text color from skin |
|
1355 |
if ( iBarTextVisual ) |
|
1356 |
{ |
|
1357 |
//<cmail> |
|
1358 |
SetHeaderAttributesL(); |
|
1359 |
/*TRgb barTextColor( KRgbBlack ); |
|
1360 |
AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), |
|
1361 |
barTextColor, KAknsIIDFsTextColors, EAknsCIFsTextColorsCG10 ); |
|
1362 |
iBarTextVisual->SetColor( barTextColor );*/ |
|
1363 |
//</cmail> |
|
1364 |
} |
|
1365 |
RefreshL(); |
|
1366 |
//iSearchTreeListVisualizer->HideList(); |
|
1367 |
iSearchTreeListVisualizer->ShowListL(); |
|
1368 |
} |
|
1369 |
} |
|
1370 |
||
1371 |
void CFSEmailUiSearchListVisualiser::SetSearchListLayoutAnchors() |
|
1372 |
{ |
|
1373 |
FUNC_LOG; |
|
1374 |
// Set anchors |
|
1375 |
||
1376 |
// The anchor layout mirrors itself automatically when necessary. |
|
1377 |
// There's no need to mirror anything manually here. |
|
1378 |
||
1379 |
// TEXT |
|
1380 |
TRect textRect = iAppUi.LayoutHandler()->GetSearchListHeaderTextLayout().TextRect(); |
|
1381 |
TPoint tl = textRect.iTl; |
|
1382 |
iScreenAnchorLayout->SetAnchor(EAlfAnchorTopLeft, 0, |
|
1383 |
EAlfAnchorOriginLeft, EAlfAnchorOriginTop, |
|
1384 |
EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, |
|
1385 |
TAlfTimedPoint( tl.iX, tl.iY )); |
|
1386 |
TPoint br = textRect.iBr; |
|
1387 |
iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 0, |
|
1388 |
EAlfAnchorOriginLeft, EAlfAnchorOriginTop, |
|
1389 |
EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, |
|
1390 |
TAlfTimedPoint( br.iX, br.iY )); |
|
1391 |
||
1392 |
TRect listRect = iAppUi.LayoutHandler()->GetListRect( ETrue ); |
|
1393 |
iScreenAnchorLayout->SetAnchor(EAlfAnchorTopLeft, 1, |
|
1394 |
EAlfAnchorOriginLeft, EAlfAnchorOriginTop, |
|
1395 |
EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, |
|
1396 |
TAlfTimedPoint(listRect.iTl.iX, listRect.iTl.iY)); |
|
1397 |
iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 1, |
|
1398 |
EAlfAnchorOriginLeft, EAlfAnchorOriginTop, |
|
1399 |
EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, |
|
1400 |
TAlfTimedPoint(listRect.iBr.iX, listRect.iBr.iY)); |
|
1401 |
} |
|
1402 |
||
1403 |
||
1404 |
TFSMailMsgId CFSEmailUiSearchListVisualiser::MsgIdFromIndex( TInt aItemIdx ) const |
|
1405 |
{ |
|
1406 |
FUNC_LOG; |
|
1407 |
TFSMailMsgId msgId; // constructs null ID |
|
1408 |
if ( 0 <= aItemIdx && aItemIdx < iModel->Count() ) |
|
1409 |
{ |
|
1410 |
CFSEmailUiMailListModelItem* item = |
|
1411 |
static_cast<CFSEmailUiMailListModelItem*>(iModel->Item(aItemIdx)); |
|
1412 |
if ( item && item->ModelItemType() == ETypeMailItem ) |
|
1413 |
{ |
|
1414 |
msgId = item->MessagePtr().GetMessageId(); |
|
1415 |
} |
|
1416 |
} |
|
1417 |
||
1418 |
return msgId; |
|
1419 |
} |
|
1420 |
||
1421 |
TFSMailMsgId CFSEmailUiSearchListVisualiser::MsgIdFromListId( TFsTreeItemId aListId ) const |
|
1422 |
{ |
|
1423 |
FUNC_LOG; |
|
1424 |
TFSMailMsgId msgId; |
|
1425 |
for ( TInt i=0; i<iModel->Count();i++) |
|
1426 |
{ |
|
1427 |
CFSEmailUiMailListModelItem* item = |
|
1428 |
static_cast<CFSEmailUiMailListModelItem*>(iModel->Item(i)); |
|
1429 |
if ( item && item->ModelItemType() == ETypeMailItem && |
|
1430 |
aListId == item->CorrespondingListId() ) |
|
1431 |
{ |
|
1432 |
msgId = item->MessagePtr().GetMessageId(); |
|
1433 |
break; |
|
1434 |
} |
|
1435 |
} |
|
1436 |
return msgId; |
|
1437 |
} |
|
1438 |
||
1439 |
CFSMailMessage& CFSEmailUiSearchListVisualiser::MsgPtrFromListId( TFsTreeItemId aListId ) |
|
1440 |
{ |
|
1441 |
FUNC_LOG; |
|
1442 |
CFSMailMessage* msgPtr(NULL); |
|
1443 |
for ( TInt i=0; i<iModel->Count();i++) |
|
1444 |
{ |
|
1445 |
CFSEmailUiMailListModelItem* item = |
|
1446 |
static_cast<CFSEmailUiMailListModelItem*>(iModel->Item(i)); |
|
1447 |
if ( item && aListId == item->CorrespondingListId() ) |
|
1448 |
{ |
|
1449 |
msgPtr = &item->MessagePtr(); |
|
1450 |
} |
|
1451 |
} |
|
1452 |
return *msgPtr; |
|
1453 |
} |
|
1454 |
||
1455 |
// Item data and visualiser helper functions |
|
1456 |
MFsTreeItemData* CFSEmailUiSearchListVisualiser::ItemDataFromItemId( TFsTreeItemId aItemId ) |
|
1457 |
{ |
|
1458 |
FUNC_LOG; |
|
1459 |
TInt i(0); |
|
1460 |
MFsTreeItemData* itemData(NULL); |
|
1461 |
for ( ; i<iSearchListItemArray.Count(); i++ ) |
|
1462 |
{ |
|
1463 |
if ( aItemId == iSearchListItemArray[i].iSearchListItemId ) |
|
1464 |
{ |
|
1465 |
itemData = iSearchListItemArray[i].iTreeItemData; |
|
1466 |
} |
|
1467 |
} |
|
1468 |
return itemData; |
|
1469 |
} |
|
1470 |
||
1471 |
MFsTreeItemVisualizer* CFSEmailUiSearchListVisualiser::ItemVisualiserFromItemId( TFsTreeItemId aItemId ) |
|
1472 |
{ |
|
1473 |
FUNC_LOG; |
|
1474 |
TInt i(0); |
|
1475 |
MFsTreeItemVisualizer* itemVis(NULL); |
|
1476 |
for ( ; i<iSearchListItemArray.Count(); i++ ) |
|
1477 |
{ |
|
1478 |
if ( aItemId == iSearchListItemArray[i].iSearchListItemId ) |
|
1479 |
{ |
|
1480 |
itemVis = iSearchListItemArray[i].iTreeItemVisualiser; |
|
1481 |
} |
|
1482 |
} |
|
1483 |
return itemVis; |
|
1484 |
} |
|
1485 |
||
1486 |
// Helpers to get the ordinal of a message in the iModel |
|
1487 |
TInt CFSEmailUiSearchListVisualiser::ItemIndexFromMessageId( const TFSMailMsgId& aMessageId ) const |
|
1488 |
{ |
|
1489 |
FUNC_LOG; |
|
1490 |
TInt idx = KErrNotFound; |
|
1491 |
||
1492 |
for ( TInt i=0; i<iModel->Count() ; i++ ) |
|
1493 |
{ |
|
1494 |
CFSEmailUiMailListModelItem* item = |
|
1495 |
static_cast<CFSEmailUiMailListModelItem*>(iModel->Item(i)); |
|
1496 |
if ( item && item->ModelItemType() == ETypeMailItem && |
|
1497 |
aMessageId == item->MessagePtr().GetMessageId() ) |
|
1498 |
{ |
|
1499 |
idx = i; |
|
1500 |
break; |
|
1501 |
} |
|
1502 |
} |
|
1503 |
||
1504 |
return idx; |
|
1505 |
} |
|
1506 |
||
1507 |
TInt CFSEmailUiSearchListVisualiser::NextMessageIndex( TInt aCurMsgIdx ) const |
|
1508 |
{ |
|
1509 |
FUNC_LOG; |
|
1510 |
TInt idx = KErrNotFound; |
|
1511 |
||
1512 |
for ( TInt i=aCurMsgIdx+1 ; i<iModel->Count() ; i++ ) |
|
1513 |
{ |
|
1514 |
CFSEmailUiMailListModelItem* item = |
|
1515 |
static_cast<CFSEmailUiMailListModelItem*>(iModel->Item(i)); |
|
1516 |
if ( item && item->ModelItemType() == ETypeMailItem ) |
|
1517 |
{ |
|
1518 |
idx = i; |
|
1519 |
break; |
|
1520 |
} |
|
1521 |
} |
|
1522 |
||
1523 |
return idx; |
|
1524 |
} |
|
1525 |
||
1526 |
TInt CFSEmailUiSearchListVisualiser::PreviousMessageIndex( TInt aCurMsgIdx ) const |
|
1527 |
{ |
|
1528 |
FUNC_LOG; |
|
1529 |
TInt idx = KErrNotFound; |
|
1530 |
||
1531 |
if ( aCurMsgIdx < iModel->Count() ) |
|
1532 |
{ |
|
1533 |
for ( TInt i=aCurMsgIdx-1 ; i>=0 ; i-- ) |
|
1534 |
{ |
|
1535 |
CFSEmailUiMailListModelItem* item = |
|
1536 |
static_cast<CFSEmailUiMailListModelItem*>(iModel->Item(i)); |
|
1537 |
if ( item && item->ModelItemType() == ETypeMailItem ) |
|
1538 |
{ |
|
1539 |
idx = i; |
|
1540 |
break; |
|
1541 |
} |
|
1542 |
} |
|
1543 |
} |
|
1544 |
||
1545 |
return idx; |
|
1546 |
} |
|
1547 |
||
1548 |
||
1549 |
void CFSEmailUiSearchListVisualiser::OpenHighlightedMailL() |
|
1550 |
{ |
|
1551 |
FUNC_LOG; |
|
1552 |
if (iSearchOngoing) |
|
1553 |
{ |
|
1554 |
StopSearchL(); |
|
1555 |
} |
|
1556 |
||
1557 |
CFSEmailUiMailListModelItem* item = |
|
1558 |
static_cast<CFSEmailUiMailListModelItem*>( iModel->Item( HighlightedIndex() ) ); |
|
1559 |
if ( item && item->ModelItemType() == ETypeMailItem ) |
|
1560 |
{ |
|
1561 |
// First make sure that the highlighted message really exists in the store |
|
1562 |
// Get confirmed msg ptr |
|
1563 |
CFSMailMessage* confirmedMsgPtr(0); |
|
1564 |
TRAPD( err, confirmedMsgPtr = iAppUi.GetMailClient()->GetMessageByUidL(iAppUi.GetActiveMailboxId(), |
|
1565 |
item->MessagePtr().GetFolderId(), item->MessagePtr().GetMessageId(), EFSMsgDataEnvelope ) ); |
|
1566 |
if ( confirmedMsgPtr && err == KErrNone ) |
|
1567 |
{ |
|
1568 |
CFSMailFolder* highlightedMsgFolder = |
|
1569 |
iAppUi.GetMailClient()->GetFolderByUidL( iAppUi.GetActiveMailboxId(), confirmedMsgPtr->GetFolderId() ); |
|
1570 |
CleanupStack::PushL( highlightedMsgFolder ); |
|
1571 |
TInt msgFolderType = highlightedMsgFolder->GetFolderType(); |
|
1572 |
TFSMailMsgId highlightedMsgFolderId = highlightedMsgFolder->GetFolderId(); |
|
1573 |
CleanupStack::PopAndDestroy( highlightedMsgFolder ); |
|
1574 |
// Pointer confirmed, store Id and delete not needed anymore |
|
1575 |
TFSMailMsgId confirmedId = confirmedMsgPtr->GetMessageId(); |
|
1576 |
delete confirmedMsgPtr; |
|
1577 |
||
1578 |
// Open to editor from drafts |
|
1579 |
if ( msgFolderType == EFSDraftsFolder ) |
|
1580 |
{ |
|
1581 |
TEditorLaunchParams params; |
|
1582 |
params.iMailboxId = iAppUi.GetActiveMailboxId(); |
|
1583 |
params.iActivatedExternally = EFalse; |
|
1584 |
params.iMsgId = confirmedId; |
|
1585 |
params.iFolderId = highlightedMsgFolderId; |
|
1586 |
iAppUi.LaunchEditorL( KEditorCmdOpen, params ); |
|
1587 |
} |
|
1588 |
else if ( msgFolderType == EFSOutbox ) |
|
1589 |
{ |
|
1590 |
TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_OPEN_FROM_OUTBOX_NOTE, ETrue ); |
|
1591 |
} |
|
1592 |
else |
|
1593 |
{ |
|
1594 |
THtmlViewerActivationData tmp; |
|
1595 |
tmp.iMailBoxId = iAppUi.GetActiveMailbox()->GetId(); |
|
1596 |
tmp.iMessageId = confirmedId; |
|
1597 |
tmp.iFolderId = highlightedMsgFolderId; |
|
1598 |
||
1599 |
const TPckgBuf<THtmlViewerActivationData> pkgOut( tmp ); |
|
1600 |
ChangeReadStatusOfHighlightedL( ETrue ); |
|
1601 |
iAppUi.EnterFsEmailViewL( HtmlViewerId, KStartViewerWithMsgId, pkgOut ); |
|
1602 |
} |
|
1603 |
} |
|
1604 |
else if ( err == KErrNotFound ) |
|
1605 |
{ |
|
1606 |
TRAP_IGNORE( CheckAndUpdateFocusedMessageL() ); |
|
1607 |
} |
|
1608 |
} |
|
1609 |
} |
|
1610 |
||
1611 |
||
1612 |
||
1613 |
void CFSEmailUiSearchListVisualiser::ReplyL( CFSMailMessage* aMsgPtr ) |
|
1614 |
{ |
|
1615 |
FUNC_LOG; |
|
1616 |
DoReplyForwardL( KEditorCmdReply, aMsgPtr ); |
|
1617 |
} |
|
1618 |
||
1619 |
void CFSEmailUiSearchListVisualiser::ReplyAllL( CFSMailMessage* aMsgPtr ) |
|
1620 |
{ |
|
1621 |
FUNC_LOG; |
|
1622 |
DoReplyForwardL( KEditorCmdReplyAll, aMsgPtr ); |
|
1623 |
} |
|
1624 |
||
1625 |
void CFSEmailUiSearchListVisualiser::ForwardL( CFSMailMessage* aMsgPtr ) |
|
1626 |
{ |
|
1627 |
FUNC_LOG; |
|
1628 |
DoReplyForwardL( KEditorCmdForward, aMsgPtr ); |
|
1629 |
} |
|
1630 |
||
1631 |
void CFSEmailUiSearchListVisualiser::DoReplyForwardL( TEditorLaunchMode aMode, CFSMailMessage* aMsgPtr ) |
|
1632 |
{ |
|
1633 |
FUNC_LOG; |
|
1634 |
// Stop search when reply/forward has been selected |
|
1635 |
if ( iSearchOngoing ) |
|
1636 |
{ |
|
1637 |
StopSearchL(); |
|
1638 |
} |
|
1639 |
||
1640 |
if ( iModel->Count() ) |
|
1641 |
{ |
|
1642 |
CFSMailMessage* messagePointer = aMsgPtr; |
|
1643 |
if ( !messagePointer ) |
|
1644 |
{ |
|
1645 |
RFsTreeItemIdList markedEntries; |
|
1646 |
iSearchList->GetMarkedItemsL( markedEntries ); |
|
1647 |
TInt markedCount = markedEntries.Count(); |
|
1648 |
if ( markedCount == 0 ) |
|
1649 |
{ |
|
1650 |
CFSEmailUiMailListModelItem* item = NULL; |
|
1651 |
item = dynamic_cast<CFSEmailUiMailListModelItem*>(iModel->Item(HighlightedIndex())); |
|
1652 |
if (item) |
|
1653 |
{ |
|
1654 |
messagePointer = &item->MessagePtr(); |
|
1655 |
} |
|
1656 |
} |
|
1657 |
else if ( markedCount == 1) |
|
1658 |
{ |
|
1659 |
messagePointer = &MsgPtrFromListId( markedEntries[0] ); |
|
1660 |
} |
|
1661 |
} |
|
1662 |
if ( messagePointer ) |
|
1663 |
{ |
|
1664 |
// No reply/Forward for calendar messages, at least not in 1.0 |
|
1665 |
if ( !messagePointer->IsFlagSet( EFSMsgFlag_CalendarMsg ) ) |
|
1666 |
{ |
|
1667 |
TEditorLaunchParams params; |
|
1668 |
params.iMailboxId = iAppUi.GetActiveMailboxId(); |
|
1669 |
params.iActivatedExternally = EFalse; |
|
1670 |
params.iMsgId = messagePointer->GetMessageId(); |
|
1671 |
iAppUi.LaunchEditorL( aMode, params ); |
|
1672 |
} |
|
1673 |
} |
|
1674 |
} |
|
1675 |
} |
|
1676 |
||
1677 |
void CFSEmailUiSearchListVisualiser::StartSearchL() |
|
1678 |
{ |
|
1679 |
FUNC_LOG; |
|
1680 |
iSearchCount++; |
|
1681 |
||
1682 |
// Reset previous results before starting new search |
|
1683 |
// <cmail> fixed CS high cat. finding |
|
1684 |
ResetResultListL(); |
|
1685 |
TLex lex( *iLatestSearchText ); |
|
1686 |
while ( !lex.Eos() ) |
|
1687 |
{ |
|
1688 |
HBufC* token = lex.NextToken().AllocLC(); |
|
1689 |
||
1690 |
iSearchStrings.AppendL( token ); |
|
1691 |
||
1692 |
CleanupStack::Pop( token ); |
|
1693 |
} |
|
1694 |
||
1695 |
TFSMailSortCriteria sortCriteria; |
|
1696 |
sortCriteria.iField = EFSMailSortByDate; |
|
1697 |
sortCriteria.iOrder = EFSMailDescending; |
|
1698 |
iSearchOngoing = ETrue; |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
1699 |
// Model and list is set to be empty, set also MSK to empty |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
1700 |
SetMskL(); |
64 | 1701 |
// Initialisr TextSearcher |
1702 |
||
1703 |
// Start search. |
|
1704 |
iMailBox->SearchL( iSearchStrings, sortCriteria, *this ); |
|
1705 |
} |
|
1706 |
||
1707 |
void CFSEmailUiSearchListVisualiser::StopSearchL() |
|
1708 |
{ |
|
1709 |
FUNC_LOG; |
|
1710 |
iSearchOngoing = EFalse; |
|
1711 |
if ( iMailBox ) |
|
1712 |
{ |
|
1713 |
iMailBox->CancelSearch(); |
|
1714 |
} |
|
1715 |
HBufC* searchText = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_FIND_DLG_SEARCH_RESULTS ); |
|
1716 |
HBufC* finalText = HBufC::NewLC( searchText->Length() + iLatestSearchText->Length() + 4 ); |
|
1717 |
finalText->Des().Append( *searchText ); |
|
1718 |
finalText->Des().Append( KSpace ); |
|
1719 |
finalText->Des().Append( *iLatestSearchText ); |
|
1720 |
iBarTextVisual->SetTextL( *finalText ); |
|
1721 |
CleanupStack::PopAndDestroy( finalText ); |
|
1722 |
CleanupStack::PopAndDestroy( searchText ); |
|
1723 |
iRequiredSearchPriority = KStandardSearchPriority; // <cmail> return back |
|
1724 |
} |
|
1725 |
||
1726 |
void CFSEmailUiSearchListVisualiser::ResetResultListL() |
|
1727 |
{ |
|
1728 |
FUNC_LOG; |
|
1729 |
if( iModel ) |
|
1730 |
{ |
|
1731 |
iModel->Reset(); |
|
1732 |
} |
|
1733 |
if( iSearchList ) |
|
1734 |
{ |
|
1735 |
iSearchList->RemoveAllL(); |
|
1736 |
} |
|
1737 |
iSearchListItemArray.Reset(); |
|
1738 |
iSearchStrings.ResetAndDestroy(); |
|
1739 |
} |
|
1740 |
||
1741 |
void CFSEmailUiSearchListVisualiser::MatchFoundL( CFSMailMessage* aMatchMessage ) |
|
1742 |
{ |
|
1743 |
FUNC_LOG; |
|
1744 |
||
1745 |
if ( !iSearchList->IsFocused() ) |
|
1746 |
{ |
|
1747 |
iSearchList->SetFocusedL( ETrue ); |
|
1748 |
} |
|
1749 |
||
1750 |
// Delete receved owned object and add confirmed msg pointer to model insteaed |
|
1751 |
// This is done because it seems that matched message objects seems to be different |
|
1752 |
// in some protocols than original messages |
|
1753 |
CleanupStack::PushL( aMatchMessage ); |
|
1754 |
CFSMailMessage* confirmedMsgPtr = iAppUi.GetMailClient()->GetMessageByUidL( iAppUi.GetActiveMailboxId(), |
|
1755 |
aMatchMessage->GetFolderId(), aMatchMessage->GetMessageId(), EFSMsgDataEnvelope ); |
|
1756 |
CleanupStack::PopAndDestroy( aMatchMessage ); |
|
1757 |
||
1758 |
if ( confirmedMsgPtr ) // Append item into model and list if msg pointer was confirmed |
|
1759 |
{ |
|
1760 |
// Append to model |
|
1761 |
CFSEmailUiMailListModelItem* newItem = CFSEmailUiMailListModelItem::NewL( confirmedMsgPtr, ETypeMailItem); |
|
1762 |
iModel->AppendL(newItem); |
|
1763 |
||
1764 |
// Append to list |
|
1765 |
TRect screenRect; |
|
1766 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect ); |
|
1767 |
||
1768 |
CFSMailAddress* fromAddress = confirmedMsgPtr->GetSender(); |
|
1769 |
TDesC* diplayName = NULL; |
|
1770 |
if ( fromAddress ) |
|
1771 |
{ |
|
1772 |
diplayName = &fromAddress->GetDisplayName(); |
|
1773 |
} |
|
1774 |
||
1775 |
// Set first line of data |
|
1776 |
HBufC* dispName = NULL; |
|
1777 |
if ( fromAddress && diplayName && diplayName->Length() != 0 ) |
|
1778 |
{ |
|
1779 |
dispName = HBufC::NewLC( diplayName->Length() ); |
|
1780 |
dispName->Des().Append( *diplayName ); |
|
1781 |
} |
|
1782 |
else if ( fromAddress && fromAddress->GetEmailAddress().Length() != 0 ) |
|
1783 |
{ |
|
1784 |
dispName = HBufC::NewLC( fromAddress->GetEmailAddress().Length() ); |
|
1785 |
dispName->Des().Append( fromAddress->GetEmailAddress() ); |
|
1786 |
} |
|
1787 |
else |
|
1788 |
{ |
|
1789 |
dispName = HBufC::NewLC( 0 ); |
|
1790 |
dispName->Des().Append( KNullDesC ); |
|
1791 |
} |
|
1792 |
||
1793 |
// Drop out unwanted characters from display name such as <> and "" |
|
1794 |
// And set display name data |
|
1795 |
if ( dispName ) |
|
1796 |
{ |
|
1797 |
TFsEmailUiUtility::StripDisplayName( *dispName ); |
|
1798 |
} |
|
1799 |
// Create item data and |
|
1800 |
CFsTreePlainTwoLineItemData* itemData = CFsTreePlainTwoLineItemData::NewL(); |
|
1801 |
||
1802 |
itemData->SetDataL( *dispName ); |
|
1803 |
CleanupStack::PopAndDestroy( dispName ); |
|
1804 |
||
1805 |
// Set time text data |
|
1806 |
HBufC* timeText = TFsEmailUiUtility::ListMsgTimeTextFromMsgLC( confirmedMsgPtr, EFalse ); |
|
1807 |
itemData->SetDateTimeDataL ( *timeText ); |
|
1808 |
CleanupStack::PopAndDestroy(); |
|
1809 |
||
1810 |
// Set second line of data |
|
1811 |
HBufC* subjectText = TFsEmailUiUtility::CreateSubjectTextLC( confirmedMsgPtr ); |
|
1812 |
itemData->SetSecondaryDataL( *subjectText ); |
|
1813 |
CleanupStack::PopAndDestroy( subjectText ); |
|
1814 |
||
1815 |
// Set message icon |
|
1816 |
CAlfTexture* itemTexture = &TFsEmailUiUtility::GetMsgIcon( confirmedMsgPtr, *iAppUi.FsTextureManager() ); |
|
1817 |
itemData->SetIcon ( *itemTexture ); |
|
1818 |
CFsTreePlainTwoLineItemVisualizer* itemVisualizer = CFsTreePlainTwoLineItemVisualizer::NewL(*iSearchList->TreeControl()); |
|
1819 |
||
1820 |
itemVisualizer->SetExtendable( ETrue ); |
|
1821 |
TInt itemHeight = iAppUi.LayoutHandler()->OneLineListItemHeight(); |
|
1822 |
||
1823 |
itemVisualizer->SetSize( TSize( screenRect.Width(), itemHeight ) ); |
|
1824 |
itemVisualizer->SetExtendedSize( TSize( screenRect.Width(), 2*itemHeight ) ); |
|
1825 |
||
1826 |
// Set font height |
|
1827 |
itemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() ); |
|
1828 |
||
1829 |
// Set font bolding |
|
1830 |
if ( confirmedMsgPtr->IsFlagSet( EFSMsgFlag_Read ) ) |
|
1831 |
{ |
|
1832 |
itemVisualizer->SetTextBold( EFalse ); |
|
1833 |
} |
|
1834 |
else |
|
1835 |
{ |
|
1836 |
itemVisualizer->SetTextBold( ETrue ); |
|
1837 |
} |
|
1838 |
||
1839 |
// Set correct skin text colors for the list items |
|
1840 |
TRgb focusedColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor(); |
|
1841 |
TRgb normalColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor(); |
|
1842 |
itemVisualizer->SetFocusedStateTextColor( focusedColor ); |
|
1843 |
itemVisualizer->SetNormalStateTextColor( normalColor ); |
|
1844 |
||
1845 |
switch ( iListMode ) |
|
1846 |
{ |
|
1847 |
case EListControlTypeDoubleLinePreviewOn: |
|
1848 |
case EListControlTypeSingleLinePreviewOn: |
|
1849 |
itemVisualizer->SetPreviewPaneOn( ETrue ); |
|
1850 |
itemVisualizer->SetPreviewPaneEnabledSize( TSize(screenRect.Width(), 3*itemHeight) ); |
|
1851 |
// fall through |
|
1852 |
case EListControlTypeDoubleLinePreviewOff: |
|
1853 |
case EListControlTypeSingleLinePreviewOff: |
|
1854 |
itemVisualizer->SetExtendable(ETrue); |
|
1855 |
itemVisualizer->SetExtendedSize(TSize(screenRect.Width(), 2*itemHeight)); |
|
1856 |
break; |
|
1857 |
default: |
|
1858 |
break; |
|
1859 |
} |
|
1860 |
||
1861 |
// Update initial preview pane text for items if needed |
|
1862 |
if ( iListMode == EListControlTypeSingleLinePreviewOn || |
|
1863 |
iListMode == EListControlTypeDoubleLinePreviewOn ) |
|
1864 |
{ |
|
1865 |
UpdatePreviewPaneTextForItemL( itemData, confirmedMsgPtr ); |
|
1866 |
} |
|
1867 |
||
1868 |
// Set follow up flag icon |
|
1869 |
if ( TFsEmailUiUtility::IsFollowUpSupported( *iAppUi.GetActiveMailbox() ) ) |
|
1870 |
{ |
|
1871 |
if ( confirmedMsgPtr->IsFlagSet( EFSMsgFlag_FollowUp ) ) |
|
1872 |
{ |
|
1873 |
itemData->SetFlagIcon( iAppUi.FsTextureManager()->TextureByIndex( EFollowUpFlagList ) ); |
|
1874 |
itemVisualizer->SetFlagIconVisible( ETrue ); |
|
1875 |
} |
|
1876 |
else if ( confirmedMsgPtr->IsFlagSet( EFSMsgFlag_FollowUpComplete ) ) |
|
1877 |
{ |
|
1878 |
itemData->SetFlagIcon( iAppUi.FsTextureManager()->TextureByIndex( EFollowUpFlagCompleteList ) ); |
|
1879 |
itemVisualizer->SetFlagIconVisible( ETrue ); |
|
1880 |
} |
|
1881 |
else |
|
1882 |
{ |
|
1883 |
itemVisualizer->SetFlagIconVisible( EFalse ); |
|
1884 |
} |
|
1885 |
} |
|
1886 |
else |
|
1887 |
{ |
|
1888 |
itemVisualizer->SetFlagIconVisible( EFalse ); |
|
1889 |
} |
|
1890 |
||
1891 |
TFsTreeItemId itemId = iSearchList->InsertItemL( *itemData, *itemVisualizer, KFsTreeRootID ); |
|
1892 |
if (iSearchList->FocusedItem() == KFsTreeNoneID) |
|
1893 |
{ |
|
1894 |
iSearchList->SetFocusedItemL(itemId); |
|
1895 |
} |
|
1896 |
||
1897 |
SSearchListItem searchListItem; |
|
1898 |
searchListItem.iSearchListItemId = itemId; |
|
1899 |
searchListItem.iTreeItemData = itemData; |
|
1900 |
searchListItem.iTreeItemVisualiser = itemVisualizer; |
|
1901 |
iSearchListItemArray.AppendL( searchListItem ); |
|
1902 |
newItem->AddCorrespondingListId( itemId ); |
|
1903 |
||
1904 |
if ( iSearchList->Count() == 1 ) // Call only once, temp fix because of error in generic |
|
1905 |
{ |
|
1906 |
if ( iListMode == EListControlTypeDoubleLinePreviewOn || |
|
1907 |
iListMode == EListControlTypeDoubleLinePreviewOff ) |
|
1908 |
{ |
|
1909 |
iSearchTreeListVisualizer->SetItemsAlwaysExtendedL( ETrue ); |
|
1910 |
} |
|
1911 |
else |
|
1912 |
{ |
|
1913 |
// Set the extendedability and extended size |
|
1914 |
iSearchTreeListVisualizer->SetItemsAlwaysExtendedL( EFalse ); |
|
1915 |
} |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
1916 |
|
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
1917 |
// Set msk to "Open when first is found". |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
1918 |
SetMskL(); |
64 | 1919 |
} |
1920 |
} |
|
1921 |
||
1922 |
} |
|
1923 |
||
1924 |
// --------------------------------------------------------------------------- |
|
1925 |
// HandleMailBoxEventL |
|
1926 |
// Function removes objects from the list that are deleted. |
|
1927 |
// Also updates icon and read status if synced so from the server |
|
1928 |
// --------------------------------------------------------------------------- |
|
1929 |
// |
|
1930 |
void CFSEmailUiSearchListVisualiser::HandleMailBoxEventL( TFSMailEvent aEvent, |
|
1931 |
TFSMailMsgId aMailbox, TAny* aParam1, TAny* aParam2, TAny* /*aParam3*/ ) |
|
1932 |
{ |
|
1933 |
FUNC_LOG; |
|
1934 |
if ( iFirstStartCompleted ) // Safety |
|
1935 |
{ |
|
1936 |
CFSMailBox* activeMailbox = iAppUi.GetActiveMailbox(); |
|
1937 |
if ( activeMailbox && aMailbox.Id() == activeMailbox->GetId().Id() ) // Safety, in list events that only concern active mailbox are handled |
|
1938 |
{ |
|
1939 |
if ( iModel && iModel->Count() && (aEvent == TFSEventMailDeleted || aEvent == TFSEventMailDeletedFromViewer) ) |
|
1940 |
{ |
|
1941 |
RArray<TFSMailMsgId>* removedEntries = static_cast<RArray<TFSMailMsgId>*>(aParam1); |
|
1942 |
if ( removedEntries && removedEntries->Count() ) |
|
1943 |
{ |
|
1944 |
RemoveMsgItemsFromListIfFoundL( *removedEntries ); |
|
1945 |
} |
|
1946 |
} |
|
1947 |
else if ( iModel && iModel->Count() && aEvent == TFSEventMailChanged ) |
|
1948 |
{ |
|
1949 |
// Get array of changed entries |
|
1950 |
RArray<TFSMailMsgId>* entries = static_cast<RArray<TFSMailMsgId>*>(aParam1); |
|
1951 |
// Get ID of the folder that this cahnge concerns. |
|
1952 |
TFSMailMsgId* parentFolderId = static_cast<TFSMailMsgId*>( aParam2 ); |
|
1953 |
for ( TInt i=0 ; i < entries->Count() ; i++) |
|
1954 |
{ |
|
1955 |
TFSMailMsgId entryId = (*entries)[i]; |
|
1956 |
CFSMailMessage* confirmedMsgPtr(0); |
|
1957 |
TRAPD( err, confirmedMsgPtr = iAppUi.GetMailClient()->GetMessageByUidL( iAppUi.GetActiveMailboxId(), |
|
1958 |
*parentFolderId, entryId, EFSMsgDataEnvelope ) ); |
|
1959 |
if ( confirmedMsgPtr && err == KErrNone ) |
|
1960 |
{ |
|
1961 |
CleanupStack::PushL( confirmedMsgPtr ); |
|
1962 |
UpdateMsgIconAndBoldingL( confirmedMsgPtr ); |
|
1963 |
CleanupStack::PopAndDestroy( confirmedMsgPtr ); |
|
1964 |
} |
|
1965 |
} |
|
1966 |
} |
|
1967 |
} |
|
1968 |
} |
|
1969 |
} |
|
1970 |
||
1971 |
// --------------------------------------------------------------------------- |
|
1972 |
// RemoveMsgItemsFromListIfFoundL |
|
1973 |
// Message removing from list if found. Does not panic or return found status. |
|
1974 |
// --------------------------------------------------------------------------- |
|
1975 |
// |
|
1976 |
void CFSEmailUiSearchListVisualiser::RemoveMsgItemsFromListIfFoundL( const RArray<TFSMailMsgId>& aEntryIds ) |
|
1977 |
{ |
|
1978 |
FUNC_LOG; |
|
1979 |
if ( iModel && iModel->Count() ) |
|
1980 |
{ |
|
1981 |
for ( TInt i=0 ; i<aEntryIds.Count() ; ++i ) |
|
1982 |
{ |
|
1983 |
const TFSMailMsgId& entryId = aEntryIds[i]; |
|
1984 |
if ( !entryId.IsNullId() ) |
|
1985 |
{ |
|
1986 |
TInt idx = ItemIndexFromMessageId( entryId ); |
|
1987 |
if ( idx >= 0 ) |
|
1988 |
{ |
|
1989 |
iSearchList->RemoveL( iSearchListItemArray[idx].iSearchListItemId ); // remove from list |
|
1990 |
iSearchListItemArray.Remove( idx ); // remove from internal array. |
|
1991 |
iModel->RemoveAndDestroy( idx ); // Remove from model |
|
1992 |
} |
|
1993 |
} |
|
1994 |
} |
|
1995 |
} |
|
1996 |
} |
|
1997 |
||
1998 |
// --------------------------------------------------------------------------- |
|
1999 |
// UpdatePreviewPaneTextForItemL |
|
2000 |
// Updates preview pane text for item |
|
2001 |
// --------------------------------------------------------------------------- |
|
2002 |
// |
|
2003 |
void CFSEmailUiSearchListVisualiser::UpdatePreviewPaneTextForItemL(CFsTreePlainTwoLineItemData* aItemData, CFSMailMessage* aMsgPtr ) |
|
2004 |
{ |
|
2005 |
FUNC_LOG; |
|
2006 |
// Preview pane data update |
|
2007 |
if ( aMsgPtr && ( iListMode == EListControlTypeSingleLinePreviewOn || |
|
2008 |
iListMode == EListControlTypeDoubleLinePreviewOn ) ) |
|
2009 |
{ |
|
2010 |
CFSMailMessagePart* textPart = aMsgPtr->PlainTextBodyPartL(); |
|
2011 |
CleanupStack::PushL( textPart ); |
|
2012 |
if ( textPart && ( textPart->FetchLoadState() == EFSPartial || |
|
2013 |
textPart->FetchLoadState() == EFSFull ) ) |
|
2014 |
{ |
|
2015 |
TInt previewSize = Min( KMaxPreviewPaneLength, textPart->FetchedContentSize() ); |
|
2016 |
HBufC* plainTextData16 = HBufC::NewLC( previewSize ); |
|
2017 |
TPtr textPtr = plainTextData16->Des(); |
|
2018 |
||
2019 |
textPart->GetContentToBufferL( textPtr, 0 ); // Zero is start offset |
|
2020 |
// Crop out line feed, paragraph break, and tabulator |
|
2021 |
TFsEmailUiUtility::FilterListItemTextL( textPtr ); |
|
2022 |
aItemData->SetPreviewPaneDataL( *plainTextData16 ); |
|
2023 |
||
2024 |
CleanupStack::PopAndDestroy( plainTextData16 ); |
|
2025 |
} |
|
2026 |
||
2027 |
// Else display message size in preview pane |
|
2028 |
else |
|
2029 |
{ |
|
2030 |
TUint contentSize = aMsgPtr->ContentSize(); |
|
2031 |
HBufC* sizeDesc = TFsEmailUiUtility::CreateSizeDescLC( contentSize ); |
|
2032 |
HBufC* msgSizeText = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_PREV_PANE_MSG_SIZE, *sizeDesc ); |
|
2033 |
aItemData->SetPreviewPaneDataL( *msgSizeText ); |
|
2034 |
CleanupStack::PopAndDestroy( msgSizeText ); |
|
2035 |
CleanupStack::PopAndDestroy( sizeDesc ); |
|
2036 |
} |
|
2037 |
CleanupStack::PopAndDestroy( textPart ); |
|
2038 |
} |
|
2039 |
} |
|
2040 |
||
2041 |
void CFSEmailUiSearchListVisualiser::SearchCompletedL() |
|
2042 |
{ |
|
2043 |
FUNC_LOG; |
|
2044 |
iSearchOngoing = EFalse; |
|
2045 |
HBufC* searchText = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_FIND_DLG_SEARCH_RESULTS ); |
|
2046 |
HBufC* finalText = HBufC::NewLC( searchText->Length() + iLatestSearchText->Length() + 4 ); |
|
2047 |
finalText->Des().Append( *searchText ); |
|
2048 |
finalText->Des().Append( KSpace ); |
|
2049 |
finalText->Des().Append( *iLatestSearchText ); |
|
2050 |
iBarTextVisual->SetTextL( *finalText ); |
|
2051 |
CleanupStack::PopAndDestroy( finalText ); |
|
2052 |
CleanupStack::PopAndDestroy( searchText ); |
|
2053 |
iRequiredSearchPriority = KStandardSearchPriority; //<cmail> return back |
|
2054 |
} |
|
2055 |
||
2056 |
||
2057 |
void CFSEmailUiSearchListVisualiser::ChangeReadStatusOfHighlightedL( TInt aRead ) |
|
2058 |
{ |
|
2059 |
FUNC_LOG; |
|
2060 |
if ( iSearchList->Count() ) |
|
2061 |
{ |
|
2062 |
CFSEmailUiMailListModelItem* selectedItem = |
|
2063 |
static_cast<CFSEmailUiMailListModelItem*>( iModel->Item( HighlightedIndex() )); |
|
2064 |
if ( selectedItem ) // Safety |
|
2065 |
{ |
|
2066 |
TBool wasRead = selectedItem->MessagePtr().IsFlagSet( EFSMsgFlag_Read ); |
|
2067 |
if ( (wasRead && !aRead) || (!wasRead && aRead) ) |
|
2068 |
{ |
|
2069 |
// Read status is changed |
|
2070 |
iMsgDataCouldBeChanged = ETrue; |
|
2071 |
||
2072 |
if ( aRead ) |
|
2073 |
{ |
|
2074 |
// Send flags, local and server |
|
2075 |
selectedItem->MessagePtr().SetFlag( EFSMsgFlag_Read ); |
|
2076 |
} |
|
2077 |
else |
|
2078 |
{ |
|
2079 |
// Send flags, local and server |
|
2080 |
selectedItem->MessagePtr().ResetFlag( EFSMsgFlag_Read ); |
|
2081 |
} |
|
2082 |
selectedItem->MessagePtr().SaveMessageL(); // Save flag |
|
2083 |
// Switch icon to correct one |
|
2084 |
UpdateMsgIconAndBoldingL( HighlightedIndex() ); |
|
2085 |
} |
|
2086 |
} |
|
2087 |
} |
|
2088 |
} |
|
2089 |
||
2090 |
void CFSEmailUiSearchListVisualiser::CheckAndUpdateFocusedMessageL() |
|
2091 |
{ |
|
2092 |
FUNC_LOG; |
|
2093 |
if ( iModel && iModel->Count() ) // Needed safety check |
|
2094 |
{ |
|
2095 |
TInt highlightedIndex = HighlightedIndex(); |
|
2096 |
CFSEmailUiMailListModelItem* selectedItem = |
|
2097 |
static_cast<CFSEmailUiMailListModelItem*>( iModel->Item( highlightedIndex )); |
|
2098 |
if ( selectedItem && selectedItem->ModelItemType() == ETypeMailItem ) |
|
2099 |
{ |
|
2100 |
CFSMailMessage* msgPtr = &selectedItem->MessagePtr(); |
|
2101 |
if ( msgPtr ) |
|
2102 |
{ |
|
2103 |
CFSMailFolder* folderPtr = |
|
2104 |
iAppUi.GetMailClient()->GetFolderByUidL( iAppUi.GetActiveMailboxId(), msgPtr->GetFolderId() ); |
|
2105 |
CleanupStack::PushL( folderPtr ); |
|
2106 |
||
2107 |
if ( !folderPtr ) |
|
2108 |
{ |
|
2109 |
// Pointer is not valid anymore, msg has been delete, |
|
2110 |
// so it must be removed from the search list |
|
2111 |
RemoveFocusedFromListL(); |
|
2112 |
} |
|
2113 |
else |
|
2114 |
{ |
|
2115 |
CFSMailMessage* confirmedMsgPtr(0); |
|
2116 |
TRAPD( err, confirmedMsgPtr = iAppUi.GetMailClient()->GetMessageByUidL( iAppUi.GetActiveMailboxId(), |
|
2117 |
folderPtr->GetFolderId(), msgPtr->GetMessageId(), EFSMsgDataEnvelope ) ); |
|
2118 |
if ( confirmedMsgPtr && err == KErrNone) |
|
2119 |
{ |
|
2120 |
CleanupStack::PushL( confirmedMsgPtr ); |
|
2121 |
UpdateMsgIconAndBoldingL( confirmedMsgPtr ); |
|
2122 |
CleanupStack::PopAndDestroy( confirmedMsgPtr ); |
|
2123 |
} |
|
2124 |
else |
|
2125 |
{ |
|
2126 |
RemoveFocusedFromListL(); |
|
2127 |
} |
|
2128 |
} |
|
2129 |
||
2130 |
CleanupStack::PopAndDestroy( folderPtr ); |
|
2131 |
} |
|
2132 |
} |
|
2133 |
} |
|
2134 |
} |
|
2135 |
||
2136 |
void CFSEmailUiSearchListVisualiser::RemoveFocusedFromListL() |
|
2137 |
{ |
|
2138 |
FUNC_LOG; |
|
2139 |
iMsgDataCouldBeChanged = ETrue; |
|
2140 |
SSearchListItem item; |
|
2141 |
item.iSearchListItemId = iSearchList->FocusedItem(); |
|
2142 |
TInt IndexToBeDestroyed = iSearchListItemArray.Find( item ); |
|
2143 |
iSearchListItemArray.Remove( IndexToBeDestroyed ); // remove from internal array. |
|
2144 |
iModel->RemoveAndDestroy( IndexToBeDestroyed ); // Remove from model |
|
2145 |
iSearchList->RemoveL( iSearchList->FocusedItem() ); // remove from list |
|
2146 |
} |
|
2147 |
||
2148 |
||
2149 |
// Updates our own message object with the data from a given message object. |
|
2150 |
// The messages are matched with the message ID. |
|
2151 |
void CFSEmailUiSearchListVisualiser::UpdateMsgIconAndBoldingL( CFSMailMessage* aMsgPtr ) |
|
2152 |
{ |
|
2153 |
FUNC_LOG; |
|
2154 |
if ( aMsgPtr ) |
|
2155 |
{ |
|
2156 |
for ( TInt i=0 ; i < iModel->Count() ; i++) |
|
2157 |
{ |
|
2158 |
CFSEmailUiMailListModelItem* item = |
|
2159 |
static_cast<CFSEmailUiMailListModelItem*>( Model()->Item(i) ); |
|
2160 |
if ( item && item->ModelItemType()==ETypeMailItem && |
|
2161 |
item->MessagePtr().GetMessageId() == aMsgPtr->GetMessageId() ) |
|
2162 |
{ |
|
2163 |
// Update all flags |
|
2164 |
TUint32 prevFlags = item->MessagePtr().GetFlags(); |
|
2165 |
TUint32 newFlags = aMsgPtr->GetFlags(); |
|
2166 |
if ( prevFlags != newFlags ) |
|
2167 |
{ |
|
2168 |
item->MessagePtr().ResetFlag( prevFlags ); |
|
2169 |
item->MessagePtr().SetFlag( newFlags ); |
|
2170 |
||
2171 |
// Save changed flags in internal model array |
|
2172 |
item->MessagePtr().SaveMessageL(); |
|
2173 |
iMsgDataCouldBeChanged = ETrue; |
|
2174 |
} |
|
2175 |
||
2176 |
// Update the list item graphics |
|
2177 |
UpdateMsgIconAndBoldingL( i ); |
|
2178 |
break; |
|
2179 |
} |
|
2180 |
} |
|
2181 |
} |
|
2182 |
} |
|
2183 |
||
2184 |
// Updates list item at given index to match the state of the message object |
|
2185 |
void CFSEmailUiSearchListVisualiser::UpdateMsgIconAndBoldingL( TInt aListIndex ) |
|
2186 |
{ |
|
2187 |
FUNC_LOG; |
|
2188 |
if (aListIndex < iSearchListItemArray.Count()) |
|
2189 |
{ |
|
2190 |
CFSEmailUiMailListModelItem* item = |
|
2191 |
static_cast<CFSEmailUiMailListModelItem*>( Model()->Item(aListIndex) ); |
|
2192 |
if ( item && item->ModelItemType()==ETypeMailItem ) |
|
2193 |
{ |
|
2194 |
CFSMailMessage* msgPtr = &item->MessagePtr(); |
|
2195 |
CAlfTexture* itemTexture = &TFsEmailUiUtility::GetMsgIcon( msgPtr, *iAppUi.FsTextureManager() ); |
|
2196 |
CFsTreePlainTwoLineItemData* itemData = |
|
2197 |
static_cast<CFsTreePlainTwoLineItemData*>( iSearchListItemArray[aListIndex].iTreeItemData ); |
|
2198 |
CFsTreePlainTwoLineItemVisualizer* itemVis = |
|
2199 |
static_cast<CFsTreePlainTwoLineItemVisualizer*>( iSearchListItemArray[aListIndex].iTreeItemVisualiser ); |
|
2200 |
itemData->SetIcon( *itemTexture ); |
|
2201 |
if ( msgPtr->IsFlagSet( EFSMsgFlag_Read ) ) |
|
2202 |
{ |
|
2203 |
itemVis->SetTextBold( EFalse ); |
|
2204 |
} |
|
2205 |
else |
|
2206 |
{ |
|
2207 |
itemVis->SetTextBold( ETrue ); |
|
2208 |
} |
|
2209 |
// Set follow up flag icon correctly |
|
2210 |
if ( TFsEmailUiUtility::IsFollowUpSupported( *iAppUi.GetActiveMailbox() ) ) |
|
2211 |
{ |
|
2212 |
if ( msgPtr->IsFlagSet( EFSMsgFlag_FollowUp ) ) |
|
2213 |
{ |
|
2214 |
itemData->SetFlagIcon( iAppUi.FsTextureManager()->TextureByIndex( EFollowUpFlagList ) ); |
|
2215 |
itemVis->SetFlagIconVisible( ETrue ); |
|
2216 |
} |
|
2217 |
else if ( msgPtr->IsFlagSet( EFSMsgFlag_FollowUpComplete ) ) |
|
2218 |
{ |
|
2219 |
itemData->SetFlagIcon( iAppUi.FsTextureManager()->TextureByIndex( EFollowUpFlagCompleteList ) ); |
|
2220 |
itemVis->SetFlagIconVisible( ETrue ); |
|
2221 |
} |
|
2222 |
else |
|
2223 |
{ |
|
2224 |
itemVis->SetFlagIconVisible( EFalse ); |
|
2225 |
} |
|
2226 |
} |
|
2227 |
else |
|
2228 |
{ |
|
2229 |
itemVis->SetFlagIconVisible( EFalse ); |
|
2230 |
} |
|
2231 |
iSearchTreeListVisualizer->UpdateItemL( iSearchListItemArray[aListIndex].iSearchListItemId ); |
|
2232 |
} |
|
2233 |
} |
|
2234 |
} |
|
2235 |
||
2236 |
||
2237 |
// Delete messages |
|
2238 |
void CFSEmailUiSearchListVisualiser::DeleteFocusedMessageL() |
|
2239 |
{ |
|
2240 |
FUNC_LOG; |
|
2241 |
if ( iSearchList->Count() ) |
|
2242 |
{ |
|
2243 |
TInt currentItemIndex = HighlightedIndex(); |
|
2244 |
CFSEmailUiMailListModelItem* item = |
|
2245 |
static_cast<CFSEmailUiMailListModelItem*>( Model()->Item(currentItemIndex)); |
|
2246 |
if ( item && item->ModelItemType() == ETypeMailItem ) |
|
2247 |
{ |
|
2248 |
CFSMailMessage& messagePtr = item->MessagePtr(); |
|
2249 |
TInt queryTextId(0); |
|
2250 |
if ( messagePtr.IsFlagSet( EFSMsgFlag_CalendarMsg )) |
|
2251 |
{ |
|
2252 |
queryTextId = R_FREESTYLE_EMAIL_DELETE_CALEVENT_NOTE; |
|
2253 |
} |
|
2254 |
else |
|
2255 |
{ |
|
2256 |
queryTextId = R_FREESTYLE_EMAIL_DELETE_MAIL_NOTE; |
|
2257 |
} |
|
2258 |
HBufC* msgSubject = TFsEmailUiUtility::CreateSubjectTextLC( &messagePtr ); |
|
2259 |
||
2260 |
TInt okToDelete( ETrue ); |
|
2261 |
if ( iAppUi.GetCRHandler()->WarnBeforeDelete() ) |
|
2262 |
{ |
|
2263 |
okToDelete = TFsEmailUiUtility::ShowConfirmationQueryL( queryTextId, *msgSubject ); |
|
2264 |
} |
|
2265 |
CleanupStack::PopAndDestroy( msgSubject ); |
|
2266 |
||
2267 |
if ( okToDelete ) |
|
2268 |
{ |
|
2269 |
iMsgDataCouldBeChanged = ETrue; // Refresh |
|
2270 |
// Delete message from framework, and perform internal housekeeping |
|
2271 |
TFSMailMsgId msgId = messagePtr.GetMessageId(); |
|
2272 |
RArray<TFSMailMsgId> msgIds; |
|
2273 |
msgIds.Append( msgId ); |
|
2274 |
TFSMailMsgId folderId = messagePtr.GetFolderId(); |
|
2275 |
TFSMailMsgId mailBox = iAppUi.GetActiveMailbox()->GetId(); |
|
2276 |
iAppUi.GetMailClient()->DeleteMessagesByUidL( mailBox, folderId, msgIds ); |
|
2277 |
msgIds.Reset(); |
|
2278 |
SSearchListItem item; |
|
2279 |
item.iSearchListItemId = iSearchList->FocusedItem(); |
|
2280 |
TInt IndexToBeDestroyed = iSearchListItemArray.Find( item ); |
|
2281 |
iSearchListItemArray.Remove( IndexToBeDestroyed ); // remove from internal array. |
|
2282 |
iModel->RemoveAndDestroy( IndexToBeDestroyed ); // Remove from model |
|
2283 |
iSearchList->RemoveL( iSearchList->FocusedItem() ); // remove from list |
|
2284 |
} |
|
2285 |
} |
|
2286 |
} |
|
2287 |
} |
|
2288 |
||
2289 |
||
2290 |
// Navigation functions, used mainly from viewer |
|
2291 |
TBool CFSEmailUiSearchListVisualiser::IsNextMsgAvailable( TFSMailMsgId aCurrentMsgId, |
|
2292 |
TFSMailMsgId& aFoundNextMsgId, |
|
2293 |
TFSMailMsgId& aFoundNextMsgFolderId ) const |
|
2294 |
{ |
|
2295 |
FUNC_LOG; |
|
2296 |
TBool ret(EFalse); |
|
2297 |
||
2298 |
TInt curIdx = ItemIndexFromMessageId( aCurrentMsgId ); |
|
2299 |
if ( curIdx >= 0 ) |
|
2300 |
{ |
|
2301 |
TInt nextIdx = NextMessageIndex(curIdx); |
|
2302 |
if ( nextIdx >= 0 ) |
|
2303 |
{ |
|
2304 |
ret = ETrue; |
|
2305 |
aFoundNextMsgId = MsgIdFromIndex(nextIdx); |
|
2306 |
CFSEmailUiMailListModelItem* item = |
|
2307 |
static_cast<CFSEmailUiMailListModelItem*>(iModel->Item( nextIdx )); |
|
2308 |
if ( item->ModelItemType() == ETypeMailItem ) |
|
2309 |
{ |
|
2310 |
aFoundNextMsgFolderId = item->MessagePtr().GetFolderId(); |
|
2311 |
} |
|
2312 |
} |
|
2313 |
} |
|
2314 |
||
2315 |
return ret; |
|
2316 |
} |
|
2317 |
||
2318 |
||
2319 |
TBool CFSEmailUiSearchListVisualiser::IsPreviousMsgAvailable( TFSMailMsgId aCurrentMsgId, |
|
2320 |
TFSMailMsgId& aFoundPreviousMsgId, |
|
2321 |
TFSMailMsgId& aFoundPrevMsgFolderId ) const |
|
2322 |
{ |
|
2323 |
FUNC_LOG; |
|
2324 |
TBool ret(EFalse); |
|
2325 |
||
2326 |
TInt curIdx = ItemIndexFromMessageId( aCurrentMsgId ); |
|
2327 |
if ( curIdx >= 0 ) |
|
2328 |
{ |
|
2329 |
TInt prevIdx = PreviousMessageIndex(curIdx); |
|
2330 |
if ( prevIdx >= 0 ) |
|
2331 |
{ |
|
2332 |
ret = ETrue; |
|
2333 |
aFoundPreviousMsgId = MsgIdFromIndex(prevIdx); |
|
2334 |
CFSEmailUiMailListModelItem* item = |
|
2335 |
static_cast<CFSEmailUiMailListModelItem*>(iModel->Item( prevIdx )); |
|
2336 |
if ( item->ModelItemType() == ETypeMailItem ) |
|
2337 |
{ |
|
2338 |
aFoundPrevMsgFolderId = item->MessagePtr().GetFolderId(); |
|
2339 |
} |
|
2340 |
} |
|
2341 |
} |
|
2342 |
||
2343 |
return ret; |
|
2344 |
} |
|
2345 |
||
2346 |
TInt CFSEmailUiSearchListVisualiser::MoveToNextMsgL( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundNextMsgId ) |
|
2347 |
{ |
|
2348 |
FUNC_LOG; |
|
2349 |
TInt ret(KErrNotFound); |
|
2350 |
||
2351 |
TInt curIdx = ItemIndexFromMessageId( aCurrentMsgId ); |
|
2352 |
TInt nextIdx = NextMessageIndex( curIdx ); |
|
2353 |
||
2354 |
if ( curIdx >= 0 && nextIdx >= 0 ) |
|
2355 |
{ |
|
2356 |
// Focus the new message |
|
2357 |
iSearchTreeListVisualizer->SetFocusedItemL( iSearchListItemArray[nextIdx].iSearchListItemId ); |
|
2358 |
ChangeReadStatusOfHighlightedL( ETrue ); |
|
2359 |
aFoundNextMsgId = MsgIdFromIndex( nextIdx ); |
|
2360 |
ret = KErrNone; |
|
2361 |
} |
|
2362 |
if ( ret == KErrNone ) |
|
2363 |
{ |
|
2364 |
OpenHighlightedMailL(); |
|
2365 |
} |
|
2366 |
return ret; |
|
2367 |
} |
|
2368 |
||
2369 |
TInt CFSEmailUiSearchListVisualiser::MoveToPreviousMsgL( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundPreviousMsgId ) |
|
2370 |
{ |
|
2371 |
FUNC_LOG; |
|
2372 |
TInt ret(KErrNotFound); |
|
2373 |
||
2374 |
TInt curIdx = ItemIndexFromMessageId( aCurrentMsgId ); |
|
2375 |
TInt prevIdx = PreviousMessageIndex( curIdx ); |
|
2376 |
||
2377 |
if ( curIdx >= 0 && prevIdx >= 0 ) |
|
2378 |
{ |
|
2379 |
// Focus the new message |
|
2380 |
iSearchTreeListVisualizer->SetFocusedItemL( iSearchListItemArray[prevIdx].iSearchListItemId ); |
|
2381 |
ChangeReadStatusOfHighlightedL( ETrue ); |
|
2382 |
aFoundPreviousMsgId = MsgIdFromIndex( prevIdx ); |
|
2383 |
ret = KErrNone; |
|
2384 |
} |
|
2385 |
||
2386 |
if ( ret == KErrNone ) |
|
2387 |
{ |
|
2388 |
OpenHighlightedMailL(); |
|
2389 |
} |
|
2390 |
return ret; |
|
2391 |
} |
|
2392 |
||
2393 |
TInt CFSEmailUiSearchListVisualiser::MoveToPreviousMsgAfterDeleteL( TFSMailMsgId aFoundPreviousMsgId ) |
|
2394 |
{ |
|
2395 |
FUNC_LOG; |
|
2396 |
TInt ret(KErrNotFound); |
|
2397 |
||
2398 |
TInt idx = ItemIndexFromMessageId( aFoundPreviousMsgId ); |
|
2399 |
if ( idx >= 0 ) |
|
2400 |
{ |
|
2401 |
// Focus the previous message |
|
2402 |
iSearchTreeListVisualizer->SetFocusedItemL( iSearchListItemArray[idx].iSearchListItemId ); |
|
2403 |
ChangeReadStatusOfHighlightedL( ETrue ); |
|
2404 |
ret = KErrNone; |
|
2405 |
} |
|
2406 |
||
2407 |
if ( ret == KErrNone ) |
|
2408 |
{ |
|
2409 |
OpenHighlightedMailL(); |
|
2410 |
} |
|
2411 |
||
2412 |
return ret; |
|
2413 |
} |
|
2414 |
||
2415 |
// Helper functions to get highlighted message id and folder id |
|
2416 |
TFSMailMsgId CFSEmailUiSearchListVisualiser::HighlightedMessageFolderId() |
|
2417 |
{ |
|
2418 |
FUNC_LOG; |
|
2419 |
TFSMailMsgId ret; |
|
2420 |
if ( iSearchList->Count() && iModel ) |
|
2421 |
{ |
|
2422 |
CFSEmailUiMailListModelItem* item = dynamic_cast<CFSEmailUiMailListModelItem*>(iModel->Item(HighlightedIndex())); |
|
2423 |
if ( item && item->ModelItemType() == ETypeMailItem ) |
|
2424 |
{ |
|
2425 |
ret = item->MessagePtr().GetFolderId(); |
|
2426 |
} |
|
2427 |
} |
|
2428 |
return ret; |
|
2429 |
} |
|
2430 |
||
2431 |
TFSMailMsgId CFSEmailUiSearchListVisualiser::HighlightedMessageId() |
|
2432 |
{ |
|
2433 |
FUNC_LOG; |
|
2434 |
TFSMailMsgId ret; |
|
2435 |
if ( iSearchList->Count() && iModel ) |
|
2436 |
{ |
|
2437 |
CFSEmailUiMailListModelItem* item = dynamic_cast<CFSEmailUiMailListModelItem*>(iModel->Item(HighlightedIndex())); |
|
2438 |
if ( item && item->ModelItemType() == ETypeMailItem ) |
|
2439 |
{ |
|
2440 |
ret = item->MessagePtr().GetMessageId(); |
|
2441 |
} |
|
2442 |
} |
|
2443 |
return ret; |
|
2444 |
} |
|
2445 |
||
2446 |
||
2447 |
//<cmail> Touch |
|
2448 |
// --------------------------------------------------------------------------- |
|
2449 |
// CFSEmailUiSearchListVisualiser::TreeListEventL |
|
2450 |
// From MFsTreeListObserver |
|
2451 |
// --------------------------------------------------------------------------- |
|
2452 |
// |
|
2453 |
void CFSEmailUiSearchListVisualiser::TreeListEventL( const TFsTreeListEvent aEvent, |
|
2454 |
const TFsTreeItemId /*aId*/, |
|
2455 |
const TPoint& aPoint ) |
|
2456 |
{ |
|
2457 |
FUNC_LOG; |
|
2458 |
||
2459 |
switch(aEvent) |
|
2460 |
{ |
|
2461 |
case MFsTreeListObserver::EFsTreeListItemTouchAction: |
|
2462 |
DoHandleActionL(); |
|
2463 |
break; |
|
2464 |
case MFsTreeListObserver::EFsTreeListItemTouchLongTap: |
|
2465 |
if ( iSearchList->Count() ) |
|
2466 |
{ |
|
2467 |
LaunchStylusPopupMenuL( aPoint ); |
|
2468 |
} |
|
2469 |
break; |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2470 |
case MFsTreeListObserver::EFsTreeListItemWillGetFocused: |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2471 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2472 |
SetMskL(); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2473 |
break; |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2474 |
} |
64 | 2475 |
case MFsTreeListObserver::EFsFocusVisibilityChange: |
2476 |
{ |
|
2477 |
iAppUi.SetFocusVisibility( EFalse ); |
|
2478 |
break; |
|
2479 |
} |
|
2480 |
case MFsTreeListObserver::EFsTreeListItemTouchFocused: |
|
2481 |
default: |
|
2482 |
//Just ignore rest of events |
|
2483 |
break; |
|
2484 |
} |
|
2485 |
} |
|
2486 |
||
2487 |
// --------------------------------------------------------------------------- |
|
2488 |
// CFSEmailUiSearchListVisualiser::DoHandleActionL |
|
2489 |
// --------------------------------------------------------------------------- |
|
2490 |
// |
|
2491 |
void CFSEmailUiSearchListVisualiser::DoHandleActionL() |
|
2492 |
{ |
|
2493 |
FUNC_LOG; |
|
2494 |
TInt modelCount = 0; |
|
2495 |
||
2496 |
if ( iModel ) |
|
2497 |
{ |
|
2498 |
modelCount = iModel->Count(); |
|
2499 |
} |
|
2500 |
if ( modelCount ) // Safety check |
|
2501 |
{ |
|
2502 |
CFSEmailUiMailListModelItem* item = dynamic_cast<CFSEmailUiMailListModelItem*>(iModel->Item(HighlightedIndex())); |
|
2503 |
if ( item && item->ModelItemType() == ETypeMailItem ) |
|
2504 |
{ |
|
2505 |
CFSMailMessage* messagePtr = &item->MessagePtr(); |
|
2506 |
if ( messagePtr ) |
|
2507 |
{ |
|
2508 |
OpenHighlightedMailL(); |
|
2509 |
} |
|
2510 |
} |
|
2511 |
} |
|
2512 |
} |
|
2513 |
||
2514 |
//</cmail> |
|
2515 |
||
2516 |
// --------------------------------------------------------------------------- |
|
2517 |
// From MFSEmailUiContactHandlerObserver |
|
2518 |
// The ownership of the CLS items in the contacts array is transferred to the |
|
2519 |
// observer, and they must be deleted by the observer. |
|
2520 |
// --------------------------------------------------------------------------- |
|
2521 |
// |
|
2522 |
void CFSEmailUiSearchListVisualiser::OperationCompleteL( |
|
2523 |
TContactHandlerCmd /*aCmd*/, const RPointerArray<CFSEmailUiClsItem>& /*aContacts*/ ) |
|
2524 |
{ |
|
2525 |
FUNC_LOG; |
|
2526 |
iRequiredSearchPriority = KStandardSearchPriority; //<cmail> return back |
|
2527 |
} |
|
2528 |
||
2529 |
// --------------------------------------------------------------------------- |
|
2530 |
// From MFSEmailUiContactHandlerObserver |
|
2531 |
// Handles error in contact handler operation. |
|
2532 |
// --------------------------------------------------------------------------- |
|
2533 |
// |
|
2534 |
void CFSEmailUiSearchListVisualiser::OperationErrorL( |
|
2535 |
TContactHandlerCmd /*aCmd*/, TInt /*aError*/ ) |
|
2536 |
{ |
|
2537 |
FUNC_LOG; |
|
2538 |
iRequiredSearchPriority = KStandardSearchPriority; //<cmail> return back |
|
2539 |
} |
|
2540 |
||
2541 |
TBool CFSEmailUiSearchListVisualiser::CallToSenderL() |
|
2542 |
{ |
|
2543 |
FUNC_LOG; |
|
2544 |
CFSEmailUiMailListModelItem* item = |
|
2545 |
dynamic_cast<CFSEmailUiMailListModelItem*> |
|
2546 |
( iModel->Item( HighlightedIndex() ) ); |
|
2547 |
if ( item && item->ModelItemType() == ETypeMailItem ) |
|
2548 |
{ |
|
2549 |
CFSMailAddress* fromAddress = item->MessagePtr().GetSender(); |
|
2550 |
TDesC* emailAddress(0); |
|
2551 |
if ( fromAddress ) |
|
2552 |
{ |
|
2553 |
emailAddress = &fromAddress->GetEmailAddress(); |
|
2554 |
} |
|
2555 |
if ( emailAddress && emailAddress->Length() ) |
|
2556 |
{ |
|
2557 |
CFsDelayedLoader::InstanceL()->GetContactHandlerL()-> |
|
2558 |
FindAndCallToContactByEmailL( *emailAddress, |
|
2559 |
iAppUi.GetActiveMailbox(), this, ETrue ); |
|
2560 |
iRequiredSearchPriority = KCallingSearchPriority; //decrease priority to enable search for contact |
|
2561 |
return ETrue; // searching started - consume keyup event |
|
2562 |
} |
|
2563 |
} |
|
2564 |
return EFalse; //no calling key up will execute Call app |
|
2565 |
} |
|
2566 |
||
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2567 |
|
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2568 |
// --------------------------------------------------------------------------- |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2569 |
// Logic for changing msk |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2570 |
// --------------------------------------------------------------------------- |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2571 |
// |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2572 |
void CFSEmailUiSearchListVisualiser::SetMskL() |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2573 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2574 |
FUNC_LOG; |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2575 |
if ( iFirstStartCompleted ) |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2576 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2577 |
if ( iSearchList && iSearchList->Count() ) |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2578 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2579 |
ChangeMskCommandL( R_FSE_QTN_MSK_OPEN ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2580 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2581 |
else |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2582 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2583 |
ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2584 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2585 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2586 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
73
diff
changeset
|
2587 |
|
64 | 2588 |
//<cmail> |
2589 |
// --------------------------------------------------------------------------- |
|
2590 |
// CFSEmailUiSearchListVisualiser::SetHeaderTextAttributesL() |
|
2591 |
// |
|
2592 |
// Apply header text/background attributes |
|
2593 |
// This creates i.e "Search result: %S " title caption and background graphics |
|
2594 |
// --------------------------------------------------------------------------- |
|
2595 |
// |
|
2596 |
void CFSEmailUiSearchListVisualiser::SetHeaderAttributesL() |
|
2597 |
{ |
|
2598 |
// Set bar text color/style from skin |
|
2599 |
iBarTextVisual->SetTextStyle( iAppUi.LayoutHandler()-> |
|
2600 |
FSTextStyleFromLayoutL( AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_t1( 0 ) ).Id() ); |
|
2601 |
iBarTextVisual->SetColor( iAppUi.LayoutHandler()-> |
|
2602 |
ListNormalStateTextSkinColor() ); |
|
2603 |
||
2604 |
} |
|
2605 |
//</cmail> |
|
2606 |
||
2607 |
||
2608 |
||
2609 |
// --------------------------------------------------------------------------- |
|
2610 |
// LaunchStylusPopupMenuL |
|
2611 |
// Function launches avkon stylus popup menu based for the tapped item |
|
2612 |
// --------------------------------------------------------------------------- |
|
2613 |
// |
|
2614 |
void CFSEmailUiSearchListVisualiser::LaunchStylusPopupMenuL( const TPoint& aPoint ) |
|
2615 |
{ |
|
2616 |
// Verify that the item's type is correct |
|
2617 |
CFSEmailUiMailListModelItem* item = |
|
2618 |
static_cast<CFSEmailUiMailListModelItem*>( iModel->Item( HighlightedIndex() ) ); |
|
2619 |
if ( item && ( item->ModelItemType() == ETypeMailItem ) ) |
|
2620 |
{ |
|
2621 |
// Add mark as read / unread options |
|
2622 |
const CFSMailMessage& message = item->MessagePtr(); |
|
2623 |
||
2624 |
TBool messageRead( message.IsFlagSet( EFSMsgFlag_Read ) ); |
|
2625 |
iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, !messageRead ); |
|
2626 |
iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsRead, messageRead ); |
|
2627 |
||
2628 |
// Set the position for the popup |
|
2629 |
TPoint point(aPoint.iX, aPoint.iY + 45); |
|
2630 |
iStylusPopUpMenu->SetPosition( point, CAknStylusPopUpMenu::EPositionTypeRightBottom ); |
|
2631 |
||
2632 |
// Display the popup and set the flag to indicate that the menu was |
|
2633 |
// launched so that list focus stays visible. |
|
2634 |
iStylusPopUpMenu->ShowMenu(); |
|
2635 |
iStylusPopUpMenuVisible = ETrue; |
|
2636 |
} |
|
2637 |
} |
|
2638 |
||
2639 |
// --------------------------------------------------------------------------- |
|
2640 |
// ClientRequiredSearchPriority |
|
2641 |
// the email searching priority may be decreased to enable searching for contacts |
|
2642 |
// --------------------------------------------------------------------------- |
|
2643 |
// |
|
2644 |
void CFSEmailUiSearchListVisualiser::ClientRequiredSearchPriority( TInt *apRequiredSearchPriority ) |
|
2645 |
{ |
|
2646 |
FUNC_LOG; |
|
2647 |
if (iRequiredSearchPriority != (*apRequiredSearchPriority)) |
|
2648 |
*apRequiredSearchPriority = iRequiredSearchPriority; |
|
2649 |
return; |
|
2650 |
} |
|
2651 |
||
2652 |
// End of file |