|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Main view of the Mce. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MCEMAINVIEWLISTVIEW_H |
|
22 #define MCEMAINVIEWLISTVIEW_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <aknview.h> // CAknView |
|
26 #include <msvapi.h> |
|
27 |
|
28 #include <AiwServiceHandler.h> |
|
29 |
|
30 //#include "MceBaseListView.h" |
|
31 #include "MceListItem.h" |
|
32 #include "MceMainViewListItemArray.h" |
|
33 |
|
34 #include "mcetemplate.h" |
|
35 |
|
36 #include <bldvariant.hrh> |
|
37 |
|
38 #include <ImumInHealthServices.h> |
|
39 |
|
40 // FORWARD DECLARATIONS |
|
41 |
|
42 class CMsvSession; |
|
43 class CMceUi; |
|
44 class CMceSessionHolder; |
|
45 class CMceBitmapResolver; |
|
46 class CMceMainViewEmptyListContainer; |
|
47 class CMceMainViewListContainer; |
|
48 |
|
49 // CLASS DECLARATION |
|
50 |
|
51 /** |
|
52 * Main view of the Mce. |
|
53 */ |
|
54 class CMceMainViewListView : |
|
55 public CAknView, |
|
56 public MMceMainViewListItemArrayObserver, |
|
57 public MEikListBoxObserver, |
|
58 public MEikScrollBarObserver, |
|
59 public MMsvSessionObserver |
|
60 { |
|
61 public: |
|
62 |
|
63 public: // Constructors and destructor |
|
64 |
|
65 /** |
|
66 * Two-phased constructor. |
|
67 */ |
|
68 static CMceMainViewListView* NewL( |
|
69 CMsvSessionPtr aSession, |
|
70 CMceSessionHolder& aSessionHolder, |
|
71 CMceBitmapResolver& aBitmapResolver ); |
|
72 |
|
73 /** |
|
74 * Destructor. |
|
75 */ |
|
76 virtual ~CMceMainViewListView(); |
|
77 |
|
78 public: // new function |
|
79 |
|
80 /** |
|
81 * Sets item id (from msgs) to be selected when mce main view is activated. |
|
82 * Called by message list view when closing. |
|
83 * @param: aFolderId: id of the folder to be selected |
|
84 */ |
|
85 void SetSelectedFolderId( TMsvId aFolderId ); |
|
86 |
|
87 /** |
|
88 * Sets selection so that Delivery reports item is selected next time |
|
89 * main view is activated. |
|
90 */ |
|
91 void SetDeliveryReportsSelected( ); |
|
92 |
|
93 /** |
|
94 * Set special MSK button |
|
95 */ |
|
96 void SetSpecialMSKButtonL(TInt aResourceId); |
|
97 |
|
98 /** |
|
99 * Should be called by mce after message server startup. |
|
100 * This adds view to session observer list and creates needed CMsvEntries. |
|
101 */ |
|
102 virtual void HandleMsgServerStartupL(); |
|
103 |
|
104 /** |
|
105 * Returns pointer to list container. |
|
106 * @return Pointer to list container |
|
107 */ |
|
108 CMceMainViewListContainer* ListContainer() const; |
|
109 |
|
110 /** |
|
111 * |
|
112 */ |
|
113 void HandleClientRectChange(); |
|
114 |
|
115 /** |
|
116 * Reconstructs main view folder list |
|
117 */ |
|
118 void ConstructMainViewL(); |
|
119 |
|
120 public: // Functions from base classes |
|
121 |
|
122 |
|
123 /** |
|
124 * From CAknView |
|
125 */ |
|
126 TUid Id() const; |
|
127 |
|
128 /** |
|
129 * From CAknView |
|
130 */ |
|
131 void DoActivateL( |
|
132 const TVwsViewId& aPrevViewId, |
|
133 TUid aCustomMessageId, |
|
134 const TDesC8& aCustomMessage ); |
|
135 |
|
136 /** |
|
137 * From CAknView |
|
138 */ |
|
139 void DoDeactivate(); |
|
140 |
|
141 /** |
|
142 * From CAknView |
|
143 */ |
|
144 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
145 |
|
146 /** |
|
147 * From MEikCommandObserver |
|
148 */ |
|
149 void HandleCommandL(TInt aCommand); |
|
150 |
|
151 /** |
|
152 * From MEikCommandObserver |
|
153 */ |
|
154 virtual void ProcessCommandL(TInt aCommand); |
|
155 |
|
156 /** |
|
157 * From MMsvSessionObserver |
|
158 */ |
|
159 void HandleSessionEventL( |
|
160 TMsvSessionEvent aEvent, |
|
161 TAny* aArg1, |
|
162 TAny* aArg2, |
|
163 TAny* aArg3 ); |
|
164 |
|
165 /** |
|
166 * From MMceMainViewListItemArrayObserver |
|
167 */ |
|
168 virtual void MceListItemArrayChangedL( ); |
|
169 |
|
170 /** |
|
171 * Called Main view refresh is happening |
|
172 * and need to know flick is ON\OFF |
|
173 * @return ETrue if flick is ON |
|
174 * otherwise OFF |
|
175 */ |
|
176 TBool MceListItemArrayFlickEvent(); |
|
177 |
|
178 protected: // Functions from base classes |
|
179 |
|
180 /** |
|
181 * From MEikListBoxObserver |
|
182 */ |
|
183 void HandleListBoxEventL( |
|
184 CEikListBox* aListBox, |
|
185 TListBoxEvent aEventType); |
|
186 |
|
187 protected: // Functions from base classes |
|
188 |
|
189 /** |
|
190 * From MEikScrollBarObserver |
|
191 */ |
|
192 void HandleScrollEventL( |
|
193 CEikScrollBar* aScrollBar, |
|
194 TEikScrollEvent aEventType); |
|
195 |
|
196 private: |
|
197 |
|
198 /** |
|
199 * Constructor is private. |
|
200 */ |
|
201 CMceMainViewListView( |
|
202 CMsvSessionPtr aSession, |
|
203 CMceSessionHolder& aSessionHolder, |
|
204 CMceBitmapResolver& aBitmapResolver ); |
|
205 |
|
206 /** |
|
207 * By default Symbian OS constructor is private. |
|
208 */ |
|
209 void ConstructL(); |
|
210 |
|
211 /** |
|
212 * When user wants to open some folder then this is called. |
|
213 * Handles folder opening and extra opens such as CBS launching, creating |
|
214 * remote mailbox if not mailboxes. |
|
215 */ |
|
216 void ChangeViewL(); |
|
217 |
|
218 /** |
|
219 * Adds extra items to the list array: |
|
220 * "Write message", "Delivery reports", "No remote mailboxes" |
|
221 */ |
|
222 void AddExtraItemsL(); |
|
223 |
|
224 /** |
|
225 * Creates containers etc. after msv session is ready. |
|
226 */ |
|
227 void CreateContainerAndActivateL(); |
|
228 |
|
229 /** |
|
230 * Finds changed folder's index in main view list. |
|
231 * For example, if documents\subfolder is change then this finds an |
|
232 * index for the documents and changes its bitmap index to KErrNotFound |
|
233 * @param aChangedFolderId: id of the changed folder. |
|
234 */ |
|
235 void CheckMainViewBitmapL( TMsvId aChangedFolderId ) const; |
|
236 |
|
237 /** |
|
238 * Changes all the bitmap indexes in mainview to KErrNotFound. |
|
239 */ |
|
240 void ResetBitmapsL() const; |
|
241 |
|
242 /** |
|
243 * Starts application when extra item is selected from the |
|
244 * main view list. |
|
245 */ |
|
246 void StartAppL( TInt aCommandId ); |
|
247 |
|
248 /** |
|
249 * Counts how many mailboxes with unread messages there is |
|
250 * @param aFirstMailboxId: id of the first mailbox with unread messages, |
|
251 * 0 if no mailboxes with unread messages |
|
252 * @return Number of mailboxes with unread messages |
|
253 * @since 3.1 |
|
254 */ |
|
255 TInt MailboxWithUnreadMessagesL( TMsvId& aFirstMailboxId ); |
|
256 |
|
257 /** |
|
258 * Input parameter list for AIW plugin |
|
259 */ |
|
260 CAiwGenericParamList* AiwSyncParamListLC(TInt aId, const TDesC& aText); |
|
261 |
|
262 /** |
|
263 * Show a confirmation note to the user after successful |
|
264 * setting of the default view |
|
265 */ |
|
266 void ShowConfirmationNoteL( TInt aResourceID ); |
|
267 |
|
268 /** |
|
269 * Set the default view settings |
|
270 */ |
|
271 TBool SetMceDefaultViewL(TBool aVal); |
|
272 |
|
273 /** |
|
274 * Get the current default view settings |
|
275 */ |
|
276 TInt GetMceDefaultViewL(); |
|
277 |
|
278 private: // Data |
|
279 CMceMainViewListContainer* iMsgListContainer; |
|
280 |
|
281 CMsvSessionPtr iSession; |
|
282 CMsvEntry* iFolderEntry; |
|
283 |
|
284 CMceSessionHolder& iSessionHolder; |
|
285 |
|
286 CMceBitmapResolver& iBitmapResolver; |
|
287 |
|
288 TBool iMceViewActivated; |
|
289 TBool iMsvSessionReady; |
|
290 |
|
291 CAiwServiceHandler* iAiwServiceHandler; |
|
292 TMceFlags iListViewFlags; |
|
293 |
|
294 TMsvId iCurrentItemId; |
|
295 |
|
296 CMceUi* iMceUi; |
|
297 |
|
298 TInt iSelectedIndex; // selection before deactivated |
|
299 TInt iTopItemIndex; // top item before deactivated |
|
300 TMsvId iSelectionFolderId; |
|
301 TBool iDrawListbox; |
|
302 CMceMainViewEmptyListContainer* iEmptyListContainer; |
|
303 TInt iPerformOperationAfterMsgStart; // 0 when do nothing, KMceShowMail or KMceShowAudioMessage if activated before msg started. |
|
304 // ETrue if MCE integration feature is ON. In practice, this means |
|
305 // that S60 mailboxes are hided from MCE main view |
|
306 TBool iEmailClientIntegration; |
|
307 |
|
308 // ETrue if Selectable Default Email feature is on |
|
309 TBool iSelectableEmail; |
|
310 |
|
311 // Id of the email application (other than platform email application) |
|
312 TInt iMtmPluginId; |
|
313 |
|
314 /** |
|
315 * CMail Changes, it will be True if |
|
316 * KFeatureIdFfEmailFramework is enabled |
|
317 */ |
|
318 TBool iEmailFramework; |
|
319 /** |
|
320 * Flag that shows Flicking status in Main View |
|
321 * ETrue if ON |
|
322 * otherwsie EFalse |
|
323 */ |
|
324 TBool iFlick; |
|
325 }; |
|
326 |
|
327 #endif |
|
328 |
|
329 // End of file |