![]() |
Home | ![]() |
The QMailMessagePartContainer class provides access to a collection of message parts. More...
#include <QMailMessagePartContainer>
This class is under development and is subject to change.
Inherits QMailMessagePartContainerFwd.
Inherited by QMailMessage and QMailMessagePart.
class | Location |
virtual void | appendHeaderField ( const QString & id, const QString & value ) |
virtual void | appendHeaderField ( const QMailMessageHeaderField & field ) |
void | appendPart ( const QMailMessagePart & part ) |
QMailMessageBody | body () const |
QByteArray | boundary () const |
void | clearParts () |
virtual bool | contentAvailable () const = 0 |
QMailMessageContentType | contentType () const |
QList<QMailMessagePartContainer::Location> | findAttachmentLocations () const |
QMailMessagePartContainer * | findHtmlContainer () const |
QMailMessagePartContainer * | findPlainTextContainer () const |
bool | foreachPart ( F func ) |
bool | foreachPart ( F func ) const |
bool | hasAttachments () const |
bool | hasBody () const |
bool | hasHtmlBody () const |
bool | hasPlainTextBody () const |
QMailMessageHeaderField | headerField ( const QString & id, QMailMessageHeaderField::FieldType fieldType = QMailMessageHeaderField::StructuredField ) const |
QString | headerFieldText ( const QString & id ) const |
QList<QMailMessageHeaderField> | headerFields ( const QString & id, QMailMessageHeaderField::FieldType fieldType = QMailMessageHeaderField::StructuredField ) const |
QList<QMailMessageHeaderField> | headerFields () const |
QStringList | headerFieldsText ( const QString & id ) const |
MultipartType | multipartType () const |
const QMailMessagePart & | partAt ( uint pos ) const |
QMailMessagePart & | partAt ( uint pos ) |
uint | partCount () const |
virtual bool | partialContentAvailable () const = 0 |
void | prependPart ( const QMailMessagePart & part ) |
virtual void | removeHeaderField ( const QString & id ) |
void | removePartAt ( uint pos ) |
void | setAttachments ( const QStringList & attachments ) |
void | setAttachments ( const QList<const QMailMessagePart *> attachments ) |
void | setBody ( const QMailMessageBody & body ) |
void | setBoundary ( const QByteArray & text ) |
virtual void | setHeaderField ( const QString & id, const QString & value ) |
virtual void | setHeaderField ( const QMailMessageHeaderField & field ) |
void | setHtmlAndPlainTextBody ( const QMailMessageBody & htmlBody, const QMailMessageBody & plainTextBody ) |
void | setMultipartType ( MultipartType type ) |
void | setPlainTextBody ( const QMailMessageBody & plainTextBody ) |
QMailMessageBody::TransferEncoding | transferEncoding () const |
MultipartType | multipartTypeForName ( const QByteArray & name ) |
QByteArray | nameForMultipartType ( MultipartType type ) |
QMailMessagePartContainer ( Subclass * p ) |
The QMailMessagePartContainer class provides access to a collection of message parts.
Message formats such as email messages conforming to RFC 2822 (Internet Message Format) can consist of multiple independent parts, whose relationship to each other is defined by the message that contains those parts. The QMailMessagePartContainer class provides storage for these related message parts, and the interface through which they are accessed.
The multipartType() function returns a member of the MultipartType enumeration, which describes the relationship of the parts in the container to each other.
The part container can instead contain a message body element. In this case, it cannot contain sub-parts, and the multipartType() function will return MultipartType::MultipartNone for the part. The body element can be accessed via the body() function.
The QMailMessagePart class is itself derived from QMailMessagePartContainer, which allows messages to support the nesting of part collections within other part collections.
See also QMailMessagePart, QMailMessage, and QMailMessageBody.
Constructs an empty part container object, in the space allocated within the subclass instance at p.
Appends a new header field with id id and value value to the existing list of header fields. Any existing header fields with the same id are not modified. If value is of the form "<id>:<content>", then only the part after the semi-colon is processed.
RFC 2822 encoding requires header fields to be transmitted in ASCII characters. If value contains non-ASCII characters, it will be encoded to ASCII via the QMailMessageHeaderField::encodeContent() function; depending on the specific header field this may result in illegal content. Where possible, clients should encode non-ASCII data prior to calling appendHeaderField.
See also QMailMessageHeaderField.
Appends a new header field with the properties of field. Any existing header fields with the same id are not modified.
Append part to the list of attachments for the message.
Returns the body element contained by the part.
See also setBody().
Returns the boundary text used to delimit the container's parts when encoded in RFC 2822 form.
See also setBoundary().
Clears the list of attachments associated with the message.
Returns true if the entire content of this element is available; otherwise returns false.
Returns the content type of this part. Where hasBody() is true, the type of the contained body element is returned; otherwise a content type matching the multipartType() for this part is returned.
See also hasBody(), QMailMessageBody::contentType(), and multipartType().
Returns the locations of the attachments in a container, dealing with a range of different message structures and exceptions.
Searches for the container that encapsulates the HTML body of this container, returning a pointer to it or 0 if it's not present.
Searches for the container that encapsulates the plain text body of this container, returning a pointer to it or 0 if it's not present.
Applies the function or functor func to each part contained within the container. func must implement the signature 'bool operator()(QMailMessagePart &)', and must return true to indicate success, or false to end the traversal operation.
Returns true if all parts of the message were traversed, and func returned true for every invocation; else returns false.
Applies the function or functor func to each part contained within the container. func must implement the signature 'bool operator()(const QMailMessagePart &)', and must return true to indicate success, or false to end the traversal operation.
Returns true if all parts of the message were traversed, and func returned true for every invocation; else returns false.
Returns true if attachments are present in the container, dealing with a range of different message structures and exceptions.
Returns true if the part contains a body element; otherwise returns false.
Returns true if an HTML body is present in the container.
Returns true if a plain text body is present in the container.
Returns an object containing the value of the first header field with the given id. If fieldType is QMailMessageHeaderField::StructuredField, then the field content will be parsed assuming a format equivalent to that used for the RFC 2045 'Content-Type' and RFC 2183 'Content-Disposition' header fields.
See also setHeaderField().
Returns the text of the first header field with the given id.
Returns a list of objects containing the value of each header field with the given id. If fieldType is QMailMessageHeaderField::StructuredField, then the field content will be parsed assuming a format equivalent to that used for the RFC 2045 'Content-Type' and RFC 2183 'Content-Disposition' header fields.
Returns a list of objects containing the value of each header field contained by the part. Header field objects returned by this function are not 'structured'.
Returns a list containing the text of each header field with the given id.
Returns the type of multipart relationship shared by the parts contained within this container, or MultipartNone if the content is not a multipart message.
See also setMultipartType().
Returns the multipart type that corresponds to the type name name.
Returns the standard textual representation for the multipart type type.
Returns a const reference to the item at position pos in the list of attachments for the message.
pos must be a valid index position in the list (i.e., 0 <= i < partCount()).
Returns a non-const reference to the item at position pos in the list of attachments for the message.
pos must be a valid index position in the list (i.e., 0 <= i < partCount()).
Returns the number of attachments the message has.
Returns true if some portion of the content of this element is available; otherwise returns false.
Prepend part to the list of attachments for the message.
Removes all existing header fields with id equal to id.
Removes the part at the index pos.
pos must be a valid index position in the list (i.e., 0 <= i < partCount()).
Sets the attachment list of a container to attachments. \param
attachments String paths to local files to be attached
See also hasAttachments().
Sets the attachment list of a container to attachments. \param
attachments List of already created message parts representing the attachments (might come from other existing messages)
Sets the part to contain the body element body.
See also body().
Sets the boundary text used to delimit the container's parts when encoded in RFC 2822 form to text.
See also boundary().
Sets the value of the first header field with identity id to value if it already exists; otherwise adds the header with the supplied id and value. If value is of the form "<id>:<content>", then only the part after the semi-colon is processed.
RFC 2822 encoding requires header fields to be transmitted in ASCII characters. If value contains non-ASCII characters, it will be encoded to ASCII via the QMailMessageHeaderField::encodeContent() function; depending on the specific header field this may result in illegal content. Where possible, clients should encode non-ASCII data prior to calling setHeaderField.
See also headerField() and QMailMessageHeaderField.
Sets the first header field with identity matching field to have the content of field.
Simultaneously sets the html and plain text body of a container to htmlBody and plainTextBody respectively.
Sets the multipart state of the message to type.
See also multipartType().
Sets the plain text body of a container to plainTextBody.
See also hasPlainTextBody().
Returns the transfer encoding type of this part. Where hasBody() is true, the transfer encoding type of the contained body element is returned; otherwise, the transfer encoding type specified by the 'Content-Transfer-Encoding' field of the header for this part is returned.
See also hasBody() and QMailMessageBody::transferEncoding().
Copyright © 2010 QtSoftware | Messaging Framework |