![]() |
Home | ![]() |
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 and QMailMessagePartFwd.
QMailMessagePart () | |
QString | contentDescription () const |
QMailMessageContentDisposition | contentDisposition () const |
QString | contentID () const |
QString | contentLanguage () const |
QString | contentLocation () const |
QString | displayName () const |
QString | identifier () const |
virtual uint | indicativeSize () const |
Location | location () const |
QMailMessageId | messageReference () const |
int | partNumber () const |
QMailMessagePart::Location | partReference () const |
QString | referenceResolution () const |
ReferenceType | referenceType () const |
void | setContentDescription ( const QString & description ) |
void | setContentDisposition ( const QMailMessageContentDisposition & disposition ) |
void | setContentID ( const QString & id ) |
void | setContentLanguage ( const QString & language ) |
void | setContentLocation ( const QString & location ) |
void | setReference ( const QMailMessageId & id, const QMailMessageContentType & type, QMailMessageBody::TransferEncoding encoding ) |
void | setReference ( const QMailMessagePart::Location & location, const QMailMessageContentType & type, QMailMessageBody::TransferEncoding encoding ) |
void | setReferenceResolution ( const QString & uri ) |
QString | writeBodyTo ( const QString & path ) const |
virtual bool | contentAvailable () const |
virtual bool | partialContentAvailable () const |
QMailMessagePart | fromData ( const QByteArray & input, const QMailMessageContentDisposition & disposition, const QMailMessageContentType & type, QMailMessageBody::TransferEncoding encoding, QMailMessageBody::EncodingStatus status = QMailMessageBody::RequiresEncoding ) |
QMailMessagePart | fromData ( const QString & input, const QMailMessageContentDisposition & disposition, const QMailMessageContentType & type, QMailMessageBody::TransferEncoding encoding ) |
QMailMessagePart | fromFile ( const QString & filename, const QMailMessageContentDisposition & disposition, const QMailMessageContentType & type, QMailMessageBody::TransferEncoding encoding, QMailMessageBody::EncodingStatus status = QMailMessageBody::RequiresEncoding ) |
QMailMessagePart | fromMessageReference ( const QMailMessageId & messageId, const QMailMessageContentDisposition & disposition, const QMailMessageContentType & type, QMailMessageBody::TransferEncoding encoding ) |
QMailMessagePart | fromPartReference ( const QMailMessagePart::Location & partLocation, const QMailMessageContentDisposition & disposition, const QMailMessageContentType & type, QMailMessageBody::TransferEncoding encoding ) |
QMailMessagePart | fromStream ( QDataStream & in, const QMailMessageContentDisposition & disposition, const QMailMessageContentType & type, QMailMessageBody::TransferEncoding encoding, QMailMessageBody::EncodingStatus status = QMailMessageBody::RequiresEncoding ) |
QMailMessagePart | fromStream ( QTextStream & in, const QMailMessageContentDisposition & disposition, const QMailMessageContentType & type, QMailMessageBody::TransferEncoding encoding ) |
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.
A message part may consist entirely of a reference to an external message, or a part within an external message. Parts that consists of references may be used with some protocols that permit data to be transmitted by reference, such as IMAP with the URLAUTH extension. Not all messaging protocols support the use of content references. The partReference() and messageReference() functions enable the creation of reference parts.
See also QMailMessagePartContainer.
Constructs an empty message part object.
Reimplemented from QMailMessagePartContainer::contentAvailable().
Returns true if the entire content of this part is available; otherwise returns false.
Returns the Content-Description header field for the part, if present; otherwise returns an empty string.
See also setContentDescription().
Returns the Content-Disposition header field for the part.
See also setContentDisposition().
Returns the Content-Id header field for the part, if present; otherwise returns an empty string.
If the header field content is surrounded by angle brackets, these are removed.
See also setContentID().
Returns the Content-Language header field for the part, if present; otherwise returns an empty string.
See also setContentLanguage().
Returns the Content-Location header field for the part, if present; otherwise returns an empty string.
See also setContentLocation().
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().
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().
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().
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().
Creates a QMailMessagePart containing an attachment of type disposition, whose content is a reference to the message identified by messageId. The resulting part has content type type and uses the transfer encoding encoding.
The message reference can only be resolved by transmitting the message to an external server, where both the originating server of the referenced message and the receiving server of the new message support resolution of the content reference.
Creates a QMailMessagePart containing an attachment of type disposition, whose content is a reference to the message part identified by partLocation. The resulting part has content type type and uses the transfer encoding encoding.
The part reference can only be resolved by transmitting the message to an external server, where both the originating server of the referenced part's message and the receiving server of the new message support resolution of the content reference.
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().
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().
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.
Returns an indication of the size of the part. This measure should be used only in comparing the relative size of parts with respect to transmission.
Returns the location of the part within the message.
Returns the identifier of the message that this part references.
The result will be meaningful only when referenceType() yields QMailMessagePart::MessageReference.
See also referenceType(), partReference(), and referenceResolution().
Returns the number of the part, if it has been set; otherwise returns -1.
Returns the location of the message part that this part references.
The result will be meaningful only when referenceType() yields QMailMessagePart::PartReference.
See also referenceType(), messageReference(), and referenceResolution().
Reimplemented from QMailMessagePartContainer::partialContentAvailable().
Returns true if some portion of the content of this part is available; otherwise returns false.
Returns the URI that resolves the reference encoded into this message part.
The result will be meaningful only when referenceType() yields other than QMailMessagePart::None.
See also setReferenceResolution() and referenceType().
Returns the type of reference that this message part constitutes.
See also setReference().
Sets the Content-Description header field for the part to contain description.
See also contentDescription().
Sets the Content-Disposition header field for the part to contain disposition.
See also contentDisposition().
Sets the Content-Id header field for the part to contain id.
If id is not surrounded by angle brackets, these are added.
See also contentID().
Sets the Content-Language header field for the part to contain language.
See also contentLanguage().
Sets the Content-Location header field for the part to contain location.
See also contentLocation().
Sets the part content to contain a reference to the message identified by id, having content type type and using the transfer encoding encoding.
The message reference can only be resolved by transmitting the message to an external server, where both the originating server of the referenced message and the receiving server of the new message support resolution of the content reference.
See also referenceType() and setReferenceResolution().
Sets the part content to contain a reference to the message part identified by location, having content type type and using the transfer encoding encoding.
The part reference can only be resolved by transmitting the message to an external server, where both the originating server of the referenced part's message and the receiving server of the new message support resolution of the content reference.
See also referenceType() and setReferenceResolution().
Sets the URI that resolves the reference encoded into this message part to uri.
The reference URI is meaningful only when referenceType() yields other than QMailMessagePart::None.
See also referenceResolution() and referenceType().
Writes the decoded body of the part to a file under the directory specified by path. The name of the resulting file is taken from the part. If that file name already exists in the path a new unique name of the format <random chars>.<filename> is saved.
Returns the path of the file written on success, or an empty string otherwise.
Copyright © 2010 QtSoftware | Messaging Framework |