|
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 |
|
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 public MFsActionMenuPositionGiver, |
|
78 //<cmail> |
|
79 public MFSEmailUiGenericTimerCallback, |
|
80 public MFSEmailUiContactHandlerObserver |
|
81 { |
|
82 public: |
|
83 static CFSEmailUiSearchListVisualiser* NewL(CAlfEnv& aEnv, CFreestyleEmailUiAppUi* aAppUi, CAlfControlGroup& aSeacrhListControlGroup); |
|
84 static CFSEmailUiSearchListVisualiser* NewLC(CAlfEnv& aEnv, CFreestyleEmailUiAppUi* aAppUi, CAlfControlGroup& aSearchListControlGroup); |
|
85 virtual ~CFSEmailUiSearchListVisualiser(); |
|
86 void PrepareForExit(); |
|
87 |
|
88 public: // from CFsEmailUiViewBase |
|
89 void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); |
|
90 |
|
91 // From view |
|
92 TUid Id() const; |
|
93 // <cmail> Toolbar |
|
94 /*void DoActivateL(const TVwsViewId& aPrevViewId, |
|
95 TUid aCustomMessageId, |
|
96 const TDesC8& aCustomMessage);*/ |
|
97 // </cmail> Toolbar |
|
98 void ChildDoDeactivate(); |
|
99 void HandleCommandL( TInt aCommand ); |
|
100 |
|
101 /** |
|
102 * @see CFsEmailUiViewBase::SetStatusBarLayout |
|
103 */ |
|
104 void SetStatusBarLayout(); |
|
105 |
|
106 // Dynamic variant switch, called by appui |
|
107 void HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType ); |
|
108 void GetParentLayoutsL( RPointerArray<CAlfVisual>& aLayoutArray ) const; |
|
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 |
|
116 public: // from MFSMailBoxSearchObserver |
|
117 void MatchFoundL( CFSMailMessage* aMatchMessage ); |
|
118 void SearchCompletedL(); |
|
119 |
|
120 |
|
121 public: // new methods |
|
122 // Refresh the whole list |
|
123 void RefreshL(); |
|
124 |
|
125 // Mail list current model data |
|
126 CFSEmailUiMailListModel* Model(); |
|
127 |
|
128 // Event handling forwarded from control |
|
129 TBool OfferEventL( const TAlfEvent& aEvent ); |
|
130 |
|
131 // Used from callback |
|
132 TInt LaunchSearchDialogL(); |
|
133 |
|
134 // Used from appui to get the current index in search list |
|
135 TInt HighlightedIndex() const; |
|
136 |
|
137 // Start timer callback |
|
138 void TimerEventL( CFSEmailUiGenericTimer* aTriggeredTimer ); |
|
139 |
|
140 // Helper functions to get highlighted message id and folder id |
|
141 TFSMailMsgId HighlightedMessageFolderId(); |
|
142 TFSMailMsgId HighlightedMessageId(); |
|
143 |
|
144 void HandleMailBoxEventL( TFSMailEvent aEvent, TFSMailMsgId aMailbox, |
|
145 TAny* aParam1, TAny* aParam2, TAny* aParam3 ); |
|
146 void RemoveMsgItemsFromListIfFoundL( const RArray<TFSMailMsgId>& aEntryIds ); |
|
147 |
|
148 public: // From MFsTreeListObserver |
|
149 //<cmail> touch |
|
150 void TreeListEventL( const TFsTreeListEvent aEvent, const TFsTreeItemId aId ); |
|
151 |
|
152 // From MFsActionMenuPositionGiver |
|
153 TPoint ActionMenuPosition(); |
|
154 //</cmail> |
|
155 |
|
156 public: // From MFSEMailUiContactHandlerObserver |
|
157 |
|
158 void OperationCompleteL( TContactHandlerCmd aCmd, |
|
159 const RPointerArray<CFSEmailUiClsItem>& aContacts ); |
|
160 void OperationErrorL( TContactHandlerCmd, TInt aError ); |
|
161 |
|
162 // <cmail> Toolbar |
|
163 private: // from |
|
164 |
|
165 /** |
|
166 * @see CFsEmailUiViewBase::ChildDoActivateL |
|
167 */ |
|
168 void ChildDoActivateL( const TVwsViewId& aPrevViewId, |
|
169 TUid aCustomMessageId, |
|
170 const TDesC8& aCustomMessage ); |
|
171 |
|
172 // </cmail> Toolbar |
|
173 |
|
174 // Called when flip state is changed |
|
175 void FlipStateChangedL( TBool aFlipOpen ); |
|
176 |
|
177 /** |
|
178 * Handles the focus state changes |
|
179 * @param aShow Indicates if focus should become visible or removed |
|
180 */ |
|
181 void HandleTimerFocusStateChange( TBool aShow ); |
|
182 |
|
183 private: |
|
184 CFSEmailUiSearchListVisualiser( CFreestyleEmailUiAppUi* aAppUi, CAlfEnv& aEnv, CAlfControlGroup& aSearchListControlGroup ); |
|
185 void ConstructL(); |
|
186 |
|
187 void ReScaleUiL(); |
|
188 void SetSearchListLayoutAnchors(); |
|
189 void SetSearchListTopBarLayoutAnchors(); |
|
190 |
|
191 void CreatePlainNodeL( const TDesC& aItemDataBuff, |
|
192 CFsTreePlainOneLineNodeData* &aItemData, |
|
193 CFsTreePlainOneLineNodeVisualizer* &aNodeVisualizer ) const; |
|
194 void ExpandAllNodesL(); |
|
195 void CollapseAllNodesL(); |
|
196 |
|
197 // Helper functions to access model data |
|
198 TFSMailMsgId MsgIdFromIndex( TInt aItemIdx ) const; |
|
199 TFSMailMsgId MsgIdFromListId( TFsTreeItemId aListId ) const; |
|
200 CFSMailMessage& MsgPtrFromListId( TFsTreeItemId aListId ); |
|
201 |
|
202 // Item data and visualiser helper functions |
|
203 MFsTreeItemData* ItemDataFromItemId( TFsTreeItemId aItemId ); |
|
204 MFsTreeItemVisualizer* ItemVisualiserFromItemId( TFsTreeItemId aItemId ); |
|
205 |
|
206 // Helpers to get the ordinal of a message in the iModel |
|
207 TInt ItemIndexFromMessageId( const TFSMailMsgId& aMessageId ) const; |
|
208 TInt NextMessageIndex( TInt aCurMsgIdx ) const; |
|
209 TInt PreviousMessageIndex( TInt aCurMsgIdx ) const; |
|
210 |
|
211 //<cmail> touch |
|
212 // Helper class for resolving touch events and actions |
|
213 void DoHandleActionL(); |
|
214 //</cmail> |
|
215 |
|
216 // Open highlighted mail |
|
217 void OpenHighlightedMailL(); |
|
218 |
|
219 // Compose, reply, reply all and forward |
|
220 void ReplyL( CFSMailMessage* aMsgPtr ); |
|
221 void ReplyAllL( CFSMailMessage* aMsgPtr ); |
|
222 void ForwardL( CFSMailMessage* aMsgPtr ); |
|
223 void DoReplyForwardL( TEditorLaunchMode aMode, CFSMailMessage* aMsgPtr = NULL ); |
|
224 |
|
225 void StartSearchL(); |
|
226 void StopSearchL(); |
|
227 |
|
228 // <cmail> fixed CS high cat. finding |
|
229 void ResetResultListL(); |
|
230 |
|
231 void ChangeReadStatusOfHighlightedL( TInt aRead ); |
|
232 |
|
233 void CheckAndUpdateFocusedMessageL(); |
|
234 |
|
235 void RemoveFocusedFromListL(); |
|
236 |
|
237 void UpdateMsgIconAndBoldingL( CFSMailMessage* aMsgPtr ); |
|
238 void UpdateMsgIconAndBoldingL( TInt aListIndex ); |
|
239 |
|
240 // Delete messages |
|
241 void DeleteFocusedMessageL(); |
|
242 |
|
243 void CallToSenderL(); |
|
244 |
|
245 void UpdateMailListSettingsL(); |
|
246 |
|
247 void UpdatePreviewPaneTextForItemL( CFsTreePlainTwoLineItemData* aItemData, CFSMailMessage* aMsgPtr ); |
|
248 void FilterPreviewPaneTextL( TDes& aText ) const; |
|
249 |
|
250 void SetMskL(); |
|
251 |
|
252 void DoFirstStartL(); |
|
253 |
|
254 void LaunchActionMenuL(); |
|
255 |
|
256 void HandleActionMenuCommandL( TActionMenuCustomItemId itemId ); |
|
257 |
|
258 void SetHeaderAttributesL(); |
|
259 |
|
260 private: |
|
261 // Pointer to Alf environment |
|
262 CAlfEnv* iEnv; |
|
263 |
|
264 // Data to be filled from custom message |
|
265 CFSMailBox* iMailBox; |
|
266 |
|
267 // Layouts |
|
268 CAlfAnchorLayout* iScreenAnchorLayout; |
|
269 CAlfAnchorLayout* iSearchTopBarComponentLayout; |
|
270 |
|
271 // Top bar visuals and layout |
|
272 CAlfDeckLayout* iSearchTopBarLayout; |
|
273 CAlfImageVisual* iBarBgVisual; |
|
274 //CAlfImageVisual* iBarFindImage; <cmail> not in cmail |
|
275 CAlfTextVisual* iBarTextVisual; |
|
276 |
|
277 // Mail List control and layout |
|
278 CFreestyleEmailUiSearchListControl* iSearchListControl; |
|
279 CAlfDeckLayout* iSearchListLayout; |
|
280 CFSEmailUiMailListModel* iModel; |
|
281 CFsTreeList* iSearchList; |
|
282 CFsTreeVisualizerBase* iSearchTreeListVisualizer; |
|
283 TInt iNumSlots; |
|
284 |
|
285 RArray<SSearchListItem> iSearchListItemArray; |
|
286 |
|
287 HBufC* iLatestSearchText; |
|
288 |
|
289 TBool iThisViewActive; |
|
290 |
|
291 TBool iSearchOngoing; |
|
292 |
|
293 CFSEmailUiGenericTimer* iStartupCallbackTimer; |
|
294 |
|
295 RPointerArray<TDesC> iSearchStrings; |
|
296 |
|
297 |
|
298 TBool iMsgDataCouldBeChanged; |
|
299 |
|
300 // Previous view uid |
|
301 TUid iPreviousViewUid; |
|
302 |
|
303 TInt iListMode; |
|
304 TInt iNodesInUse; |
|
305 |
|
306 TFSMailMsgId iLatestOpenedMrId; |
|
307 |
|
308 TInt iSearchCount; |
|
309 |
|
310 TAknUiZoom iCurrentZoomLevel; |
|
311 |
|
312 TBool iFirstStartCompleted; |
|
313 |
|
314 TBool iListAddedToControlGroup; //<cmail> |
|
315 TBool iPreparedForExit; //<cmail> |
|
316 |
|
317 }; |
|
318 |
|
319 #endif |