Loading...
Searching...
No Matches
Public Member Functions | List of all members
BMailAttachment Class Referenceabstract

Abstract interface for objects that handle mail attachments. More...

Inherits BMailComponent.

Inherited by BAttributedMailAttachment, and BSimpleMailAttachment.

Public Member Functions

virtual status_t InitCheck ()=0
 Pure virtual to check if the object was successfully initialized.
 
virtual status_t SetTo (BFile *file, bool deleteFileWhenDone=false)=0
 Pure virtual to initialize the object's attached file.
 
virtual status_t SetTo (entry_ref *ref)=0
 Pure virtual to initialize the object's attached file.
 
Attachment's filename
virtual void SetFileName (const char *name)=0
 Pure virtual to change the filename of the attachment.
 
virtual status_t FileName (char *name)=0
 Pure virtual to return the filename of the attachment.
 
- Public Member Functions inherited from BMailComponent
 BMailComponent (uint32 defaultCharSet=B_MAIL_NULL_CONVERSION)
 Initializes a new BMailComponent with the specified character set.
 
virtual ~BMailComponent ()
 Destructor.
 
uint32 ComponentType ()
 Returns the component_type of this object.
 
virtual status_t GetDecodedData (BPositionIO *data)
 Retrieves the data contained in this component in canonical format and places it into data.
 
const char * HeaderAt (int32 index) const
 Returns the key of the header at index.
 
status_t HeaderField (const char *key, BMessage *structured_header, int32 index=0) const
 Returns the header key.
 
const char * HeaderField (const char *key, int32 index=0) const
 Returns the header key.
 
bool IsAttachment ()
 Employs simple heuristics such as the MIME type and the Content-Disposition: header to determine whether this component is an attachment.
 
virtual status_t MIMEType (BMimeType *mime)
 Places the MIME type of the data into mime.
 
status_t RemoveHeader (const char *key)
 Removes all headers with the key key.
 
virtual status_t RenderToRFC822 (BPositionIO *render_to)
 Renders the component into RFC-822 format.
 
virtual status_t SetDecodedData (BPositionIO *data)
 Sets the content of this component to the canonical format data contained in data.
 
void SetHeaderField (const char *key, BMessage *structured_header, bool replace_existing=true)
 Adds a structured header of type key to the component.
 
void SetHeaderField (const char *key, const char *value, uint32 charset=B_MAIL_NULL_CONVERSION, mail_encoding encoding=null_encoding, bool replace_existing=true)
 Adds the specified header of type key and with the value to the component.
 
virtual status_t SetToRFC822 (BPositionIO *data, size_t length, bool parse_now=false)
 Sets this object from a component in RFC-822 format.
 
BMailComponentWhatIsThis ()
 Employs simple heuristics such as the MIME type to present you with an instance of a useful subclass.
 

Detailed Description

Abstract interface for objects that handle mail attachments.

Since
Haiku R1

Member Function Documentation

◆ FileName()

status_t BMailAttachment::FileName ( char *  name)
pure virtual

Pure virtual to return the filename of the attachment.

Parameters
[out]nameA pre-allocated variable of B_FILE_NAME_LENGTH length where to write the filename.
Returns
A status code.
Since
Haiku R1

Implemented in BSimpleMailAttachment, and BAttributedMailAttachment.

◆ InitCheck()

status_t BMailAttachment::InitCheck ( )
pure virtual

Pure virtual to check if the object was successfully initialized.

Returns
A status code.
Since
Haiku R1

Implemented in BSimpleMailAttachment, and BAttributedMailAttachment.

◆ SetFileName()

void BMailAttachment::SetFileName ( const char *  name)
pure virtual

Pure virtual to change the filename of the attachment.

Parameters
[in]nameThe new filename string.
Since
Haiku R1

Implemented in BSimpleMailAttachment, and BAttributedMailAttachment.

◆ SetTo() [1/2]

status_t BMailAttachment::SetTo ( BFile file,
bool  deleteFileWhenDone = false 
)
pure virtual

Pure virtual to initialize the object's attached file.

Parameters
[in]fileA file for the attachment's data.
[in]deleteFileWhenDoneTells if the file has to be deleted when this object is destroyed.
Returns
A status code.
Since
Haiku R1

Implemented in BSimpleMailAttachment, and BAttributedMailAttachment.

◆ SetTo() [2/2]

status_t BMailAttachment::SetTo ( entry_ref ref)
pure virtual

Pure virtual to initialize the object's attached file.

Parameters
[in]refAn entry_ref for the attachment's data.
Returns
A status code.
Since
Haiku R1

Implemented in BSimpleMailAttachment, and BAttributedMailAttachment.