Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QMailMessagePartContainer class provides access to a collection of message parts. More...
#include <QMailMessagePartContainer>
This class is under development and is subject to change.
Inherited by QMailMessage and QMailMessagePart.
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.
This enumerated type is used to describe the multipart encoding of a message or message part.
Constant | Value | Description |
---|---|---|
QMailMessagePartContainer::MultipartNone | 0 | The container does not hold parts. |
QMailMessagePartContainer::MultipartSigned | 1 | The container holds parts encoded according to RFC 1847 "multipart/signed" |
QMailMessagePartContainer::MultipartEncrypted | 2 | The container holds parts encoded according to RFC 1847 "multipart/encrypted" |
QMailMessagePartContainer::MultipartMixed | 3 | The container holds parts encoded according to RFC 2046 "multipart/mixed" |
QMailMessagePartContainer::MultipartAlternative | 4 | The container holds parts encoded according to RFC 2046 "multipart/alternative" |
QMailMessagePartContainer::MultipartDigest | 5 | The container holds parts encoded according to RFC 2046 "multipart/digest" |
QMailMessagePartContainer::MultipartParallel | 6 | The container holds parts encoded according to RFC 2046 "multipart/parallel" |
QMailMessagePartContainer::MultipartRelated | 7 | The container holds parts encoded according to RFC 2387 "multipart/related" |
QMailMessagePartContainer::MultipartFormData | 8 | The container holds parts encoded according to RFC 2388 "multipart/form-data" |
QMailMessagePartContainer::MultipartReport | 9 | The container holds parts encoded according to RFC 3462 "multipart/report" |
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.
This is an overloaded member function, provided for convenience.
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 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 true if the part contains a body element; otherwise returns false.
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.
This is an overloaded member function, provided for convenience.
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 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()).
This is an overloaded member function, provided for convenience.
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.
Prepend part to the list of attachments for the message.
Removes all existing header fields with id equal to id.
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.
This is an overloaded member function, provided for convenience.
Sets the first header field with identity matching field to have the content of field.
Sets the multipart state of the message to type.
See also multipartType().
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 © 2009 Nokia | Trademarks | Qt Extended 4.4.3 |