Logo Search packages:      
Sourcecode: qmf version File versions  Download package

Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Friends

QMailMessage Class Reference

The QMailMessage class provides a convenient interface for working with messages. More...

Inheritance diagram for QMailMessage:
Inheritance graph
Collaboration diagram for QMailMessage:
Collaboration graph

List of all members.

Public Types

enum  AttachmentsAction { LinkToAttachments = 0, CopyAttachments, CopyAndDeleteAttachments }
enum  ChunkType { Text = 0, Reference }
enum  ContentType {
  UnknownContent = 0, NoContent = 1, PlainTextContent = 2, RichTextContent = 3,
  HtmlContent = 4, ImageContent = 5, AudioContent = 6, VideoContent = 7,
  MultipartContent = 8, SmilContent = 9, VoicemailContent = 10, VideomailContent = 11,
  VCardContent = 12, VCalendarContent = 13, ICalendarContent = 14, DeliveryReportContent = 15,
  UserContent = 64
enum  EncodingFormat { HeaderOnlyFormat = 1, StorageFormat = 2, TransmissionFormat = 3, IdentityFormat = 4 }
typedef QMailMessageMetaDataPrivate ImplementationType
typedef QPair< ChunkType,
QByteArray > 
enum  MessageType {
  Mms = 0x1, Sms = 0x4, Email = 0x8, System = 0x10,
  Instant = 0x20, None = 0, AnyType = Mms | Sms | Email | System | Instant
enum  MultipartType {
  MultipartNone = 0, MultipartSigned = 1, MultipartEncrypted = 2, MultipartMixed = 3,
  MultipartAlternative = 4, MultipartDigest = 5, MultipartParallel = 6, MultipartRelated = 7,
  MultipartFormData = 8, MultipartReport = 9
enum  ResponseType {
  NoResponse = 0, Reply = 1, ReplyToAll = 2, Forward = 3,
  ForwardPart = 4, Redirect = 5, UnspecifiedResponse = 6

Public Member Functions

virtual void appendHeaderField (const QString &id, const QString &content)
virtual void appendHeaderField (const QMailMessageHeaderField &field)
void appendPart (const QMailMessagePart &part)
virtual QList< QMailAddressbcc () const
QMailMessageBody body () const
QByteArray boundary () const
virtual QList< QMailAddresscc () const
void clearParts ()
bool contains (const QMailMessagePart::Location &location) const
virtual ContentType content () const
virtual bool contentAvailable () const
virtual QString contentIdentifier () const
virtual bool contentModified () const
virtual QString contentScheme () const
virtual uint contentSize () const
QMailMessageContentType contentType () const
virtual QString copyServerUid () const
QString customField (const QString &name) const
const QMap< QString, QString > & customFields () const
virtual bool dataModified () const
virtual QMailTimeStamp date () const
template<typename Stream >
void deserialize (Stream &stream)
virtual QString externalLocationReference () const
< QMailMessagePartContainer::Location
findAttachmentLocations () const
QMailMessagePartContainerfindHtmlContainer () const
QMailMessagePartContainerfindPlainTextContainer () const
template<typename F >
bool foreachPart (F func) const
template<typename F >
bool foreachPart (F func)
virtual QMailAddress from () const
bool hasAttachments () const
bool hasBody () const
bool hasHtmlBody () const
bool hasPlainTextBody () const
virtual bool hasRecipients () const
QMailMessageHeaderField headerField (const QString &id, QMailMessageHeaderField::FieldType fieldType=QMailMessageHeaderField::StructuredField) const
QList< QMailMessageHeaderFieldheaderFields (const QString &id, QMailMessageHeaderField::FieldType fieldType=QMailMessageHeaderField::StructuredField) const
QList< QMailMessageHeaderFieldheaderFields () const
QStringList headerFieldsText (const QString &id) const
QString headerFieldText (const QString &id) const
virtual QMailMessageId id () const
InterfaceType::QMailMessagePartContainerPrivate * impl (InterfaceType *)
const ImplementationSubclass * impl () const
InterfaceType::QMailMessagePartContainerPrivate * 
impl (const InterfaceType *) const
ImplementationSubclass * impl ()
InterfaceType::QMailMessageMetaDataPrivate * impl (InterfaceType *)
const ImplementationSubclass * impl () const
InterfaceType::QMailMessageMetaDataPrivate * 
impl (const InterfaceType *) const
ImplementationSubclass * impl ()
virtual uint indicativeSize () const
virtual QString inReplyTo () const
virtual QMailMessageId inResponseTo () const
QMailMessageId latestInConversation () const
virtual QString listId () const
virtual MessageType messageType () const
MultipartType multipartType () const
virtual QMailAccountId parentAccountId () const
virtual QMailFolderId parentFolderId () const
QMailMessagePartpartAt (const QMailMessagePart::Location &location)
const QMailMessagePartpartAt (const QMailMessagePart::Location &location) const
QMailMessagePartpartAt (uint pos)
const QMailMessagePartpartAt (uint pos) const
uint partCount () const
virtual bool partialContentAvailable () const
void prependPart (const QMailMessagePart &part)
virtual QString preview () const
virtual QMailFolderId previousParentFolderId () const
 QMailMessage ()
 QMailMessage (const QMailMessageId &id)
 QMailMessage (const QString &uid, const QMailAccountId &accountId)
virtual QMailTimeStamp receivedDate () const
virtual QList< QMailAddressrecipients () const
void removeCustomField (const QString &name)
virtual void removeHeaderField (const QString &id)
void removePartAt (uint pos)
virtual QMailAddress replyTo () const
virtual ResponseType responseType () const
virtual QMailFolderId restoreFolderId () const
virtual QString rfcId () const
template<typename Stream >
void serialize (Stream &stream) const
virtual QString serverUid () const
void setAttachments (const QList< const QMailMessagePart * > attachments)
void setAttachments (const QStringList &attachments)
virtual void setBcc (const QList< QMailAddress > &s)
void setBody (const QMailMessageBody &body)
void setBoundary (const QByteArray &text)
virtual void setCc (const QList< QMailAddress > &s)
virtual void setContent (ContentType type)
virtual bool setContentIdentifier (const QString &i)
virtual bool setContentScheme (const QString &s)
virtual void setContentSize (uint size)
virtual void setCopyServerUid (const QString &s)
void setCustomField (const QString &name, const QString &value)
void setCustomFields (const QMap< QString, QString > &fields)
virtual void setDate (const QMailTimeStamp &s)
virtual void setExternalLocationReference (const QString &s)
virtual void setFrom (const QMailAddress &s)
virtual void setHeaderField (const QMailMessageHeaderField &field)
virtual void setHeaderField (const QString &id, const QString &content)
void setHtmlAndPlainTextBody (const QMailMessageBody &htmlBody, const QMailMessageBody &plainTextBody)
virtual void setId (const QMailMessageId &id)
virtual void setInReplyTo (const QString &s)
virtual void setInResponseTo (const QMailMessageId &id)
virtual void setListId (const QString &s)
virtual void setMessageType (MessageType t)
void setMultipartType (MultipartType type)
virtual void setParentAccountId (const QMailAccountId &id)
virtual void setParentFolderId (const QMailFolderId &id)
void setPlainTextBody (const QMailMessageBody &plainTextBody)
virtual void setPreview (const QString &s)
virtual void setPreviousParentFolderId (const QMailFolderId &id)
virtual void setReceivedDate (const QMailTimeStamp &s)
virtual void setReplyTo (const QMailAddress &s)
virtual void setResponseType (ResponseType type)
virtual void setRestoreFolderId (const QMailFolderId &s)
virtual void setRfcId (const QString &s)
virtual void setServerUid (const QString &s)
virtual void setSize (uint i)
virtual void setStatus (quint64 newStatus)
virtual void setStatus (quint64 mask, bool set)
virtual void setSubject (const QString &s)
virtual void setTo (const QList< QMailAddress > &s)
virtual void setTo (const QMailAddress &s)
virtual uint size () const
virtual quint64 status () const
virtual QString subject () const
virtual QList< QMailAddressto () const
void toRfc2822 (QDataStream &out, EncodingFormat format=TransmissionFormat) const
QByteArray toRfc2822 (EncodingFormat format=TransmissionFormat) const
QList< QMailMessage::MessageChunktoRfc2822Chunks (EncodingFormat format=TransmissionFormat) const
QMailMessageBody::TransferEncoding transferEncoding () const

Static Public Member Functions

static QMailMessage fromRfc2822 (const QByteArray &ba)
static QMailMessage fromRfc2822File (const QString &fileName)
static MultipartType multipartTypeForName (const QByteArray &name)
static QByteArray nameForMultipartType (MultipartType type)
static quint64 statusMask (const QString &flagName)

Static Public Attributes

static const quint64 & CalendarInvitation = calendarInvitationFlag
static const char CarriageReturn = '\015'
static const quint64 & ContentAvailable = contentAvailableFlag
static const char * CRLF = "\015\012"
static const quint64 & Draft = draftFlag
static const quint64 & Forwarded = forwardedFlag
static const quint64 & HasAttachments = hasAttachmentsFlag
static const quint64 & HasReferences = hasReferencesFlag
static const quint64 & HasUnresolvedReferences = hasUnresolvedReferencesFlag
static const quint64 & HighPriority = highPriorityFlag
static const quint64 & Important = importantFlag
static const quint64 & ImportantElsewhere = importantElsewhereFlag
static const quint64 & Incoming = incomingFlag
static const quint64 & Junk = junkFlag
static const char LineFeed = '\012'
static const quint64 & LocalOnly = localOnlyFlag
static const quint64 & LowPriority = lowPriorityFlag
static const quint64 & New = newFlag
static const quint64 & Outbox = outboxFlag
static const quint64 & Outgoing = outgoingFlag
static const quint64 & PartialContentAvailable = partialContentAvailableFlag
static const quint64 & Read = readFlag
static const quint64 & ReadElsewhere = readElsewhereFlag
static const quint64 & ReadReplyRequested = readReplyRequestedFlag
static const quint64 & Removed = removedFlag
static const quint64 & Replied = repliedFlag
static const quint64 & RepliedAll = repliedAllFlag
static const quint64 & Sent = sentFlag
static const quint64 & Temporary = temporaryFlag
static const quint64 & TransmitFromExternal = transmitFromExternalFlag
static const quint64 & Trash = trashFlag
static const quint64 & UnloadedData = unloadedDataFlag

Protected Member Functions

virtual void setHeader (const QMailMessageHeader &header, const QMailMessagePartContainerPrivate *parent=0)

Protected Attributes

< QMailMessageMetaDataPrivate
< QMailMessagePartContainerPrivate

Private Member Functions

QByteArray duplicatedData (const QString &) const
const QMailMessageMetaDataPrivatemetaDataImpl () const
QMailMessageMetaDataPrivatemetaDataImpl ()
const QMailMessagePrivatepartContainerImpl () const
QMailMessagePrivatepartContainerImpl ()
virtual void setUnmodified ()
void updateMetaData (const QByteArray &id, const QString &value)

Static Private Member Functions

static QMailMessage fromRfc2822 (LongString &ls)


class QMailStore
class QMailStorePrivate

Detailed Description

The QMailMessage class provides a convenient interface for working with messages.

QMailMessage supports a number of types. These include telephony types such as SMS and MMS, and Internet email messages as defined in {http://www.ietf.org/rfc/rfc2822.txt} {RFC 2822} (Internet Message Format), and {http://www.ietf.org/rfc/rfc2045.txt} {RFC 2045} (Format of Internet Message Bodies) through {http://www.ietf.org/rfc/rfc2049.txt} {RFC 2049} (Conformance Criteria and Examples).

The most common way to use QMailMessage is to initialize it from raw data using QMailMessage::fromRfc2822().

A QMailMessage can also be constructed piece by piece using functions such as setMessageType(), setFrom(), setTo(), setSubject(), and setBody() or appendPart(). Convenience functions such as from()/setFrom() and date()/setDate() accept and return wrapper types, to simplify the exchange of correctly-formatted data. In some cases, however, it may be simpler for clients to get and set the content of header fields directly, using the headerField() and setHeaderField() functions inherited from QMailMessagePartContainer.

Messages can be added to the QMailStore, or retrieved from the store via their QMailMessageId identifier. The QMailMessage object also provides access to any relevant meta data describing the message, using the functions inherited from QMailMessageMetaData.

A message may be serialized to a QDataStream, or returned as a QByteArray using toRfc2822().

See also:
QMailMessageMetaData, QMailMessagePart, QMailMessageBody, QMailStore, QMailMessageId

Definition at line 695 of file qmailmessage.h.

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index