Home · All Classes · Grouped Classes · Annotated · Functions

QMailMessagePart Class Reference

The QMailMessagePart class provides a convenient interface for working with message attachments. More...

    #include <QMailMessagePart>

This class is under development and is subject to change.

Inherits QMailMessagePartContainer.

Public Functions

Static Public Members


Detailed Description

The QMailMessagePart class provides a convenient interface for working with message attachments.

A message part inherits the properties of QMailMessagePartContainer, and can therefore contain a message body or a collection of sub-parts.

A message part differs from a message proper in that a part will often have properties specified by the MIME multipart specification, not relevant to messages. These include the 'name' and 'filename' parameters of the Content-Type and Content-Disposition fields, and the Content-Id and Content-Location fields.

See also QMailMessagePartContainer.


Member Function Documentation

QMailMessagePart::QMailMessagePart ()

Constructs an empty message part object.

QString QMailMessagePart::attachmentPath () const

Returns the path to a QMailMessagePart attachment file. Returns an empty path for parts that are not attachments or have not been detached.

QString QMailMessagePart::contentDescription () const

Returns the Content-Description header field for the part, if present; otherwise returns an empty string.

See also setContentDescription().

QMailMessageContentDisposition QMailMessagePart::contentDisposition () const

Returns the Content-Disposition header field for the part.

See also setContentDisposition().

QString QMailMessagePart::contentID () const

Returns the Content-Id header field for the part, if present; otherwise returns an empty string.

See also setContentID().

QString QMailMessagePart::contentLanguage () const

Returns the Content-Language header field for the part, if present; otherwise returns an empty string.

See also setContentLanguage().

QString QMailMessagePart::contentLocation () const

Returns the Content-Location header field for the part, if present; otherwise returns an empty string.

See also setContentLocation().

bool QMailMessagePart::detachAttachment ( const QString & path )

Detaches a file attachment QMailMessagePart, decoding and saving the file part into the directory specified by path. The name of the file is taken from the part. If another file already exists in the path a new unique name of the format <filename>.<random chars> is saved. Returns true on success or false otherwise.

QString QMailMessagePart::displayName () const

Returns a non-empty string to identify the part, appropriate for display. If the part 'Content-Type' header field contains a 'name' parameter, that value is used. Otherwise, if the part has a 'Content-Disposition' header field containing a 'filename' parameter, that value is used. Otherwise, if the part has a 'Content-ID' header field, that value is used. Finally, a usable name will be created by combining the content type of the part with the part's number.

See also identifier().

QMailMessagePart QMailMessagePart::fromData ( const QByteArray & input, const QMailMessageContentDisposition & disposition, const QMailMessageContentType & type, QMailMessageBody::TransferEncoding encoding, QMailMessageBody::EncodingStatus status = QMailMessageBody::RequiresEncoding )   [static]

Creates a QMailMessagePart containing an attachment of type disposition, from the data contained in input, of content type type and using the transfer encoding encoding. The current status of the data is specified as status.

See also QMailMessageBody::fromData().

QMailMessagePart QMailMessagePart::fromData ( const QString & input, const QMailMessageContentDisposition & disposition, const QMailMessageContentType & type, QMailMessageBody::TransferEncoding encoding )   [static]

This is an overloaded member function, provided for convenience.

Creates a QMailMessagePart containing an attachment of type disposition, from the data contained in input, of content type type and using the transfer encoding encoding.

See also QMailMessageBody::fromData().

QMailMessagePart QMailMessagePart::fromFile ( const QString & filename, const QMailMessageContentDisposition & disposition, const QMailMessageContentType & type, QMailMessageBody::TransferEncoding encoding, QMailMessageBody::EncodingStatus status = QMailMessageBody::RequiresEncoding )   [static]

Creates a QMailMessagePart containing an attachment of type disposition, from the data contained in filename, of content type type and using the transfer encoding encoding. The current status of the data is specified as status.

See also QMailMessageBody::fromFile().

QMailMessagePart QMailMessagePart::fromStream ( QDataStream & in, const QMailMessageContentDisposition & disposition, const QMailMessageContentType & type, QMailMessageBody::TransferEncoding encoding, QMailMessageBody::EncodingStatus status = QMailMessageBody::RequiresEncoding )   [static]

Creates a QMailMessagePart containing an attachment of type disposition, from the data read from in, of content type type and using the transfer encoding encoding. The current status of the data is specified as status.

See also QMailMessageBody::fromStream().

QMailMessagePart QMailMessagePart::fromStream ( QTextStream & in, const QMailMessageContentDisposition & disposition, const QMailMessageContentType & type, QMailMessageBody::TransferEncoding encoding )   [static]

This is an overloaded member function, provided for convenience.

Creates a QMailMessagePart containing an attachment of type disposition, from the data read from in, of content type type and using the transfer encoding encoding.

See also QMailMessageBody::fromStream().

QString QMailMessagePart::identifier () const

Returns a non-empty string to identify the part, appropriate for storage. If the part has a 'Content-ID' header field, that value is used. Otherwise, if the part has a 'Content-Disposition' header field containing a 'filename' parameter, that value is used. Otherwise, if the part 'Content-Type' header field contains a 'name' parameter, that value is used. Finally, the part's number will be returned.

int QMailMessagePart::partNumber () const

Returns the number of the part, if it has been set; otherwise returns -1.

See also setPartNumber().

void QMailMessagePart::setContentDescription ( const QString & description )

Sets the Content-Description header field for the part to contain description.

See also contentDescription().

void QMailMessagePart::setContentDisposition ( const QMailMessageContentDisposition & disposition )

Sets the Content-Disposition header field for the part to contain disposition.

See also contentDisposition().

void QMailMessagePart::setContentID ( const QString & id )

Sets the Content-Id header field for the part to contain id.

See also contentID().

void QMailMessagePart::setContentLanguage ( const QString & language )

Sets the Content-Language header field for the part to contain language.

See also contentLanguage().

void QMailMessagePart::setContentLocation ( const QString & location )

Sets the Content-Location header field for the part to contain location.

See also contentLocation().

void QMailMessagePart::setPartNumber ( int partNumber )

Sets the number of the part within its parent part container to partNumber.

See also partNumber().


Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3