78 * @param aMessageId message id in plugin containing email |
77 * @param aMessageId message id in plugin containing email |
79 * @param aMessagePartId message part id in plugin containing email |
78 * @param aMessagePartId message part id in plugin containing email |
80 */ |
79 */ |
81 IMPORT_C static CFSMailMessagePart* NewLC( TFSMailMsgId aMessageId, TFSMailMsgId aMessagePartId ); |
80 IMPORT_C static CFSMailMessagePart* NewLC( TFSMailMsgId aMessageId, TFSMailMsgId aMessagePartId ); |
82 |
81 |
|
82 // <qmail> |
83 /** |
83 /** |
84 * Two-phased constructor. |
84 * Two-phased constructor. |
85 * |
85 * |
86 * @param aMessageId message id in plugin containing email |
86 * @param aMessageId message id in plugin containing email |
87 */ |
87 */ |
88 IMPORT_C static CFSMailMessagePart* NewLC( const NmId &aNmMessageId, const NmMessagePart& aNmMessagePart ); |
88 IMPORT_C static CFSMailMessagePart* NewLC( const NmId &aNmMessageId, const NmMessagePart& aNmMessagePart ); |
89 |
89 // </qmail> |
|
90 |
90 /** |
91 /** |
91 * destructor |
92 * destructor |
92 */ |
93 */ |
93 IMPORT_C virtual ~CFSMailMessagePart(); |
94 IMPORT_C virtual ~CFSMailMessagePart(); |
94 |
95 |
95 /** |
96 /** |
96 * email part id accessor |
97 * email part id accessor |
97 * |
98 * |
98 * @return email part id |
99 * @return email part id |
99 */ |
100 */ |
100 IMPORT_C TFSMailMsgId GetPartId() const; |
101 IMPORT_C TFSMailMsgId GetPartId() const; |
101 |
102 |
|
103 // <qmail> |
102 /** |
104 /** |
103 * email part content-type accessor (e.g. "text/plain") |
105 * email part content-type accessor (e.g. "text/plain") |
104 * |
106 * |
105 * @return email part content type |
107 * @return email part content type |
106 */ |
108 */ |
107 IMPORT_C const TDesC& GetContentType() const; |
109 IMPORT_C const TDesC& GetContentType() const; |
|
110 // </qmail> |
108 |
111 |
109 /** |
112 /** |
110 * email part content-type mutator |
113 * email part content-type mutator |
111 * |
114 * |
112 * @param aContentType new content type value |
115 * @param aContentType new content type value |
193 |
196 |
194 /** |
197 /** |
195 * saves this message part |
198 * saves this message part |
196 */ |
199 */ |
197 IMPORT_C void SaveL(); |
200 IMPORT_C void SaveL(); |
198 |
201 |
|
202 // <qmail> |
199 /** |
203 /** |
200 * lists all direct child parts of this email part |
204 * lists all direct child parts of this email part |
201 * |
205 * |
202 * @param aParts table containing list of child parts owned by user |
206 * @param aParts table containing list of child parts owned by user |
203 * @param aDataSource data source: email store/local object |
207 * @param aDataSource data source: email store/local object |
204 */ |
208 */ |
205 IMPORT_C void ChildPartsL(RPointerArray<CFSMailMessagePart>& aParts, |
209 IMPORT_C void ChildPartsL(RPointerArray<CFSMailMessagePart>& aParts, |
206 TFSMailMessagePartDataSource aDataSource = EDataSourceMessageStore); |
210 TFSMailMessagePartDataSource aDataSource = EDataSourceMessageStore); |
|
211 // </qmail> |
207 |
212 |
208 /** |
213 /** |
209 * Returns child part of this part identified by part id. |
214 * Returns child part of this part identified by part id. |
210 * |
215 * |
211 * @param aPartId defines parent part id |
216 * @param aPartId defines parent part id |
233 IMPORT_C CFSMailMessagePart* NewChildPartL( const TFSMailMsgId aInsertBefore, |
238 IMPORT_C CFSMailMessagePart* NewChildPartL( const TFSMailMsgId aInsertBefore, |
234 const TDesC& aContentType ); |
239 const TDesC& aContentType ); |
235 |
240 |
236 /** |
241 /** |
237 * Copies given email object as new child part of this email part or email. |
242 * Copies given email object as new child part of this email part or email. |
238 * |
243 * |
239 * @param aInsertBefore defines place of where new child part is created, |
244 * @param aInsertBefore defines place of where new child part is created, |
240 * if aInsertBefore is NULL id then new part is added as last. |
245 * if aInsertBefore is NULL id then new part is added as last. |
241 * @param aMessage message to be copied as child part |
246 * @param aMessage message to be copied as child part |
242 * |
247 * |
243 * @return new child part, ownership is transferred to user |
248 * @return new child part, ownership is transferred to user |
250 * |
255 * |
251 * @param aPartId part id of the email part to be removed |
256 * @param aPartId part id of the email part to be removed |
252 */ |
257 */ |
253 IMPORT_C void RemoveChildPartL(TFSMailMsgId aPartId); |
258 IMPORT_C void RemoveChildPartL(TFSMailMsgId aPartId); |
254 |
259 |
|
260 // <qmail> |
|
261 /** |
|
262 * Removes child part (and it's children, if any) from this email part |
|
263 * |
|
264 * @param aPartId part id of the email part to be removed |
|
265 * @param aOperationObserver Observer for the operation |
|
266 * |
|
267 * @return id of the request, KErrNotSupported if the protocol plugin this |
|
268 * instance is attached to does not support the async method. |
|
269 */ |
|
270 IMPORT_C TInt RemoveChildPartL( TFSMailMsgId aPartId, |
|
271 MFSMailRequestObserver& aOperationObserver); |
|
272 // </qmail> |
|
273 |
255 /** |
274 /** |
256 * Retrieves a read-only file handle for the content file of this message part. |
275 * Retrieves a read-only file handle for the content file of this message part. |
257 * The caller must close the file handle. |
276 * The caller must close the file handle. |
258 * |
277 * |
259 * @return content file handle |
278 * @return content file handle |
332 * |
351 * |
333 * @param aBuffer buffer owned by user |
352 * @param aBuffer buffer owned by user |
334 * @param aStartOffset offset from content begin |
353 * @param aStartOffset offset from content begin |
335 */ |
354 */ |
336 IMPORT_C void GetContentToBufferL(TDes16& aBuffer, TUint aStartOffset); |
355 IMPORT_C void GetContentToBufferL(TDes16& aBuffer, TUint aStartOffset); |
337 |
356 |
338 /** |
357 /** |
339 * copies email part contents from buffer given by user |
358 * copies email part contents from buffer given by user |
340 * |
359 * |
341 * @param aBuffer buffer given by user |
360 * @param aBuffer buffer given by user |
342 */ |
361 */ |
343 IMPORT_C void SetContent(TDes16& aBuffer); |
362 IMPORT_C void SetContent(TDes16& aBuffer); |
344 |
363 |
345 /** |
364 /** |
346 * meeting request accessor if email part is a meeting request |
365 * meeting request accessor if email part is a meeting request |
347 * |
366 * |
348 * @return meeting request object |
367 * @return meeting request object |
349 */ |
368 */ |
350 IMPORT_C MMRInfoObject& GetMRInfo(); |
369 IMPORT_C MMRInfoObject& GetMRInfo(); |
351 |
370 |
352 /** |
371 /** |
353 * stores given meeting request object as email part |
372 * stores given meeting request object as email part |
354 * |
373 * |
355 * @param aMeetingRequest meeting request object |
374 * @param aMeetingRequest meeting request object |
356 */ |
375 */ |
357 IMPORT_C void SetMRInfo(MMRInfoObject* aMeetingRequest); |
376 IMPORT_C void SetMRInfo(MMRInfoObject* aMeetingRequest); |
358 |
377 |
359 /** |
378 /** |
360 * method checks if MRInfo exists |
379 * method checks if MRInfo exists |
361 * |
380 * |
362 * @return true / false |
381 * @return true / false |
363 */ |
382 */ |
364 IMPORT_C TBool IsMRInfoSet(); |
383 IMPORT_C TBool IsMRInfoSet(); |
365 |
384 |
366 /** |
385 /** |
367 * plugin request handler accessor |
|
368 * |
|
369 * @return request handler |
|
370 */ |
|
371 IMPORT_C CFSMailRequestHandler& RequestHandler( ); |
|
372 |
|
373 /** |
|
374 * Sets attachment name for email part. Full path can be |
386 * Sets attachment name for email part. Full path can be |
375 * given as input even though only filename is saved. |
387 * given as input even though only filename is saved. |
376 * |
388 * |
377 * @param aFilePath attachment name |
389 * @param aFilePath attachment name |
378 */ |
390 */ |
379 IMPORT_C void SetAttachmentNameL(const TDesC& aFilePath); |
391 IMPORT_C void SetAttachmentNameL(const TDesC& aFilePath); |
380 |
392 |
381 /** |
393 /** |
382 * returns email part attachment name |
394 * returns email part attachment name |
383 * |
395 * |
384 * @return attachment name |
396 * @return attachment name |
385 */ |
397 */ |
386 IMPORT_C TDesC& AttachmentNameL(); |
398 IMPORT_C TDesC& AttachmentNameL(); |
387 |
399 |
|
400 // <qmail> |
388 /** |
401 /** |
389 * finds email body part based on given content type |
402 * finds email body part based on given content type |
390 * (plain text or html body part of email message) |
403 * (plain text or html body part of email message) |
391 * |
404 * |
392 * @param aContentType body part content type to be searched |
405 * @param aContentType body part content type to be searched |
394 * |
407 * |
395 * @return email body part or NULL if not found, ownership is transferred to user |
408 * @return email body part or NULL if not found, ownership is transferred to user |
396 */ |
409 */ |
397 IMPORT_C CFSMailMessagePart* FindBodyPartL(const TDesC& aContentType, |
410 IMPORT_C CFSMailMessagePart* FindBodyPartL(const TDesC& aContentType, |
398 TFSMailMessagePartDataSource aDataSource = EDataSourceMessageStore); |
411 TFSMailMessagePartDataSource aDataSource = EDataSourceMessageStore); |
399 |
412 // </qmail> |
|
413 |
|
414 /** |
|
415 * Checks that content type matches given. |
|
416 * |
|
417 * @param aContentType body part content type to be checked |
|
418 * |
|
419 * @return ETrue if content type of message part matches tto given |
|
420 */ |
|
421 IMPORT_C TBool ContentTypeMatches( const TDesC& aContentType ); |
400 |
422 |
401 /** |
423 /** |
402 * starts email part fetching from email server |
424 * starts email part fetching from email server |
403 * |
425 * |
404 * @param aMessagePartId message part id of email part to be fetched |
426 * @param aMessagePartId message part id of email part to be fetched |
409 * should be fetched. Actual amount of data fetched may differ from |
431 * should be fetched. Actual amount of data fetched may differ from |
410 * requested (possibly all fetched in any case). |
432 * requested (possibly all fetched in any case). |
411 * |
433 * |
412 * @return err code |
434 * @return err code |
413 */ |
435 */ |
414 IMPORT_C TInt FetchMessagePartL( const TFSMailMsgId aMessagePartId, |
436 IMPORT_C TInt FetchMessagePartL( const TFSMailMsgId aMessagePartId, |
415 MFSMailRequestObserver& aOperationObserver, |
437 MFSMailRequestObserver& aOperationObserver, |
416 const TUint aPreferredByteCount); |
438 const TUint aPreferredByteCount); |
417 |
439 |
418 /** |
440 /** |
419 * starts email parts fetching from email server |
441 * starts email parts fetching from email server |
420 * |
442 * |
421 * @param aMessagePartIds message part ids of email parts to be fetched |
443 * @param aMessagePartIds message part ids of email parts to be fetched |
426 * should be fetched. Actual amount of data fetched may differ from |
448 * should be fetched. Actual amount of data fetched may differ from |
427 * requested (possibly all fetched in any case). |
449 * requested (possibly all fetched in any case). |
428 * |
450 * |
429 * @return err code |
451 * @return err code |
430 */ |
452 */ |
431 IMPORT_C TInt FetchMessagesPartsL( const RArray<TFSMailMsgId>& aMessagePartIds, |
453 IMPORT_C TInt FetchMessagesPartsL( const RArray<TFSMailMsgId>& aMessagePartIds, |
432 MFSMailRequestObserver& aOperationObserver, |
454 MFSMailRequestObserver& aOperationObserver, |
433 const TUint aPreferredByteCount); |
455 const TUint aPreferredByteCount); |
434 /** |
456 /** |
435 * creates a list containing all email / email part subparts |
457 * creates a list containing all email / email part subparts |
436 * |
458 * |
437 * @param aParts email part list given/owned by user |
459 * @param aParts email part list given/owned by user |
438 */ |
460 */ |
439 IMPORT_C void AppendAttachmentsL(RPointerArray<CFSMailMessagePart>& aParts); |
461 IMPORT_C void AppendAttachmentsL(RPointerArray<CFSMailMessagePart>& aParts); |
440 |
462 |
441 /** |
463 /** |
442 * sets email part fetch status |
464 * sets email part fetch status |
443 * |
465 * |
444 * @param aMessagePartStatus (EFSMessagePartsKnown) |
466 * @param aMessagePartStatus (EFSMessagePartsKnown) |
445 */ |
467 */ |
446 IMPORT_C void SetMessagePartsStatus(TFSPartFetchState aMessagePartStatus); |
468 IMPORT_C void SetMessagePartsStatus(TFSPartFetchState aMessagePartStatus); |
447 |
469 |
448 /** |
470 /** |
449 * Adds new attachment to this email (part). |
471 * Adds new attachment to this email (part). |
450 * |
472 * |
451 * @param aFilePath full path of new attachment. |
473 * @param aFilePath full path of new attachment. |
452 * @param aInsertBefore defines position of new attachment, |
474 * @param aInsertBefore defines position of new attachment, |
453 * if NullId then new attachment is created as last part. |
475 * if NullId then new attachment is created as last part. |
454 * @param aContentType attachment content type |
476 * @param aContentType attachment content type |
455 |
477 |
456 * @return new email part, ownership is transferred to user |
478 * @return new email part, ownership is transferred to user |
457 */ |
479 */ |
458 IMPORT_C CFSMailMessagePart* AddNewAttachmentL( const TDesC& aFilePath, |
480 IMPORT_C CFSMailMessagePart* AddNewAttachmentL( const TDesC& aFilePath, |
459 const TFSMailMsgId aInsertBefore, |
481 const TFSMailMsgId aInsertBefore, |
460 const TDesC& aContentType ); |
482 const TDesC& aContentType ); |
461 /** |
483 /** |
462 * read only part size accessor (character or byte count) |
484 * read only part size accessor (character or byte count) |
463 * |
485 * |
464 */ |
486 */ |
465 IMPORT_C TUint ReadOnlyPartSize() const; |
487 IMPORT_C TUint ReadOnlyPartSize() const; |
476 * removes attachment downloaded contents from local/terminal memory |
498 * removes attachment downloaded contents from local/terminal memory |
477 * |
499 * |
478 */ |
500 */ |
479 IMPORT_C void RemoveDownLoadedAttachmentsL(); |
501 IMPORT_C void RemoveDownLoadedAttachmentsL(); |
480 |
502 |
481 //<qmail> |
503 // <qmail> |
482 /** |
504 /** |
483 * gets the new NmMessagePart object |
505 * gets the new NmMessagePart object |
484 * |
506 * |
485 * @return NmMessagePart object |
507 * @return NmMessagePart object |
486 */ |
508 */ |
487 IMPORT_C NmMessagePart* GetNmMessagePart(); |
509 IMPORT_C NmMessagePart* GetNmMessagePart(); |
488 //<qmail> |
510 // </qmail> |
489 |
511 |
490 //<qmail> |
512 // <qmail> |
491 /** |
513 /** |
492 * Gets the text content from private shared object. |
514 * Gets the text content from private shared object. |
493 * Returns the ownership of text buffer to caller. |
515 * Returns the ownership of text buffer to caller. |
494 * Returned object should be removed from CleanupStack after usage. |
516 * Returned object should be removed from CleanupStack after usage. |
495 * |
517 * |
496 * @return HBufC* |
518 * @return HBufC* |
497 */ |
519 */ |
498 IMPORT_C HBufC* GetLocalTextContentLC(); |
520 IMPORT_C HBufC* GetLocalTextContentLC(); |
499 //<qmail> |
521 // </qmail> |
500 |
522 |
501 |
523 |
502 public: // data |
524 public: // data |
503 |
525 |
504 protected: |
526 protected: |
510 |
532 |
511 /** |
533 /** |
512 * lists subparts |
534 * lists subparts |
513 */ |
535 */ |
514 void ListMessagePartsL( RPointerArray<CFSMailMessagePart>& aParts ); |
536 void ListMessagePartsL( RPointerArray<CFSMailMessagePart>& aParts ); |
515 |
537 |
516 /** |
538 /** |
517 * clears internal part array |
539 * clears internal part array |
518 */ |
540 */ |
519 void ClearPartsArray(TBool aClearAll); |
541 void ClearPartsArray(TBool aClearAll); |
520 |
542 |
521 /** |
543 /** |
522 * finds id of body part |
544 * finds id of body part |
523 */ |
545 */ |
524 TFSMailMsgId FindBodyPartIdL(const TDesC& aContentType); |
546 TFSMailMsgId FindBodyPartIdL(const TDesC& aContentType); |
525 |
547 |
526 /** |
548 /** |
527 * Returns a flat list of message parts that can be handled as attachments. |
549 * Returns a flat list of message parts that can be handled as attachments. |
528 * Excludes message parts that are multipart and parts that are considered |
550 * Excludes message parts that are multipart and parts that are considered |
529 * plain text or html body. |
551 * plain text or html body. |
532 */ |
554 */ |
533 virtual void DoAttachmentListL(RPointerArray<CFSMailMessagePart>& aParts); |
555 virtual void DoAttachmentListL(RPointerArray<CFSMailMessagePart>& aParts); |
534 |
556 |
535 protected: // data |
557 protected: // data |
536 |
558 |
537 CFSMailRequestHandler* iRequestHandler; |
|
538 |
|
539 /** |
559 /** |
540 * email fetch from email server status |
560 * email fetch from email server status |
541 */ |
561 */ |
542 TFSPartFetchState iMessagePartsStatus; |
562 TFSPartFetchState iMessagePartsStatus; |
543 |
563 |
|
564 // <qmail> |
544 /** |
565 /** |
545 * message part MIME type - pointer descriptor to access QString object |
566 * message part MIME type - pointer descriptor to access QString object |
546 */ |
567 */ |
547 mutable TPtrC iContentTypePtr; |
568 mutable TPtrC iContentTypePtr; |
|
569 // </qmail> |
548 |
570 |
549 /** message parts array */ |
571 /** message parts array */ |
550 RPointerArray<CFSMailMessagePart> iMessageParts; |
572 RPointerArray<CFSMailMessagePart> iMessageParts; |
551 TBool iReadMessageParts; |
573 TBool iReadMessageParts; |
552 |
574 |
553 //<qmail> |
575 // <qmail> |
554 /** |
576 /** |
555 * Reference to QT side of the message meta data object. |
577 * Reference to QT side of the message meta data object. |
556 */ |
578 */ |
557 QExplicitlySharedDataPointer<NmMessagePartPrivate> iNmPrivateMessagePart; |
579 QExplicitlySharedDataPointer<NmMessagePartPrivate> iNmPrivateMessagePart; |
558 //<qmail> |
580 // </qmail> |
559 |
581 |
560 protected: |
582 protected: |
561 |
583 |
562 /** |
584 /** |
563 * Two-phased constructor |
585 * Two-phased constructor |
564 */ |
586 */ |
565 void ConstructL( TFSMailMsgId aMessageId, TFSMailMsgId aMessagePartId ); |
587 void ConstructL( TFSMailMsgId aMessageId, TFSMailMsgId aMessagePartId ); |
566 |
588 |
567 //<qmail> |
589 // <qmail> |
568 /** |
590 /** |
569 * Two-phased constructor |
591 * Two-phased constructor |
570 */ |
592 */ |
571 void ConstructL(const NmId &aNmMessageId, const NmMessagePart& aNmMessagePart); |
593 void ConstructL(const NmId &aNmMessageId, const NmMessagePart& aNmMessagePart); |
572 |
594 |
573 void ConstructL(const NmMessagePart& aNmMessagePart, |
595 void ConstructL(const NmMessagePart& aNmMessagePart, |
574 const NmMessageEnvelope& aNmMessageEnvelope); |
596 const NmMessageEnvelope& aNmMessageEnvelope); |
575 //<qmail> |
597 // </qmail> |
576 |
598 |
577 private: // data |
599 private: // data |
578 |
600 |
|
601 // <qmail> |
|
602 // Unnecessary members removed: iMessagePartId, iContentSize, iFetchedContentSize |
|
603 // </qmail> |
579 /** read only part size */ |
604 /** read only part size */ |
580 TUint iReadOnlyPartSize; |
605 TUint iReadOnlyPartSize; |
581 |
606 |
582 /** fetched from email server indication */ |
607 /** fetched from email server indication */ |
583 TBool iIsFetched; |
608 TBool iIsFetched; |
584 |
609 |
|
610 // <qmail> |
585 /** |
611 /** |
586 * email content decription - pointer descriptor to access QString object |
612 * email content decription - pointer descriptor to access QString object |
587 */ |
613 */ |
588 mutable TPtrC iContentDescriptionPtr; |
614 mutable TPtrC iContentDescriptionPtr; |
589 |
615 |
590 /** |
616 /** |
591 * email content disposition - pointer descriptor to access QString object |
617 * email content disposition - pointer descriptor to access QString object |
592 */ |
618 */ |
593 mutable TPtrC iContentDispositionPtr; |
619 mutable TPtrC iContentDispositionPtr; |
|
620 // </qmail> |
594 |
621 |
595 /** attachment name */ |
622 /** attachment name */ |
596 HBufC *iAttachmentName; |
623 HBufC *iAttachmentName; |
597 |
624 |
598 /** email content class */ |
625 /** email content class */ |
599 HBufC *iContentClass; |
626 HBufC *iContentClass; |
600 |
627 |
|
628 // <qmail> |
601 /** |
629 /** |
602 * email content id - pointer descriptor to access QString object |
630 * email content id - pointer descriptor to access QString object |
603 */ |
631 */ |
604 mutable TPtrC iContentIDPtr; |
632 mutable TPtrC iContentIDPtr; |
|
633 // </qmail> |
605 |
634 |
606 /** content disposition parameters */ |
635 /** content disposition parameters */ |
607 CDesCArray *iContentDispositionParams; |
636 CDesCArray *iContentDispositionParams; |
608 |
637 |
609 /** content type parameters */ |
638 /** content type parameters */ |
610 CDesCArray *iContentTypeParams; |
639 CDesCArray *iContentTypeParams; |
611 |
640 |
612 /** meeting request object */ |
641 /** meeting request object */ |
613 MMRInfoObject* iMeetingRequest; |
642 MMRInfoObject* iMeetingRequest; |
614 |
643 |
615 /* temp file handle */ |
644 /* temp file handle */ |
616 RFile iFile; |
645 RFile iFile; |
617 }; |
646 }; |
618 |
647 |