author | Fionntina Carville <fionntinac@symbian.org> |
Mon, 15 Nov 2010 10:30:54 +0000 | |
branch | RCL_3 |
changeset 82 | 28205c20df94 |
parent 80 | 726fba06891a |
permissions | -rw-r--r-- |
64 | 1 |
/* |
2 |
* Copyright (c) 2007 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: FreestyleEmailUi search result list visualisation |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef __FREESTYLEEMAILUI_SEARCHLISTVISUALISER_H__ |
|
19 |
#define __FREESTYLEEMAILUI_SEARCHLISTVISUALISER_H__ |
|
20 |
||
21 |
// SYSTEM INCLUDES |
|
22 |
#include <e32base.h> |
|
23 |
||
24 |
//<cmail> |
|
25 |
#include "cfsmailcommon.h" |
|
26 |
#include "mfsmailboxsearchobserver.h" |
|
27 |
#include "fstreevisualizerobserver.h" |
|
28 |
#include "fstreelistobserver.h" |
|
29 |
#include "fsccontactactionmenudefines.h" |
|
30 |
//</cmail> |
|
31 |
||
32 |
// INTERNAL INCLUDES |
|
33 |
#include "FreestyleEmailUiViewBase.h" |
|
34 |
#include "FreestyleEmailUiUtilities.h" |
|
35 |
#include "FreestyleEmailUiContactHandlerObserver.h" |
|
36 |
||
37 |
||
38 |
// FORWARD DECLARATIONS |
|
39 |
class CAlfTextVisual; |
|
40 |
class CAlfImageVisual; |
|
41 |
class CAlfDeckLayout; |
|
42 |
class CAlfAnchorLayout; |
|
43 |
class CFSEmailUiMailListModelItem; |
|
44 |
class CFSEmailUiMailListModel; |
|
45 |
class CFreestyleEmailUiTextureManager; |
|
46 |
class CFSMailFolder; |
|
47 |
class CFSMailClient; |
|
48 |
class CFSMailMessage; |
|
49 |
class CFsTreeList; |
|
50 |
class CFsTreeVisualizerBase; |
|
51 |
class MFsTreeItemData; |
|
52 |
class MFsTreeItemVisualizer; |
|
53 |
class CFreestyleEmailUiTextureManager; |
|
54 |
class CFreestyleEmailUiAppUi; |
|
55 |
class CFsTreePlainOneLineNodeData; |
|
56 |
class CFsTreePlainOneLineNodeVisualizer; |
|
57 |
class CPbkxContactActionMenu; |
|
58 |
class CFreestyleEmailUiSearchListControl; |
|
59 |
class CFSMailFolder; |
|
60 |
class CFSMailBox; |
|
61 |
class CAsyncCallBack; |
|
62 |
class CESMRIcalViewer; |
|
63 |
class CFsTreePlainTwoLineItemData; |
|
64 |
class CAknStylusPopUpMenu; |
|
65 |
||
66 |
struct SSearchListItem |
|
67 |
{ |
|
68 |
TInt iSearchListItemId; |
|
69 |
MFsTreeItemData* iTreeItemData; |
|
70 |
MFsTreeItemVisualizer* iTreeItemVisualiser; |
|
71 |
}; |
|
72 |
||
73 |
class CFSEmailUiSearchListVisualiser : public CFsEmailUiViewBase, |
|
74 |
public MFSMailBoxSearchObserver, |
|
75 |
//<cmail> touch |
|
76 |
public MFsTreeListObserver, |
|
77 |
//<cmail> |
|
78 |
public MFSEmailUiGenericTimerCallback, |
|
79 |
public MFSEmailUiContactHandlerObserver |
|
80 |
{ |
|
81 |
public: |
|
82 |
static CFSEmailUiSearchListVisualiser* NewL(CAlfEnv& aEnv, CFreestyleEmailUiAppUi* aAppUi, CAlfControlGroup& aSeacrhListControlGroup); |
|
83 |
static CFSEmailUiSearchListVisualiser* NewLC(CAlfEnv& aEnv, CFreestyleEmailUiAppUi* aAppUi, CAlfControlGroup& aSearchListControlGroup); |
|
84 |
virtual ~CFSEmailUiSearchListVisualiser(); |
|
85 |
void PrepareForExit(); |
|
86 |
||
87 |
public: // from CFsEmailUiViewBase |
|
88 |
void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); |
|
89 |
||
90 |
// From view |
|
91 |
TUid Id() const; |
|
92 |
// <cmail> Toolbar |
|
93 |
/*void DoActivateL(const TVwsViewId& aPrevViewId, |
|
94 |
TUid aCustomMessageId, |
|
95 |
const TDesC8& aCustomMessage);*/ |
|
96 |
// </cmail> Toolbar |
|
97 |
void ChildDoDeactivate(); |
|
98 |
void HandleCommandL( TInt aCommand ); |
|
99 |
||
100 |
/** |
|
101 |
* @see CFsEmailUiViewBase::SetStatusBarLayout |
|
102 |
*/ |
|
103 |
void SetStatusBarLayout(); |
|
104 |
||
105 |
// Dynamic variant switch, called by appui |
|
106 |
void HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType ); |
|
107 |
void GetParentLayoutsL( RPointerArray<CAlfVisual>& aLayoutArray ) const; |
|
108 |
void FadeOut(TBool aDirectionOut); |
|
109 |
||
110 |
// Navigation functions, used mainly from viewer |
|
111 |
TBool IsNextMsgAvailable( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundNextMsgId, TFSMailMsgId& aFoundNextMsgFolder ) const; |
|
112 |
TBool IsPreviousMsgAvailable( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundPreviousMsgId, TFSMailMsgId& aFoundPrevMsgFolder ) const; |
|
113 |
TInt MoveToNextMsgL( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundNextMsgId ); |
|
114 |
TInt MoveToPreviousMsgL( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundPreviousMsgId ); |
|
115 |
TInt MoveToPreviousMsgAfterDeleteL( TFSMailMsgId aFoundPreviousMsgId ); |
|
116 |
||
117 |
public: // from MFSMailBoxSearchObserver |
|
118 |
void MatchFoundL( CFSMailMessage* aMatchMessage ); |
|
119 |
void SearchCompletedL(); |
|
120 |
/** |
|
121 |
* server asks client if to change the search priority (when calling) |
|
122 |
*/ |
|
123 |
void ClientRequiredSearchPriority( TInt *apRequiredSearchPriority ); // <cmail> |
|
124 |
||
125 |
||
126 |
public: // new methods |
|
127 |
// Refresh the whole list |
|
128 |
void RefreshL(); |
|
129 |
||
130 |
// Mail list current model data |
|
131 |
CFSEmailUiMailListModel* Model(); |
|
132 |
||
133 |
// Event handling forwarded from control |
|
134 |
TBool OfferEventL( const TAlfEvent& aEvent ); |
|
135 |
||
136 |
// Used from callback |
|
137 |
TInt LaunchSearchDialogL(); |
|
138 |
||
139 |
// Used from appui to get the current index in search list |
|
140 |
TInt HighlightedIndex() const; |
|
141 |
||
142 |
// Start timer callback |
|
143 |
void TimerEventL( CFSEmailUiGenericTimer* aTriggeredTimer ); |
|
144 |
||
145 |
// Helper functions to get highlighted message id and folder id |
|
146 |
TFSMailMsgId HighlightedMessageFolderId(); |
|
147 |
TFSMailMsgId HighlightedMessageId(); |
|
148 |
||
149 |
void HandleMailBoxEventL( TFSMailEvent aEvent, TFSMailMsgId aMailbox, |
|
150 |
TAny* aParam1, TAny* aParam2, TAny* aParam3 ); |
|
151 |
void RemoveMsgItemsFromListIfFoundL( const RArray<TFSMailMsgId>& aEntryIds ); |
|
152 |
||
153 |
public: // From MFsTreeListObserver |
|
154 |
//<cmail> touch |
|
155 |
void TreeListEventL( const TFsTreeListEvent aEvent, |
|
156 |
const TFsTreeItemId aId, |
|
157 |
const TPoint& aPoint ); |
|
158 |
||
159 |
//</cmail> |
|
160 |
||
161 |
public: // From MFSEMailUiContactHandlerObserver |
|
162 |
||
163 |
void OperationCompleteL( TContactHandlerCmd aCmd, |
|
164 |
const RPointerArray<CFSEmailUiClsItem>& aContacts ); |
|
165 |
void OperationErrorL( TContactHandlerCmd, TInt aError ); |
|
166 |
||
167 |
// <cmail> Toolbar |
|
168 |
private: // from |
|
169 |
||
170 |
/** |
|
171 |
* @see CFsEmailUiViewBase::ChildDoActivateL |
|
172 |
*/ |
|
173 |
void ChildDoActivateL( const TVwsViewId& aPrevViewId, |
|
174 |
TUid aCustomMessageId, |
|
175 |
const TDesC8& aCustomMessage ); |
|
176 |
||
177 |
// </cmail> Toolbar |
|
178 |
||
179 |
// Called when flip state is changed |
|
180 |
void FlipStateChangedL( TBool aFlipOpen ); |
|
181 |
||
182 |
/** |
|
183 |
* Handles the focus state changes |
|
184 |
* @param aVisible Indicates if focus should become visible or removed |
|
185 |
*/ |
|
186 |
void FocusVisibilityChange( TBool aVisible ); |
|
187 |
||
188 |
private: |
|
189 |
CFSEmailUiSearchListVisualiser( CFreestyleEmailUiAppUi* aAppUi, CAlfEnv& aEnv, CAlfControlGroup& aSearchListControlGroup ); |
|
190 |
void ConstructL(); |
|
191 |
||
192 |
void ReScaleUiL(); |
|
193 |
void SetSearchListLayoutAnchors(); |
|
194 |
void SetSearchListTopBarLayoutAnchors(); |
|
195 |
||
196 |
void CreatePlainNodeL( const TDesC& aItemDataBuff, |
|
197 |
CFsTreePlainOneLineNodeData* &aItemData, |
|
198 |
CFsTreePlainOneLineNodeVisualizer* &aNodeVisualizer ) const; |
|
199 |
void ExpandAllNodesL(); |
|
200 |
void CollapseAllNodesL(); |
|
201 |
||
202 |
// Helper functions to access model data |
|
203 |
TFSMailMsgId MsgIdFromIndex( TInt aItemIdx ) const; |
|
204 |
TFSMailMsgId MsgIdFromListId( TFsTreeItemId aListId ) const; |
|
205 |
CFSMailMessage& MsgPtrFromListId( TFsTreeItemId aListId ); |
|
206 |
||
207 |
// Item data and visualiser helper functions |
|
208 |
MFsTreeItemData* ItemDataFromItemId( TFsTreeItemId aItemId ); |
|
209 |
MFsTreeItemVisualizer* ItemVisualiserFromItemId( TFsTreeItemId aItemId ); |
|
210 |
||
211 |
// Helpers to get the ordinal of a message in the iModel |
|
212 |
TInt ItemIndexFromMessageId( const TFSMailMsgId& aMessageId ) const; |
|
213 |
TInt NextMessageIndex( TInt aCurMsgIdx ) const; |
|
214 |
TInt PreviousMessageIndex( TInt aCurMsgIdx ) const; |
|
215 |
||
216 |
//<cmail> touch |
|
217 |
// Helper class for resolving touch events and actions |
|
218 |
void DoHandleActionL(); |
|
219 |
//</cmail> |
|
220 |
||
221 |
// Open highlighted mail |
|
222 |
void OpenHighlightedMailL(); |
|
223 |
||
224 |
// Compose, reply, reply all and forward |
|
225 |
void ReplyL( CFSMailMessage* aMsgPtr ); |
|
226 |
void ReplyAllL( CFSMailMessage* aMsgPtr ); |
|
227 |
void ForwardL( CFSMailMessage* aMsgPtr ); |
|
228 |
void DoReplyForwardL( TEditorLaunchMode aMode, CFSMailMessage* aMsgPtr = NULL ); |
|
229 |
||
230 |
void StartSearchL(); |
|
231 |
void StopSearchL(); |
|
232 |
||
233 |
// <cmail> fixed CS high cat. finding |
|
234 |
void ResetResultListL(); |
|
235 |
||
236 |
void ChangeReadStatusOfHighlightedL( TInt aRead ); |
|
237 |
||
238 |
void CheckAndUpdateFocusedMessageL(); |
|
239 |
||
240 |
void RemoveFocusedFromListL(); |
|
241 |
||
242 |
void UpdateMsgIconAndBoldingL( CFSMailMessage* aMsgPtr ); |
|
243 |
void UpdateMsgIconAndBoldingL( TInt aListIndex ); |
|
244 |
||
245 |
// Delete messages |
|
246 |
void DeleteFocusedMessageL(); |
|
247 |
||
248 |
TBool CallToSenderL(); |
|
249 |
||
250 |
void UpdateMailListSettingsL(); |
|
251 |
||
252 |
void UpdatePreviewPaneTextForItemL( CFsTreePlainTwoLineItemData* aItemData, CFSMailMessage* aMsgPtr ); |
|
253 |
void FilterPreviewPaneTextL( TDes& aText ) const; |
|
254 |
||
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
70
diff
changeset
|
255 |
void SetMskL(); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
70
diff
changeset
|
256 |
|
64 | 257 |
void DoFirstStartL(); |
258 |
||
259 |
void SetHeaderAttributesL(); |
|
260 |
||
261 |
void LaunchStylusPopupMenuL( const TPoint& aPoint ); |
|
262 |
||
263 |
private: |
|
264 |
// Pointer to Alf environment |
|
265 |
CAlfEnv* iEnv; |
|
266 |
||
267 |
// Data to be filled from custom message |
|
268 |
CFSMailBox* iMailBox; |
|
269 |
||
270 |
// Layouts |
|
271 |
CAlfAnchorLayout* iScreenAnchorLayout; |
|
272 |
CAlfAnchorLayout* iSearchTopBarComponentLayout; |
|
273 |
||
274 |
// Top bar visuals and layout |
|
275 |
//CAlfImageVisual* iBarFindImage; <cmail> not in cmail |
|
276 |
CAlfTextVisual* iBarTextVisual; |
|
277 |
||
278 |
// Mail List control and layout |
|
279 |
CFreestyleEmailUiSearchListControl* iSearchListControl; |
|
280 |
CAlfDeckLayout* iSearchListLayout; |
|
281 |
CFSEmailUiMailListModel* iModel; |
|
282 |
CFsTreeList* iSearchList; |
|
283 |
CFsTreeVisualizerBase* iSearchTreeListVisualizer; |
|
284 |
TInt iNumSlots; |
|
285 |
||
286 |
RArray<SSearchListItem> iSearchListItemArray; |
|
287 |
||
288 |
HBufC* iLatestSearchText; |
|
289 |
||
290 |
TBool iThisViewActive; |
|
291 |
||
292 |
TBool iSearchOngoing; |
|
293 |
||
294 |
CFSEmailUiGenericTimer* iStartupCallbackTimer; |
|
295 |
||
296 |
RPointerArray<TDesC> iSearchStrings; |
|
297 |
||
298 |
||
299 |
TBool iMsgDataCouldBeChanged; |
|
300 |
||
301 |
// Previous view uid |
|
302 |
TUid iPreviousViewUid; |
|
303 |
||
304 |
TInt iListMode; |
|
305 |
TInt iNodesInUse; |
|
306 |
||
307 |
TFSMailMsgId iLatestOpenedMrId; |
|
308 |
||
309 |
TInt iSearchCount; |
|
310 |
||
311 |
TAknUiZoom iCurrentZoomLevel; |
|
312 |
||
313 |
TBool iFirstStartCompleted; |
|
314 |
||
315 |
TBool iListAddedToControlGroup; //<cmail> |
|
316 |
TBool iPreparedForExit; //<cmail> |
|
317 |
||
318 |
CAknStylusPopUpMenu* iStylusPopUpMenu; |
|
319 |
TBool iStylusPopUpMenuVisible; |
|
320 |
||
321 |
//prevents improper executing of Call application - when call to contact |
|
322 |
TBool iConsumeStdKeyYes_KeyUp; |
|
323 |
// decreases search priority to enable search for contact when call to contact |
|
324 |
TInt iRequiredSearchPriority; |
|
325 |
}; |
|
326 |
||
327 |
#endif |