68 |
68 |
69 typedef RArray<TActionMenuCustomItemId> RFsEActionMenuIdList; |
69 typedef RArray<TActionMenuCustomItemId> RFsEActionMenuIdList; |
70 |
70 |
71 |
71 |
72 enum TFollowUpNewState |
72 enum TFollowUpNewState |
73 { |
73 { |
74 EFollowUp = 0, // don't change, as these are the in the order they are in popup selection list |
74 EFollowUp = 0, // don't change, as these are the in the order they are in popup selection list |
75 EFollowUpComplete = 1, // don't change |
75 EFollowUpComplete = 1, // don't change |
76 EFollowUpClear = 2, // don't change |
76 EFollowUpClear = 2, // don't change |
77 EFollowUpNoChanges = 3 |
77 EFollowUpNoChanges = 3 |
78 }; |
78 }; |
79 |
79 |
80 enum TMessageSizeClass |
80 enum TMessageSizeClass |
81 { |
81 { |
82 ETiny = KKilo, |
82 ETiny = KKilo, |
83 ESmall = 10*KKilo, |
83 ESmall = 10*KKilo, |
98 static CFSMailBox* GetMceDefaultMailboxL( CFSMailClient& aClient, CMsvSession& aMsvSession ); |
98 static CFSMailBox* GetMceDefaultMailboxL( CFSMailClient& aClient, CMsvSession& aMsvSession ); |
99 |
99 |
100 static CFSMailBox* GetMailboxForMtmIdL( CFSMailClient& aClient, CMsvSession& aMsvSession, TMsvId aMtmId ); |
100 static CFSMailBox* GetMailboxForMtmIdL( CFSMailClient& aClient, CMsvSession& aMsvSession, TMsvId aMtmId ); |
101 |
101 |
102 static TBool IsRemoteLookupSupported( CFSMailBox& aMailBox ); |
102 static TBool IsRemoteLookupSupported( CFSMailBox& aMailBox ); |
103 |
103 |
104 static void CopyToClipboardL( const TDesC& aBuf ); |
104 static void CopyToClipboardL( const TDesC& aBuf ); |
105 |
105 |
106 static TInt ShowConfirmationQueryL( TInt aResourceStringId, const TDesC& aResourceParameter = KNullDesC ); |
106 static TInt ShowConfirmationQueryL( TInt aResourceStringId, const TDesC& aResourceParameter = KNullDesC ); |
107 static TInt ShowConfirmationQueryL( const TDesC& aPromptText ); |
107 static TInt ShowConfirmationQueryL( const TDesC& aPromptText ); |
108 |
108 |
109 static void ShowErrorNoteL( TInt aResourceStringId, TBool aWaitingDialog = EFalse ); |
109 static void ShowErrorNoteL( TInt aResourceStringId, TBool aWaitingDialog = EFalse ); |
110 static void ShowInfoNoteL( TInt aResourceStringId, TBool aWaitingDialog = EFalse ); |
110 static void ShowInfoNoteL( TInt aResourceStringId, TBool aWaitingDialog = EFalse ); |
111 |
111 |
112 static void ShowGlobalErrorNoteL( TInt aResourceStringId ); |
112 static void ShowGlobalErrorNoteL( TInt aResourceStringId ); |
113 static void ShowGlobalInfoNoteL( TInt aResourceStringId ); |
113 static void ShowGlobalInfoNoteL( TInt aResourceStringId ); |
114 static void ShowDiscreetInfoNoteL( TInt aResourceStringId ); |
114 static void ShowDiscreetInfoNoteL( TInt aResourceStringId ); |
115 static void ShowDiscreetInfoNoteL( const TDesC& aNoteText ); |
115 static void ShowDiscreetInfoNoteL( const TDesC& aNoteText ); |
116 |
116 |
147 * Displays overwrite query if needed |
147 * Displays overwrite query if needed |
148 * |
148 * |
149 * @param aFilePath Path to where the file is to be saved |
149 * @param aFilePath Path to where the file is to be saved |
150 * @param aAttachmentPart Message part of the attachment to be saved |
150 * @param aAttachmentPart Message part of the attachment to be saved |
151 * @return ETrue if OK to save the file to a given path, EFalse if not |
151 * @return ETrue if OK to save the file to a given path, EFalse if not |
152 */ |
152 */ |
153 static TBool OkToSaveFileL( const TDesC& aFilePath, CFSMailMessagePart& aAttachmentPart ); |
153 static TBool OkToSaveFileL( const TDesC& aFilePath, CFSMailMessagePart& aAttachmentPart ); |
154 |
154 |
155 static void ShowFilesSavedToFolderNoteL( TInt aCount ); |
155 static void ShowFilesSavedToFolderNoteL( TInt aCount ); |
156 |
156 |
157 static void ShowCreateMessageQueryL( const TDesC& aAddressData, TBool aSendingToEmail = EFalse ); |
157 static void ShowCreateMessageQueryL( const TDesC& aAddressData, TBool aSendingToEmail = EFalse ); |
158 |
158 |
159 static TInt CountRecepients( CFSMailMessage* aMsgPtr ); |
159 static TInt CountRecepients( CFSMailMessage* aMsgPtr ); |
160 |
160 |
161 static TInt CountRecipientsSmart( CFreestyleEmailUiAppUi& aAppUi, CFSMailMessage* aMsgPtr ); |
161 static TInt CountRecipientsSmart( CFreestyleEmailUiAppUi& aAppUi, CFSMailMessage* aMsgPtr ); |
203 * SetMessageFollowupFlagL |
203 * SetMessageFollowupFlagL |
204 * |
204 * |
205 * @param aShowFlagCompleted Whether to show the completed flag. |
205 * @param aShowFlagCompleted Whether to show the completed flag. |
206 * When false we are in the editor view. |
206 * When false we are in the editor view. |
207 */ |
207 */ |
208 static TFollowUpNewState SetMessageFollowupFlagL( CFSMailMessage& aMsg, TBool aShowFlagCompleted = ETrue ); |
208 static TFollowUpNewState SetMessageFollowupFlagL( CFSMailMessage& aMsg, TBool aShowFlagCompleted = ETrue ); |
209 static void SetMessageFollowupStateL( CFSMailMessage& aMsg, TFollowUpNewState aNewFollowUpState ); |
209 static void SetMessageFollowupStateL( CFSMailMessage& aMsg, TFollowUpNewState aNewFollowUpState ); |
210 static TBool RunFollowUpListDialogL( TFollowUpNewState& aSelectedOption, TBool aShowFlagCompleted = ETrue ); |
210 static TBool RunFollowUpListDialogL( TFollowUpNewState& aSelectedOption, TBool aShowFlagCompleted = ETrue ); |
211 |
211 |
212 static TFileType GetFileType( const TDesC& aFileName, const TDesC& aMimeType ); |
212 static TFileType GetFileType( const TDesC& aFileName, const TDesC& aMimeType ); |
213 |
213 |
214 static CAlfTexture& GetAttachmentIcon( TFileType aAttachmentType, CFreestyleEmailUiTextureManager& aTextureManager ); |
214 static CAlfTexture& GetAttachmentIcon( TFileType aAttachmentType, CFreestyleEmailUiTextureManager& aTextureManager ); |
215 static TFSEmailUiTextures GetAttachmentIconTextureId( TFileType aAttachmentType ); |
215 static TFSEmailUiTextures GetAttachmentIconTextureId( TFileType aAttachmentType ); |
216 |
216 |
217 static CAlfTexture& GetMsgIcon( CFSMailMessage* aMsgPtr, CFreestyleEmailUiTextureManager& aTextureManager ); |
217 static CAlfTexture& GetMsgIcon( CFSMailMessage* aMsgPtr, CFreestyleEmailUiTextureManager& aTextureManager ); |
218 static TFSEmailUiTextures GetMsgIconTextureId( CFSMailMessage* aMsgPtr ); |
218 static TFSEmailUiTextures GetMsgIconTextureId( CFSMailMessage* aMsgPtr ); |
219 |
219 |
220 static void MoveMessageToDraftsL( CFSMailBox& aMailBox, CFSMailMessage& aMsg ); |
220 static void MoveMessageToDraftsL( CFSMailBox& aMailBox, CFSMailMessage& aMsg ); |
221 |
221 |
222 static TBool IsMessagePartFullyFetched( const CFSMailMessagePart& aPart ); |
222 static TBool IsMessagePartFullyFetched( const CFSMailMessagePart& aPart ); |
223 |
223 |
224 static TBool IsMessageStructureKnown( const CFSMailMessagePart& aPart ); |
224 static TBool IsMessageStructureKnown( const CFSMailMessagePart& aPart ); |
225 |
225 |
226 static void CreatePlainTextPartL( CFSMailMessage& aMsg, CFSMailMessagePart*& aPart ); |
226 static void CreatePlainTextPartL( CFSMailMessage& aMsg, CFSMailMessagePart*& aPart ); |
227 |
227 |
228 static TBool IsCompleteOrCancelEvent( TFSProgress aEvent ); |
228 static TBool IsCompleteOrCancelEvent( TFSProgress aEvent ); |
229 |
229 |
230 static TBool HasUnfetchedAttachmentsL( CFSMailMessage& aMsg ); |
230 static TBool HasUnfetchedAttachmentsL( CFSMailMessage& aMsg ); |
231 |
231 |
232 static TBool IsFollowUpSupported( const CFSMailBox& aMailBox ); |
232 static TBool IsFollowUpSupported( const CFSMailBox& aMailBox ); |
233 |
233 |
234 // Set new email message icon on/off |
234 // Set new email message icon on/off |
235 static void ToggleEmailIconL( TBool aIconOn ); |
235 static void ToggleEmailIconL( TBool aIconOn ); |
236 static void ToggleEmailIconL( TBool aIconOn, const TFSMailMsgId& aMailBox ); |
236 static void ToggleEmailIconL( TBool aIconOn, const TFSMailMsgId& aMailBox ); |
237 |
237 |
238 static HBufC* DateTextFromMsgLC( const CFSMailMessage* aMessage, TBool aAddYearNumer = ETrue ); |
238 static HBufC* DateTextFromMsgLC( const CFSMailMessage* aMessage, TBool aAddYearNumer = ETrue ); |
239 static HBufC* TimeTextFromMsgLC( const CFSMailMessage* aMessage ); |
239 static HBufC* TimeTextFromMsgLC( const CFSMailMessage* aMessage ); |
240 static HBufC* WeekDayTextFromMsgLC( const CFSMailMessage* aMessage, TBool aUseToday, TBool aUseYesterday, |
240 static HBufC* WeekDayTextFromMsgLC( const CFSMailMessage* aMessage, TBool aUseToday, TBool aUseYesterday, |
241 TBool& aWasToday, TBool& aWasYesterday ); |
241 TBool& aWasToday, TBool& aWasYesterday ); |
247 static TInt CompareMailSubjectsL( const CFSMailMessage* aMessage1, const CFSMailMessage* aMessage2 ); |
247 static TInt CompareMailSubjectsL( const CFSMailMessage* aMessage1, const CFSMailMessage* aMessage2 ); |
248 static HBufC* CreateSubjectWithoutLocalisedPrefixLC( const CFSMailMessage* aMessage, TBool aSuppressNotAvailableText = EFalse ); |
248 static HBufC* CreateSubjectWithoutLocalisedPrefixLC( const CFSMailMessage* aMessage, TBool aSuppressNotAvailableText = EFalse ); |
249 static HBufC* CreateSubjectTextLC( const CFSMailMessage* aMessage ); |
249 static HBufC* CreateSubjectTextLC( const CFSMailMessage* aMessage ); |
250 static HBufC* CreateBodyTextLC( const CFSMailMessage* aMessage ); |
250 static HBufC* CreateBodyTextLC( const CFSMailMessage* aMessage ); |
251 static void FilterListItemTextL( TDes& aText ); |
251 static void FilterListItemTextL( TDes& aText ); |
|
252 static void FilterListItemText2L( TDes& aText ); |
252 static TMessageSizeClass MessageSizeClass( const CFSMailMessage& aMessage ); |
253 static TMessageSizeClass MessageSizeClass( const CFSMailMessage& aMessage ); |
253 |
254 |
254 static HBufC* ConvertHtmlToTxtL( const TDesC& aHtml ); |
255 static HBufC* ConvertHtmlToTxtL( const TDesC& aHtml ); |
255 |
256 |
256 static void DisplayMsgsMovedNoteL( TInt aMsgCount, |
257 static void DisplayMsgsMovedNoteL( TInt aMsgCount, |
257 const TFSMailMsgId aDestinationFolderId, |
258 const TFSMailMsgId aDestinationFolderId, |
258 TBool aIsWaitingNote ); |
259 TBool aIsWaitingNote ); |
259 |
260 |
260 static TBool IsOfflineModeL(); |
261 static TBool IsOfflineModeL(); |
261 |
262 |
262 /** |
263 /** |
263 * Shows mailbox creation query: |
264 * Shows mailbox creation query: |
264 * "No e-mail mailboxes defined. Create a mailbox?" |
265 * "No e-mail mailboxes defined. Create a mailbox?" |
265 * |
266 * |
266 * @return ETrue if user answered "Yes", EFalse if user answered "No" |
267 * @return ETrue if user answered "Yes", EFalse if user answered "No" |
267 */ |
268 */ |
268 static TBool DisplayCreateMailboxQueryL(); |
269 static TBool DisplayCreateMailboxQueryL(); |
269 |
270 |
270 // static CAlfTexture& GetAttachmentIconL( TFileType aAttachmentType, CFreestyleEmailUiTextureManager& aTextureManager ); |
271 // static CAlfTexture& GetAttachmentIconL( TFileType aAttachmentType, CFreestyleEmailUiTextureManager& aTextureManager ); |
271 // static TFSEmailUiTextures GetAttachmentIconTextureIdL( TFileType aAttachmentType ); |
272 // static TFSEmailUiTextures GetAttachmentIconTextureIdL( TFileType aAttachmentType ); |
272 |
273 |
273 // Brings Freestyle Email UI application to foreground if it's not already |
274 // Brings Freestyle Email UI application to foreground if it's not already |
274 static void BringFsEmailToForeground(); |
275 static void BringFsEmailToForeground(); |
275 |
276 |
276 // Formats display name |
277 // Formats display name |
277 static void StripDisplayName( HBufC& aDisplayName ); |
278 static void StripDisplayName( HBufC& aDisplayName ); |
278 |
279 |
279 // Creates a displayname of firstname and lastname components |
280 // Creates a displayname of firstname and lastname components |
280 static HBufC* CreateDisplayNameLC( const TDesC& aFirstname, const TDesC& aLastname, TBool aSwitchOrder = EFalse ); |
281 static HBufC* CreateDisplayNameLC( const TDesC& aFirstname, const TDesC& aLastname, TBool aSwitchOrder = EFalse ); |
281 |
282 |
282 // Creates a displayname of firstname, lastname, emailfield components |
283 // Creates a displayname of firstname, lastname, emailfield components |
367 * After that the static functions can be used to operate with action menu. |
363 * After that the static functions can be used to operate with action menu. |
368 * |
364 * |
369 */ |
365 */ |
370 class CFSEmailUiActionMenu : public CBase |
366 class CFSEmailUiActionMenu : public CBase |
371 { |
367 { |
372 friend class CFreestyleEmailUiAppUi; |
368 friend class CFreestyleEmailUiAppUi; |
373 public: |
369 public: |
374 /** |
370 /** |
375 * Get pointer to the action menu, can be used if built-in methods are |
371 * Get pointer to the action menu, can be used if built-in methods are |
376 * not enough. Ownership is not transferred. |
372 * not enough. Ownership is not transferred. |
377 * |
373 * |
378 * @return Action menu pointer |
374 * @return Action menu pointer |
379 */ |
375 */ |
380 static CFscContactActionMenu* GetActionMenu(); |
376 static CFscContactActionMenu* GetActionMenu(); |
381 |
377 |
382 /** |
378 /** |
383 * Remove all items from action menu |
379 * Remove all items from action menu |
384 */ |
380 */ |
385 static void RemoveAllL(); |
381 static void RemoveAllL(); |
386 |
382 |
387 /** |
383 /** |
388 * Add one email specific custom item by id |
384 * Add one email specific custom item by id |
389 * |
385 * |
390 * @param aItemId Item id of the item to be added |
386 * @param aItemId Item id of the item to be added |
391 */ |
387 */ |
392 static void AddCustomItemL( TActionMenuCustomItemId aItemId ); |
388 static void AddCustomItemL( TActionMenuCustomItemId aItemId ); |
393 |
389 |
394 /** |
390 /** |
395 * Add several email specific custom items by list of ids |
391 * Add several email specific custom items by list of ids |
396 * |
392 * |
397 * @param aItemList List of item ids to be added |
393 * @param aItemList List of item ids to be added |
398 */ |
394 */ |
399 static void AddCustomItemsL( RFsEActionMenuIdList aItemList ); |
395 static void AddCustomItemsL( RFsEActionMenuIdList aItemList ); |
400 |
396 |
401 // <cmail> |
397 // <cmail> |
402 /** |
398 /** |
403 * Execute previously constructed action menu |
399 * Execute previously constructed action menu |
404 * |
400 * |
405 * @param aPosition Vertical position where menu is to be openned |
401 * @param aPosition Vertical position where menu is to be openned |
406 * @param aIndex Index of focused/highlighted item when menu is opened |
402 * @param aIndex Index of focused/highlighted item when menu is opened |
419 */ |
415 */ |
420 // |
416 // |
421 static TActionMenuCustomItemId ExecuteL( RFsEActionMenuIdList aItemList, |
417 static TActionMenuCustomItemId ExecuteL( RFsEActionMenuIdList aItemList, |
422 TFscContactActionMenuPosition aPosition = EFscCenter, |
418 TFscContactActionMenuPosition aPosition = EFscCenter, |
423 TInt aIndex = 0, MFsActionMenuPositionGiver* aPositionGiver = 0 ); |
419 TInt aIndex = 0, MFsActionMenuPositionGiver* aPositionGiver = 0 ); |
424 |
420 |
425 /** |
421 /** |
426 * Dismiss menu |
422 * Dismiss menu |
427 * Menu gets closed if it was visible when the method was called. |
423 * Menu gets closed if it was visible when the method was called. |
428 * Otherwise method call does not do anything |
424 * Otherwise method call does not do anything |
429 * |
425 * |
430 * @param aSlide If ETrue menu slides away from the screen. |
426 * @param aSlide If ETrue menu slides away from the screen. |
431 * Otherwise it disappears instantly |
427 * Otherwise it disappears instantly |
432 */ |
428 */ |
433 static void Dismiss( TBool aSlide ); |
429 static void Dismiss( TBool aSlide ); |
434 // </cmail> |
430 // </cmail> |
435 |
431 |
436 /** |
432 /** |
437 * Create icon by bitmap and mask |
433 * Create icon by bitmap and mask |
438 * |
434 * |
439 * @param aBitmapId Icon bitmap |
435 * @param aBitmapId Icon bitmap |
440 * @param aMaskId Icon mask |
436 * @param aMaskId Icon mask |