emailservices/emailcommon/inc/CFSMailMessagePart.h
changeset 62 a8c646b56683
parent 20 ecc8def7944a
child 66 084b5b1f02a7
equal deleted inserted replaced
57:ae34e1715e21 62:a8c646b56683
   237      */
   237      */
   238      IMPORT_C CFSMailMessagePart* NewChildPartL( const TFSMailMsgId aInsertBefore,
   238      IMPORT_C CFSMailMessagePart* NewChildPartL( const TFSMailMsgId aInsertBefore,
   239                                                  const TDesC& aContentType );
   239                                                  const TDesC& aContentType );
   240 
   240 
   241     /**
   241     /**
   242      * Copies given email object as new child part of this email part or email.
       
   243      *
       
   244      * @param aInsertBefore defines place of where new child part is created,
       
   245      * if aInsertBefore is NULL id then new part is added as last.
       
   246      * @param aMessage message to be copied as child part
       
   247      *
       
   248      * @return new child part, ownership is transferred to user
       
   249      */        
       
   250      IMPORT_C CFSMailMessagePart* CopyMessageAsChildPartL( TFSMailMsgId aInsertBefore,
       
   251                                                            CFSMailMessage* aMessage);
       
   252 
       
   253     /**
       
   254      * Removes child part (and it's children, if any) from this email part
   242      * Removes child part (and it's children, if any) from this email part
   255      * 
   243      * 
   256      * @param aPartId part id of the email part to be removed
   244      * @param aPartId part id of the email part to be removed
   257      */
   245      */
   258      IMPORT_C void RemoveChildPartL(TFSMailMsgId aPartId);
   246      IMPORT_C void RemoveChildPartL(TFSMailMsgId aPartId);
   276      * The caller must close the file handle.
   264      * The caller must close the file handle.
   277      *
   265      *
   278      * @return content file handle 
   266      * @return content file handle 
   279      */
   267      */
   280      IMPORT_C RFile GetContentFileL();
   268      IMPORT_C RFile GetContentFileL();
   281         
   269        
   282     /**
       
   283      * copies contents of this message part to given file
       
   284      *
       
   285      * @param aContentLocation defines file location as 
       
   286      * a) directory, when plugin finds out corresponding file name
       
   287      *    related to this part id, in this case last character should
       
   288      *    be '/'
       
   289      * b) directory & filename, when both directory and file name
       
   290      *    are given by user
       
   291      * 
       
   292      */        
       
   293      IMPORT_C void CopyContentFileL(const TDesC& aContentLocation);
       
   294 
       
   295     /**
       
   296      * Sets email part contents from given file, possible old contents are replaced.
       
   297      *
       
   298      * @param aFilePath defines the target file
       
   299      */
       
   300      IMPORT_C void SetContentFromFileL(const TDesC& aFilePath);
       
   301 
       
   302     /**
       
   303      * Removes from message store fetched contents of this part
       
   304      * and possible child parts
       
   305      *
       
   306      */  
       
   307      IMPORT_C void RemoveContentL();
       
   308     
   270     
   309     /**
   271     /**
   310      * returns email part full content size (in bytes)
   272      * returns email part full content size (in bytes)
   311      *
   273      *
   312      */
   274      */
   331      * @param aContentSize content size to be set
   293      * @param aContentSize content size to be set
   332      */
   294      */
   333      IMPORT_C void SetFetchedContentSize(TUint aContentSize);
   295      IMPORT_C void SetFetchedContentSize(TUint aContentSize);
   334 
   296 
   335     /**
   297     /**
   336      * returns email part content current fetch state
       
   337      * Intended as utility function for UI.
       
   338      * If (0 == FetchedContentSize())
       
   339      *    return EFSNone;
       
   340      * else if (FetchedContentSize() < ContentSize()) then
       
   341      *    return EFSPartial
       
   342      * else
       
   343      *    return EFSFull
       
   344      *
       
   345      * @return email fetch state (EFSNone / EFSPartial / EFSFull)
       
   346      */
       
   347      IMPORT_C TFSPartFetchState FetchLoadState() const;
       
   348 
       
   349     /**
       
   350      * copies email part contents to buffer given by user
   298      * copies email part contents to buffer given by user
   351      *
   299      *
   352      * @param aBuffer buffer owned by user
   300      * @param aBuffer buffer owned by user
   353      * @param aStartOffset offset from content begin
   301      * @param aStartOffset offset from content begin
   354      */
   302      */
   408      * @return email body part or NULL if not found, ownership is transferred to user
   356      * @return email body part or NULL if not found, ownership is transferred to user
   409      */
   357      */
   410      IMPORT_C CFSMailMessagePart* FindBodyPartL(const TDesC& aContentType,
   358      IMPORT_C CFSMailMessagePart* FindBodyPartL(const TDesC& aContentType,
   411          TFSMailMessagePartDataSource aDataSource = EDataSourceMessageStore);
   359          TFSMailMessagePartDataSource aDataSource = EDataSourceMessageStore);
   412 // </qmail>
   360 // </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 );
       
   422 
   361 
   423     /**
   362     /**
   424      * starts email part fetching from email server
   363      * starts email part fetching from email server
   425      * 
   364      * 
   426      * @param aMessagePartId message part id of email part to be fetched
   365      * @param aMessagePartId message part id of email part to be fetched
   491      *
   430      *
   492      * @param aReadOnlyPartSize read only size to be set
   431      * @param aReadOnlyPartSize read only size to be set
   493      * (character or byte count)
   432      * (character or byte count)
   494      */
   433      */
   495      IMPORT_C void SetReadOnlyPartSize(const TUint aReadOnlyPartSize);
   434      IMPORT_C void SetReadOnlyPartSize(const TUint aReadOnlyPartSize);
   496      
       
   497      /**
       
   498       * removes attachment downloaded contents from local/terminal memory
       
   499       *
       
   500       */
       
   501      IMPORT_C void RemoveDownLoadedAttachmentsL();
       
   502      
   435      
   503 // <qmail>
   436 // <qmail>
   504      /**
   437      /**
   505  	 * gets the new NmMessagePart object
   438  	 * gets the new NmMessagePart object
   506  	 *
   439  	 *