|
1 /* |
|
2 * Copyright (c) 2006 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 * POP3 MTM Ui data layer base API |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // Standard includes |
|
21 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
22 #include <mtmuidsdef.hrh> |
|
23 #endif |
|
24 #include <coemain.h> // ccoeenv |
|
25 #include <eikon.rsg> |
|
26 |
|
27 // Messaging include |
|
28 #include <mtclbase.h> |
|
29 #include <mtmuidef.hrh> |
|
30 #include <miutset.h> |
|
31 #include <mtud.hrh> |
|
32 #include <MtmExtendedCapabilities.hrh> |
|
33 |
|
34 #include <AknsUtils.h> |
|
35 #include <AknsConstants.h>//skinned icon ids |
|
36 |
|
37 #include <data_caging_path_literals.hrh> |
|
38 |
|
39 // Specific includes |
|
40 #include <pop3cmds.h> |
|
41 #include <popcmtm.h> |
|
42 #include "ImumPanic.h" |
|
43 #include <imum.rsg> |
|
44 #include <muiu.mbg> |
|
45 #include "Pop3MtmUiData.h" |
|
46 #include "EmailEditorViewerUids.h" |
|
47 #include "ImumMtmLogging.h" |
|
48 |
|
49 // Constants |
|
50 const TInt KPop3MtmUdNumberOfZoomStates = 2; // second one is mask! |
|
51 const TInt KImumPop3FirstBitmapIndex = EMbmMuiuQgn_prop_mce_remote_sub; |
|
52 const TInt KImumPop3LastBitmapIndex = EMbmMuiuQgn_prop_mce_mail_unfet_unread_mask; |
|
53 |
|
54 // Defines |
|
55 _LIT( KPop3MtmUdResourceFile, "IMUM"); |
|
56 // Correct path is added to literal when it is used. |
|
57 _LIT( KPop3MtmUdBitmapFile, "z:muiu.MBM"); |
|
58 |
|
59 // ---------------------------------------------------------------------------- |
|
60 // CPop3MtmUiData::NewPP3IMtmUiDataLayerL() |
|
61 // ---------------------------------------------------------------------------- |
|
62 EXPORT_C CBaseMtmUiData* NewPP3IMtmUiDataLayerL(CRegisteredMtmDll& aRegisteredDll) |
|
63 { |
|
64 return CPop3MtmUiData::NewL(aRegisteredDll); |
|
65 } |
|
66 |
|
67 // ---------------------------------------------------------------------------- |
|
68 // CPop3MtmUiData::NewL() |
|
69 // ---------------------------------------------------------------------------- |
|
70 CPop3MtmUiData* CPop3MtmUiData::NewL(CRegisteredMtmDll& aRegisteredDll) |
|
71 { |
|
72 IMUM_STATIC_CONTEXT( CPop3MtmUiData::NewL, 0, mtm, KImumMtmLog ); |
|
73 IMUM_IN(); |
|
74 |
|
75 CPop3MtmUiData* base=new(ELeave) CPop3MtmUiData(aRegisteredDll); |
|
76 CleanupStack::PushL(base); |
|
77 base->ConstructL(); |
|
78 CleanupStack::Pop(); |
|
79 IMUM_OUT(); |
|
80 return base; |
|
81 } |
|
82 |
|
83 // ---------------------------------------------------------------------------- |
|
84 // CPop3MtmUiData::CPop3MtmUiData() |
|
85 // ---------------------------------------------------------------------------- |
|
86 CPop3MtmUiData::CPop3MtmUiData(CRegisteredMtmDll& aRegisteredDll) |
|
87 : CBaseMtmUiData(aRegisteredDll) |
|
88 { |
|
89 IMUM_CONTEXT( CPop3MtmUiData::CPop3MtmUiData, 0, KImumMtmLog ); |
|
90 IMUM_IN(); |
|
91 |
|
92 __DECLARE_NAME(_S("CPop3MtmUiData")); |
|
93 IMUM_OUT(); |
|
94 } |
|
95 |
|
96 // ---------------------------------------------------------------------------- |
|
97 // CPop3MtmUiData::ConstructL() |
|
98 // ---------------------------------------------------------------------------- |
|
99 void CPop3MtmUiData::ConstructL() |
|
100 { |
|
101 IMUM_CONTEXT( CPop3MtmUiData::ConstructL, 0, KImumMtmLog ); |
|
102 IMUM_IN(); |
|
103 |
|
104 CBaseMtmUiData::ConstructL(); |
|
105 |
|
106 iLastResortIcon = new(ELeave) CArrayPtrFlat<CFbsBitmap>(1); |
|
107 CWsBitmap* bitmap = new(ELeave) CWsBitmap(iCoeEnv->WsSession()); |
|
108 CleanupStack::PushL(bitmap); |
|
109 User::LeaveIfError( bitmap->Create(TSize(1, 1), iCoeEnv->ScreenDevice()->DisplayMode()) ); |
|
110 iLastResortIcon->AppendL(bitmap); |
|
111 CleanupStack::Pop(); // bitmap |
|
112 IMUM_OUT(); |
|
113 } |
|
114 |
|
115 // ---------------------------------------------------------------------------- |
|
116 // CPop3MtmUiData::~CPop3MtmUiData() |
|
117 // ---------------------------------------------------------------------------- |
|
118 CPop3MtmUiData::~CPop3MtmUiData() |
|
119 { |
|
120 IMUM_CONTEXT( CPop3MtmUiData::~CPop3MtmUiData, 0, KImumMtmLog ); |
|
121 IMUM_IN(); |
|
122 |
|
123 if(iLastResortIcon) |
|
124 { |
|
125 iLastResortIcon->ResetAndDestroy(); |
|
126 delete iLastResortIcon; |
|
127 } |
|
128 IMUM_OUT(); |
|
129 } |
|
130 |
|
131 // ---------------------------------------------------------------------------- |
|
132 // CPop3MtmUiData::OperationSupportedL() |
|
133 // ---------------------------------------------------------------------------- |
|
134 TInt CPop3MtmUiData::OperationSupportedL( |
|
135 TInt aOperationId, |
|
136 const TMsvEntry& aContext) const |
|
137 { |
|
138 IMUM_CONTEXT( CPop3MtmUiData::OperationSupportedL, 0, KImumMtmLog ); |
|
139 IMUM_IN(); |
|
140 |
|
141 if ( CheckEntry( aContext ) ) |
|
142 { |
|
143 switch ( aOperationId ) |
|
144 { |
|
145 case KMtmUiFunctionFetchAll: |
|
146 case KMtmUiFunctionFetchNew: |
|
147 case KMtmUiFunctionFetchSelected: |
|
148 case KMtmUiFunctionGetNew: |
|
149 IMUM_OUT(); |
|
150 return 0; // Operation *IS* supported |
|
151 |
|
152 case KPOP3MTMDisconnect: |
|
153 if ( aContext.Connected() ) |
|
154 { |
|
155 IMUM_OUT(); |
|
156 return 0;// Operation *IS* supported |
|
157 } |
|
158 return R_EIK_TBUF_NOT_AVAILABLE; |
|
159 |
|
160 case KPOP3MTMConnect: |
|
161 if ( !aContext.Connected() ) |
|
162 { |
|
163 IMUM_OUT(); |
|
164 return 0;// Operation *IS* supported |
|
165 } |
|
166 IMUM_OUT(); |
|
167 return R_EIK_TBUF_NOT_AVAILABLE; |
|
168 |
|
169 case KMtmUiFunctionMessageInfo: |
|
170 if ( aContext.iType.iUid==KUidMsvMessageEntryValue ) |
|
171 { |
|
172 IMUM_OUT(); |
|
173 return 0;// Operation *IS* supported |
|
174 } |
|
175 break; |
|
176 default: |
|
177 // Not supported. |
|
178 break; |
|
179 } |
|
180 } |
|
181 IMUM_OUT(); |
|
182 |
|
183 return R_EIK_TBUF_NOT_AVAILABLE; |
|
184 } |
|
185 |
|
186 // ---------------------------------------------------------------------------- |
|
187 // CPop3MtmUiData::QueryCapability() |
|
188 // ---------------------------------------------------------------------------- |
|
189 TInt CPop3MtmUiData::QueryCapability(TUid aCapability, TInt& aResponse) const |
|
190 { |
|
191 IMUM_CONTEXT( CPop3MtmUiData::QueryCapability, 0, KImumMtmLog ); |
|
192 IMUM_IN(); |
|
193 |
|
194 switch (aCapability.iUid) |
|
195 { |
|
196 // --- Supported valued capabilities --- |
|
197 case KUidMtmQueryMaxBodySizeValue: |
|
198 case KUidMtmQueryMaxTotalMsgSizeValue: |
|
199 aResponse=KMaxTInt; |
|
200 break; |
|
201 case KUidMsvMtmQueryEditorUidValue: |
|
202 aResponse=KUidMsgInternetMailEditorAppValue; |
|
203 break; |
|
204 case KUidMsvMtmQueryViewerUidValue: |
|
205 aResponse=KUidMsgInternetMailViewerAppValue; |
|
206 break; // |
|
207 case KUidMtmQuerySupportedBodyValue: |
|
208 aResponse = KMtm7BitBody | KMtm8BitBody | KMtm16BitBody; |
|
209 break; |
|
210 |
|
211 // --- Supported non-valued capabilities --- |
|
212 case KUidMsvMtmUiQueryConnectionOrientedServices: |
|
213 case KUidMtmQueryCanReceiveMsgValue: |
|
214 case KUidMsvMtmUiQueryCanGetNew: |
|
215 case KMtmUiFunctionMessageInfo: |
|
216 break; |
|
217 default: |
|
218 IMUM_OUT(); |
|
219 return KErrNotSupported; |
|
220 }; |
|
221 IMUM_OUT(); |
|
222 return KErrNone; |
|
223 } |
|
224 |
|
225 // ---------------------------------------------------------------------------- |
|
226 // CPop3MtmUiData::ContextIcon() |
|
227 // ---------------------------------------------------------------------------- |
|
228 const CBaseMtmUiData::CBitmapArray& CPop3MtmUiData::ContextIcon( |
|
229 const TMsvEntry& aContext, |
|
230 TInt aStateFlags ) const |
|
231 { |
|
232 IMUM_CONTEXT( CBaseMtmUiData::CBitmapArray, 0, KImumMtmLog ); |
|
233 IMUM_IN(); |
|
234 |
|
235 __ASSERT_DEBUG( CheckEntry(aContext), User::Panic(KImumMtmUiPanic, EPop3MtmUdNoIconAvailable) ); |
|
236 |
|
237 __ASSERT_ALWAYS( aContext.iType.iUid != KUidMsvAttachmentEntryValue, User::Panic(KImumMtmUiPanic, EPop3MtmUdNoIconForAttachment) ); |
|
238 |
|
239 if ( iIconArrays && !iIconArrays->Count() ) |
|
240 { |
|
241 TRAPD( err, const_cast<CPop3MtmUiData*>(this)-> |
|
242 CreateSkinnedBitmapsL( KPop3MtmUdNumberOfZoomStates ) ); |
|
243 if ( err != KErrNone ) |
|
244 { |
|
245 IMUM_OUT(); |
|
246 // Failed to load |
|
247 return *iLastResortIcon; |
|
248 } |
|
249 } |
|
250 |
|
251 TInt retIndex = 0; |
|
252 if ( aContext.iType.iUid == KUidMsvServiceEntryValue ) |
|
253 { |
|
254 retIndex = ( aStateFlags & EMtudEntryStateOpen ) ? |
|
255 EImumPropMceRemoteNewSub : |
|
256 EImumPropMceRemoteSub; |
|
257 } |
|
258 else |
|
259 { |
|
260 // Email message bitmap |
|
261 TMsvEmailEntry mailEntry( aContext ); |
|
262 if ( EDisconnectedDeleteOperation == mailEntry.DisconnectedOperation() ) |
|
263 { |
|
264 retIndex = EImumPropMceMailFetReaDel; |
|
265 } |
|
266 else if ( !aContext.Complete() ) |
|
267 { |
|
268 retIndex = aContext.Unread() ? |
|
269 EImumPropMceMailUnfetUnread : |
|
270 EImumPropMceMailUnfetRead; |
|
271 } |
|
272 else |
|
273 { |
|
274 retIndex = aContext.Unread() ? |
|
275 EImumPropMceMailFetUnread : |
|
276 EImumPropMceMailFetRead; |
|
277 } |
|
278 } |
|
279 IMUM_OUT(); |
|
280 return *iIconArrays->At( retIndex / KPop3MtmUdNumberOfZoomStates ); |
|
281 } |
|
282 |
|
283 // ---------------------------------------------------------------------------- |
|
284 // CPop3MtmUiData::PopulateArraysL() |
|
285 // ---------------------------------------------------------------------------- |
|
286 void CPop3MtmUiData::PopulateArraysL() |
|
287 { |
|
288 IMUM_CONTEXT( CPop3MtmUiData::PopulateArraysL, 0, KImumMtmLog ); |
|
289 IMUM_IN(); |
|
290 |
|
291 ReadFunctionsFromResourceFileL(R_POP3UD_FUNCTION_ARRAY); |
|
292 |
|
293 IMUM_OUT(); |
|
294 // Defer bitmap loading until requested. |
|
295 } |
|
296 |
|
297 // ---------------------------------------------------------------------------- |
|
298 // CPop3MtmUiData::GetResourceFileName() |
|
299 // ---------------------------------------------------------------------------- |
|
300 void CPop3MtmUiData::GetResourceFileName(TFileName& aFileName) const |
|
301 { |
|
302 IMUM_CONTEXT( CPop3MtmUiData::GetResourceFileName, 0, KImumMtmLog ); |
|
303 IMUM_IN(); |
|
304 |
|
305 aFileName=KPop3MtmUdResourceFile; |
|
306 IMUM_OUT(); |
|
307 } |
|
308 |
|
309 // ---------------------------------------------------------------------------- |
|
310 // CPop3MtmUiData::CanCreateEntryL() |
|
311 // ---------------------------------------------------------------------------- |
|
312 TBool CPop3MtmUiData::CanCreateEntryL(const TMsvEntry& aParent, TMsvEntry& aNewEntry, TInt& aReasonResourceId) const |
|
313 { |
|
314 IMUM_CONTEXT( CPop3MtmUiData::CanCreateEntryL, 0, KImumMtmLog ); |
|
315 IMUM_IN(); |
|
316 |
|
317 aReasonResourceId=R_EIK_TBUF_NOT_AVAILABLE; |
|
318 if (CheckEntry(aNewEntry)) |
|
319 { |
|
320 // --- Can't create POP3 attachments or messages - They're created when receiving --- |
|
321 if ( (aNewEntry.iType.iUid==KUidMsvServiceEntryValue) && (aParent.Id()==KMsvRootIndexEntryIdValue) ) |
|
322 { |
|
323 aReasonResourceId=0; |
|
324 IMUM_OUT(); |
|
325 return ETrue; |
|
326 } |
|
327 } |
|
328 IMUM_OUT(); |
|
329 return EFalse; |
|
330 } |
|
331 |
|
332 // ---------------------------------------------------------------------------- |
|
333 // CPop3MtmUiData::CanOpenEntryL() |
|
334 // ---------------------------------------------------------------------------- |
|
335 TBool CPop3MtmUiData::CanOpenEntryL(const TMsvEntry& /*aContext*/, TInt& aReasonResourceId) const |
|
336 { |
|
337 IMUM_CONTEXT( CPop3MtmUiData::CanOpenEntryL, 0, KImumMtmLog ); |
|
338 IMUM_IN(); |
|
339 |
|
340 aReasonResourceId=R_EIK_TBUF_NOT_AVAILABLE; |
|
341 IMUM_OUT(); |
|
342 return EFalse; |
|
343 } |
|
344 |
|
345 // ---------------------------------------------------------------------------- |
|
346 // CPop3MtmUiData::CanCloseEntryL() |
|
347 // ---------------------------------------------------------------------------- |
|
348 TBool CPop3MtmUiData::CanCloseEntryL(const TMsvEntry& /*aContext*/, TInt& aReasonResourceId) const |
|
349 { |
|
350 IMUM_CONTEXT( CPop3MtmUiData::CanCloseEntryL, 0, KImumMtmLog ); |
|
351 IMUM_IN(); |
|
352 |
|
353 aReasonResourceId=R_EIK_TBUF_NOT_AVAILABLE; |
|
354 IMUM_OUT(); |
|
355 return EFalse; |
|
356 } |
|
357 |
|
358 // ---------------------------------------------------------------------------- |
|
359 // CPop3MtmUiData::CanViewEntryL() |
|
360 // ---------------------------------------------------------------------------- |
|
361 TBool CPop3MtmUiData::CanViewEntryL(const TMsvEntry& /*aContext*/, TInt& aReasonResourceId) const |
|
362 { |
|
363 IMUM_CONTEXT( CPop3MtmUiData::CanViewEntryL, 0, KImumMtmLog ); |
|
364 IMUM_IN(); |
|
365 |
|
366 aReasonResourceId=R_EIK_TBUF_NOT_AVAILABLE; |
|
367 IMUM_OUT(); |
|
368 return EFalse; |
|
369 } |
|
370 |
|
371 // ---------------------------------------------------------------------------- |
|
372 // CPop3MtmUiData::CanEditEntryL() |
|
373 // ---------------------------------------------------------------------------- |
|
374 TBool CPop3MtmUiData::CanEditEntryL(const TMsvEntry& /*aContext*/, TInt& aReasonResourceId) const |
|
375 { |
|
376 IMUM_CONTEXT( CPop3MtmUiData::CanEditEntryL, 0, KImumMtmLog ); |
|
377 IMUM_IN(); |
|
378 |
|
379 aReasonResourceId=R_EIK_TBUF_NOT_AVAILABLE; |
|
380 IMUM_OUT(); |
|
381 return EFalse; |
|
382 } |
|
383 |
|
384 // ---------------------------------------------------------------------------- |
|
385 // CPop3MtmUiData::CanDeleteFromEntryL() |
|
386 // ---------------------------------------------------------------------------- |
|
387 TBool CPop3MtmUiData::CanDeleteFromEntryL(const TMsvEntry& aContext, TInt& aReasonResourceId) const |
|
388 { |
|
389 IMUM_CONTEXT( CPop3MtmUiData::CanDeleteFromEntryL, 0, KImumMtmLog ); |
|
390 IMUM_IN(); |
|
391 |
|
392 aReasonResourceId=R_EIK_TBUF_NOT_AVAILABLE; |
|
393 if (CheckEntry(aContext)) |
|
394 { |
|
395 const TMsvEmailEntry& context=aContext; |
|
396 if(context.iType.iUid==KUidMsvMessageEntryValue && |
|
397 context.DisconnectedOperation()==ENoDisconnectedOperations) |
|
398 { |
|
399 aReasonResourceId=0; |
|
400 IMUM_OUT(); |
|
401 return ETrue; |
|
402 } |
|
403 } |
|
404 IMUM_OUT(); |
|
405 return EFalse; |
|
406 } |
|
407 |
|
408 // ---------------------------------------------------------------------------- |
|
409 // CPop3MtmUiData::CanUnDeleteFromEntryL() |
|
410 // ---------------------------------------------------------------------------- |
|
411 TBool CPop3MtmUiData::CanUnDeleteFromEntryL(const TMsvEntry& aContext, TInt& aReasonResourceId) const |
|
412 { |
|
413 IMUM_CONTEXT( CPop3MtmUiData::CanUnDeleteFromEntryL, 0, KImumMtmLog ); |
|
414 IMUM_IN(); |
|
415 |
|
416 // N.B. Current Message Centre implementation specifies that aContext is actually the entry |
|
417 // to be undeleted, not the parent. |
|
418 aReasonResourceId=R_EIK_TBUF_NOT_AVAILABLE; |
|
419 if (CheckEntry(aContext)) |
|
420 { |
|
421 const TMsvEmailEntry& context=aContext; |
|
422 if(context.iType.iUid==KUidMsvMessageEntryValue && context.DisconnectedOperation()==EDisconnectedDeleteOperation) |
|
423 { |
|
424 aReasonResourceId=0; |
|
425 IMUM_OUT(); |
|
426 return ETrue; |
|
427 } |
|
428 } |
|
429 IMUM_OUT(); |
|
430 return EFalse; |
|
431 } |
|
432 |
|
433 // ---------------------------------------------------------------------------- |
|
434 // CPop3MtmUiData::CanDeleteServiceL() |
|
435 // ---------------------------------------------------------------------------- |
|
436 TBool CPop3MtmUiData::CanDeleteServiceL(const TMsvEntry& /*aService*/, TInt& aReasonResourceId) const |
|
437 { |
|
438 IMUM_CONTEXT( CPop3MtmUiData::CanDeleteServiceL, 0, KImumMtmLog ); |
|
439 IMUM_IN(); |
|
440 |
|
441 aReasonResourceId=R_EIK_TBUF_NOT_AVAILABLE; |
|
442 IMUM_OUT(); |
|
443 return EFalse; |
|
444 } |
|
445 |
|
446 // ---------------------------------------------------------------------------- |
|
447 // CPop3MtmUiData::CanCopyMoveFromEntryL() |
|
448 // ---------------------------------------------------------------------------- |
|
449 TBool CPop3MtmUiData::CanCopyMoveFromEntryL(const TMsvEntry& /*aContext*/, TInt& aReasonResourceId) const |
|
450 { |
|
451 IMUM_CONTEXT( CPop3MtmUiData::CanCopyMoveFromEntryL, 0, KImumMtmLog ); |
|
452 IMUM_IN(); |
|
453 |
|
454 aReasonResourceId=R_EIK_TBUF_NOT_AVAILABLE; |
|
455 IMUM_OUT(); |
|
456 return EFalse; |
|
457 } |
|
458 |
|
459 // ---------------------------------------------------------------------------- |
|
460 // CPop3MtmUiData::CanCopyMoveToEntryL() |
|
461 // ---------------------------------------------------------------------------- |
|
462 TBool CPop3MtmUiData::CanCopyMoveToEntryL(const TMsvEntry& /*aContext*/, TInt& aReasonResourceId) const |
|
463 { |
|
464 IMUM_CONTEXT( CPop3MtmUiData::CanCopyMoveToEntryL, 0, KImumMtmLog ); |
|
465 IMUM_IN(); |
|
466 |
|
467 aReasonResourceId=R_EIK_TBUF_NOT_AVAILABLE; |
|
468 IMUM_OUT(); |
|
469 return EFalse; |
|
470 } |
|
471 |
|
472 // ---------------------------------------------------------------------------- |
|
473 // CPop3MtmUiData::CanReplyToEntryL() |
|
474 // ---------------------------------------------------------------------------- |
|
475 TBool CPop3MtmUiData::CanReplyToEntryL(const TMsvEntry& aContext, TInt& aReasonResourceId) const |
|
476 { |
|
477 IMUM_CONTEXT( CPop3MtmUiData::CanReplyToEntryL, 0, KImumMtmLog ); |
|
478 IMUM_IN(); |
|
479 |
|
480 __ASSERT_DEBUG( aContext.iMtm == KUidMsgTypePOP3, User::Panic(KImumMtmUiPanic, EPop3MtmUdWrongMtm )); |
|
481 if ( aContext.iMtm == KUidMsgTypePOP3 |
|
482 && aContext.iType == KUidMsvMessageEntry ) |
|
483 { |
|
484 IMUM_OUT(); |
|
485 return ETrue; |
|
486 } |
|
487 else |
|
488 { |
|
489 IMUM_OUT(); |
|
490 aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE; |
|
491 return EFalse; |
|
492 } |
|
493 |
|
494 } |
|
495 |
|
496 // ---------------------------------------------------------------------------- |
|
497 // CPop3MtmUiData::CanForwardEntryL() |
|
498 // ---------------------------------------------------------------------------- |
|
499 TBool CPop3MtmUiData::CanForwardEntryL(const TMsvEntry& aContext, TInt& aReasonResourceId) const |
|
500 { |
|
501 IMUM_CONTEXT( CPop3MtmUiData::CanForwardEntryL, 0, KImumMtmLog ); |
|
502 IMUM_IN(); |
|
503 |
|
504 __ASSERT_DEBUG( aContext.iMtm == KUidMsgTypePOP3, User::Panic(KImumMtmUiPanic, EPop3MtmUdWrongMtm )); |
|
505 if ( aContext.iMtm == KUidMsgTypePOP3 |
|
506 && aContext.iType == KUidMsvMessageEntry |
|
507 && aContext.ReadOnly() ) |
|
508 { |
|
509 IMUM_OUT(); |
|
510 return ETrue; |
|
511 } |
|
512 else |
|
513 { |
|
514 IMUM_OUT(); |
|
515 aReasonResourceId = R_EIK_TBUF_NOT_AVAILABLE; |
|
516 return EFalse; |
|
517 } |
|
518 } |
|
519 |
|
520 // ---------------------------------------------------------------------------- |
|
521 // CPop3MtmUiData::CanCancelL() |
|
522 // ---------------------------------------------------------------------------- |
|
523 TBool CPop3MtmUiData::CanCancelL(const TMsvEntry& /*aContext*/, TInt& /*aReasonResourceId*/) const |
|
524 { |
|
525 IMUM_CONTEXT( CPop3MtmUiData::CanCancelL, 0, KImumMtmLog ); |
|
526 IMUM_IN(); |
|
527 |
|
528 IMUM_OUT(); |
|
529 return EFalse; |
|
530 } |
|
531 |
|
532 // ---------------------------------------------------------------------------- |
|
533 // CPop3MtmUiData::StatusTextL() |
|
534 // ---------------------------------------------------------------------------- |
|
535 HBufC* CPop3MtmUiData::StatusTextL(const TMsvEntry& /*aContext*/) const |
|
536 { |
|
537 IMUM_CONTEXT( CPop3MtmUiData::StatusTextL, 0, KImumMtmLog ); |
|
538 IMUM_IN(); |
|
539 IMUM_OUT(); |
|
540 |
|
541 // POP messages never have a status in the outbox. |
|
542 return HBufC::NewL(0); |
|
543 } |
|
544 |
|
545 // ---------------------------------------------------------------------------- |
|
546 // CPop3MtmUiData::CheckEntry() |
|
547 // ---------------------------------------------------------------------------- |
|
548 TBool CPop3MtmUiData::CheckEntry(const TMsvEntry& aContext) const |
|
549 { |
|
550 IMUM_CONTEXT( CPop3MtmUiData::CheckEntry, 0, KImumMtmLog ); |
|
551 IMUM_IN(); |
|
552 IMUM_OUT(); |
|
553 |
|
554 return ( (aContext.iMtm==KUidMsgTypePOP3) && (aContext.iType.iUid!=KUidMsvFolderEntryValue) ); |
|
555 } |
|
556 |
|
557 |
|
558 // ---------------------------------------------------------------------------- |
|
559 // CPop3MtmUiData::CreateSkinnedBitmapsL() |
|
560 // ---------------------------------------------------------------------------- |
|
561 void CPop3MtmUiData::CreateSkinnedBitmapsL( TInt aNumZoomStates ) |
|
562 { |
|
563 IMUM_CONTEXT( CPop3MtmUiData::CreateSkinnedBitmapsL, 0, KImumMtmLog ); |
|
564 IMUM_IN(); |
|
565 |
|
566 MAknsSkinInstance* skins = AknsUtils::SkinInstance(); |
|
567 TAknsItemID id; |
|
568 CFbsBitmap* bitmap; |
|
569 CFbsBitmap* bitmapMask; |
|
570 TBool found = ETrue;; |
|
571 |
|
572 CBitmapArray* array = NULL; |
|
573 |
|
574 |
|
575 for( TInt i=KImumPop3FirstBitmapIndex; i<KImumPop3LastBitmapIndex+1; i++ ) |
|
576 { |
|
577 found = ETrue; |
|
578 switch( i ) |
|
579 { |
|
580 case EMbmMuiuQgn_prop_mce_remote_sub: |
|
581 id.Set( KAknsIIDQgnPropMceRemoteSub ); |
|
582 break; |
|
583 case EMbmMuiuQgn_prop_mce_remote_new_sub: |
|
584 id.Set( KAknsIIDQgnPropMceRemoteNewSub ); |
|
585 break; |
|
586 case EMbmMuiuQgn_prop_mce_mail_fet_rea_del: |
|
587 id.Set( KAknsIIDQgnPropMceMailFetReaDel ); |
|
588 break; |
|
589 case EMbmMuiuQgn_prop_mce_mail_fet_read: |
|
590 id.Set( KAknsIIDQgnPropMceMailFetRead ); |
|
591 break; |
|
592 case EMbmMuiuQgn_prop_mce_mail_fet_unread: |
|
593 id.Set( KAknsIIDQgnPropMceMailFetUnread ); |
|
594 break; |
|
595 case EMbmMuiuQgn_prop_mce_mail_unfet_read: |
|
596 id.Set( KAknsIIDQgnPropMceMailUnfetRead ); |
|
597 break; |
|
598 case EMbmMuiuQgn_prop_mce_mail_unfet_unread: |
|
599 id.Set( KAknsIIDQgnPropMceMailUnfetUnread ); |
|
600 break; |
|
601 default: |
|
602 found = EFalse; |
|
603 break; |
|
604 } |
|
605 |
|
606 if( found ) |
|
607 { |
|
608 array = new(ELeave) CArrayPtrFlat< CFbsBitmap >( aNumZoomStates ); |
|
609 CleanupStack::PushL( array ); |
|
610 |
|
611 TParse tp; |
|
612 tp.Set( KPop3MtmUdBitmapFile, &KDC_APP_BITMAP_DIR, NULL ); |
|
613 |
|
614 AknsUtils::CreateIconL( skins, id, bitmap, |
|
615 bitmapMask, tp.FullName(), i, i + 1 ); |
|
616 |
|
617 array->AppendL( bitmap ); |
|
618 array->AppendL( bitmapMask ); |
|
619 iIconArrays->AppendL( array ); |
|
620 |
|
621 CleanupStack::Pop();//array |
|
622 } |
|
623 } |
|
624 IMUM_OUT(); |
|
625 } |
|
626 |
|
627 // End of File |