Message

Since: BlackBerry 10.0.0

#include <bb/pim/message/Message>

To link against this class, add the following line to your .pro file: LIBS += -lbbpim

The Message class represents information about a message, such as subject, sender and recipient contacts, and status.

This class represents data that's commonly associated with a message. You can manipulate Message objects by using the MessageService class. For example, you can retrieve a specific message in the messages database by calling MessageService::message() and specifying the account ID and message ID of the message you want. Or, you can retrieve a list of messages that fit a set of criteria by calling MessageService::messages().

You can use the Message class to create a new message in your app and populate it with information. You can then send the message by calling MessageService::send().

See also:

MessageService


Overview

Public Functions Index

Message ()
Message (const Message &other)
Message (MessagePrivate *messagePrivate)
~Message ()
bb::pim::account::AccountKeyaccountId () const
voidapply (MessageUpdate data)
AttachmentattachmentAt (int index) const
intattachmentCount () const
QList< Attachment >attachments () const
MessageBodybody (MessageBody::Type) const
MessageClass::TypeclassType () const
ConversationKeyconversationId () const
QDateTimedeviceTimestamp () const
QStringerrorDetails () const
MessageFolderKeyfolderId () const
MessageFlagfollowupFlag () const
boolhasAttachments () const
MessageKeyid () const
QStringimagePath () const
boolisDraft () const
boolisFiled () const
boolisFlagged () const
boolisHidden () const
boolisInbound () const
boolisLevelOneAlert () const
boolisPriorityInbox () const
boolisSent () const
boolisValid () const
MessageRightsmessageRights () const
QStringmimeType () const
QStringnotificationGroup () const
Message &operator= (const Message &other)
MessageKeyorigMessageId () const
MessagePriority::Typepriority () const
MessageContactrecipientAt (int index) const
intrecipientCount () const
QList< MessageContact >recipients () const
QStringreferencesSyncId () const
MessageReplyState::TypereplyState () const
QDateTimereplyStateTimestamp () const
MessageContactreplyTo () const
MessageContactsender () const
QDateTimeserverTimestamp () const
QStringsourceId () const
MessageStatus::Typesstatus () const
QList< StatusReport >statusReports () const
QStringsubject () const
qint64totalAttachmentSize () const
longtransmissionStatus () const

Public Functions

Message ()

Constructs an empty Message.

Since:

BlackBerry 10.0.0

Message (

Copy constructor.

This function constructs a Message containing exactly the same values as the provided Message.

Parameters
other

The Message to be copied.

Since:

BlackBerry 10.0.0

Message (
  • MessagePrivate *messagePrivate)

Constructs a Message with the provided private message information.

This constructor creates a Message by using a d_ptr to private message information.

Parameters
messagePrivate

The private message information to use.

Since:

BlackBerry 10.0.0

~Message ()

Destructor.

Since:

BlackBerry 10.0.0

bb::pim::account::AccountKey accountId ()

Retrieves the account ID of this Message.

This ID indicates the account that this message belongs to.

Return:

The account ID as a qint64 value.

Since:

BlackBerry 10.0.0

void apply (

Applies the specified update to this Message.

You can use this function to keep the copy of a message in your app current with any service-side updates. After you retrieve the message from the message service, you should listen for any updates to the message (for example, by using the MessageService::messageUpdated() signal). If any change in message state occurs, you should apply the corresponding message update to your app's copy of the message using this function.

Parameters
data

The message update to apply.

Since:

BlackBerry 10.0.0

Attachment attachmentAt (
  • intindex)

Retrieves the attachment at the provided index in the attachment list of this Message.

Parameters
index

The index of the attachment to retrieve.

Return:

The attachment at the provided index.

Since:

BlackBerry 10.0.0

int attachmentCount ()

Retrieves the number of attachments for this Message.

You can use this information to determine how to display message attachments in your app (for example, in a message view).

Return:

The number of attachments.

Since:

BlackBerry 10.0.0

QList< Attachment > attachments ()

Retrieves the list of attachments of this Message.

This function returns the list of attachments as a QList of Attachment objects. You can use this information to download or view attachments of the message. You can choose to load the actual content of the attachment lazily when Attachment::data() is called

Return:

The list of attachments.

Since:

BlackBerry 10.0.0

MessageBody body (

Retrieves the body of this Message.

This function returns the body as a MessageBody. You can use this information to display the contents of the message. You can choose to load the actual content of the body lazily when MessageBody::data() is called.

Parameters
type

The type of message body to return (either plain text or HTML).

Return:

The body of the message.

Since:

BlackBerry 10.0.0

MessageClass::Type classType ()

Retrieves the class type of this Message.

This function returns the class type as a value in the MessageClass::Type enumeration. You can use this information to determine if the message is of a specific class type (for example, a meeting invitation).

Return:

The class type.

Since:

BlackBerry 10.0.0

ConversationKey conversationId ()

Retrieves the conversation ID of this Message.

This ID indicates the Conversation that this message belongs to. This ID is unique per account.

Return:

The conversation ID as a QString.

Since:

BlackBerry 10.0.0

QDateTime deviceTimestamp ()

Retrieves the device timestamp of this Message.

This function returns the time that the message data was created on the device.

Return:

The device timestamp.

Since:

BlackBerry 10.0.0

QString errorDetails ()

Retrieves the error details that are associated with this Message.

This function returns error details that are associated with the message when the message transmission fails. You can use this information to determine what type of error occurred and handle it appropriately.

Return:

The error details.

Since:

BlackBerry 10.0.0

MessageFolderKey folderId ()

Retrieves the folder ID of this Message.

This ID indicates the folder that this message belongs to. This ID is unique per account.

Return:

The folder ID as a qint64 value.

Since:

BlackBerry 10.0.0

MessageFlag followupFlag ()

Retrieves the follow-up flag for this Message.

Return:

The follow-up flag.

Since:

BlackBerry 10.0.0

bool hasAttachments ()

Indicates whether this Message has attachments.

You can use this function to determine if a list of messages returned by the MessageService has attachments. To retrieve the full list of attachments for a specific message, you can call MessageService::message().

Return:

true if the message has attachments, false otherwise.

Since:

BlackBerry 10.0.0

MessageKey id ()

Retrieves the message ID of this Message.

You can use this ID to retrieve a specific Message using the MessageService. This ID is unique per account.

Return:

The message ID as a qint64 value.

Since:

BlackBerry 10.0.0

QString imagePath ()

Retrieves the path of an image representing this Message.

This function returns the image path that can be used to display an image with this message.

Return:

The path of an image representing this Message, an empty string if there isn't one.

Since:

BlackBerry 10.2.0

bool isDraft ()

Indicates whether this Message is a draft message.

You can use this information to determine the actions that can be applied to the message.

Return:

true if the message is a draft message, false otherwise.

Since:

BlackBerry 10.0.0

bool isFiled ()

Indicates whether this Message is filed.

Return:

true if the message is filed, false otherwise.

Since:

BlackBerry 10.0.0

bool isFlagged ()

Indicates whether this Message is flagged.

Return:

true if the message is flagged, false otherwise.

Since:

BlackBerry 10.0.0

bool isHidden ()

Indicates whether this Message has the hidden flag set.

Return:

True if this Message is hidden, false otherwise.

Since:

BlackBerry 10.3.0

bool isInbound ()

Indicates whether this Message is an inbound message.

You can use this information to determine the actions that can be applied to the message (such as Reply).

Return:

true if the message is an inbound message, false otherwise.

Since:

BlackBerry 10.0.0

bool isLevelOneAlert ()

Indicates whether this Message is flagged as a level one alert.

You can use this function to determine whether or not a message that's returned from the message service is flagged as level one alert.

Return:

True if this Message is flagged as a level one alert, false otherwise.

Since:

BlackBerry 10.3.0

bool isPriorityInbox ()

Indicates whether this Message should be in the priority inbox.

You can use this function to determine whether or not a message that's returned from the message service should be in the priority inbox.

Return:

true if this Message should be in the priority inbox, false otherwise.

Since:

BlackBerry 10.2.0

bool isSent ()

Indicates whether this Message has been sent successfully.

Return:

true if the message has been sent successfully, false otherwise.

Since:

BlackBerry 10.0.0

bool isValid ()

Indicates whether this Message is valid.

You can use this function to determine whether a message that's returned from the message service is valid. A message that doesn't have an ID is considered invalid.

Return:

true if this Message is valid, false otherwise.

Since:

BlackBerry 10.0.0

MessageRights messageRights ()

Retrieves the message rights of this Message.

This function returns the message permissions or rights as a MessageRights

Return:

The message rights object.

Since:

BlackBerry 10.3.0

QString mimeType ()

Retrieves the MIME type of this Message.

Return:

The MIME type.

Since:

BlackBerry 10.0.0

QString notificationGroup ()

Retrieves the customized group notification setting of this Message.

This function returns the user notification setting information for messages belonging to a group. This is used to customize notification settings for each group of a given account.

Return:

The group notification information if this Message belongs to a group and has a user setting; an empty string otherwise.

Since:

BlackBerry 10.2.0

Message & operator= (

Assignment operator.

This operator copies all values from the provided Message into this Message.

Parameters
other

The Message from which to copy all values.

Return:

A Message with all copied data.

Since:

BlackBerry 10.0.0

MessageKey origMessageId ()

Retrieves the original message ID of this Message.

This function returns the ID of the message (as a MessageKey) that is referenced by this Message object. You can use this ID to refer to the original message that is being replied to.

Return:

The original message ID.

Since:

BlackBerry 10.0.0

MessagePriority::Type priority ()

Retrieves the priority of this Message.

The priority of a message is represented by the MessagePriority::Type enumeration and includes values such as Low and High.

Return:

The message priority.

Since:

BlackBerry 10.0.0

MessageContact recipientAt (
  • intindex)

Retrieves the recipient at the provided index in the recipient list of this Message.

Parameters
index

The index of the recipient to retrieve.

Return:

The recipient at the provided index.

Since:

BlackBerry 10.0.0

int recipientCount ()

Retrieves the number of recipients in the recipient list for this Message.

You can use this information to determine how to display message recipients in your app (for example, in a message view).

Return:

The number of recipients.

Since:

BlackBerry 10.0.0

QList< MessageContact > recipients ()

Retrieves the list of recipients of this Message.

This function returns the list of recipients as a QList of MessageContact objects. You can use this information to implement a "Reply All" action for the message.

Return:

The list of recipients.

Since:

BlackBerry 10.0.0

QString referencesSyncId ()

Retrieves the references sync ID that's associated with this Message.

You can use this information to create a smart reply for the message.

Return:

The references sync ID.

Since:

BlackBerry 10.0.0

MessageReplyState::Type replyState ()

Retrieves the reply state of this Message.

The reply state of a message is represented by the MessageReplyState::Type enumeration and includes values such as Replied and Forwarded.

Return:

The message reply state.

Since:

BlackBerry 10.2.0

QDateTime replyStateTimestamp ()

Retrieves the reply state timestamp of this Message.

The reply state timestamp indicates when the message was last replied to or forwarded.

Return:

The message reply state timestamp.

Since:

BlackBerry 10.2.0

MessageContact replyTo ()

Retrieves the reply-to contact of this Message.

Return:

The reply-to contact.

Since:

BlackBerry 10.0.0

MessageContact sender ()

Retrieves the sender of this Message.

This function returns the sender as a MessageContact. You can use this information to reply to the message.

Return:

The sender of the message.

Since:

BlackBerry 10.0.0

QDateTime serverTimestamp ()

Retrieves the server timestamp of this Message.

This function returns the time the message data was sent to the server. This value is not valid for outbound messages.

Return:

The server timestamp.

Since:

BlackBerry 10.0.0

QString sourceId ()

Retrieves the source ID of this Message.

This ID is a unique ID that might be provided by the server (for example, an email server).

Return:

The source ID.

Since:

BlackBerry 10.0.0

MessageStatus::Types status ()

Retrieves the status of this Message.

The status of a message is represented by the MessageStatus::Type enumeration and includes values such as Read and Draft. The status can be a bit flag that represents multiple statuses.

Return:

The message status.

Since:

BlackBerry 10.0.0

QList< StatusReport > statusReports ()

Retrieves the list of status reports for this Message.

This function returns the list of status reports as a QList of StatusReport objects. You can use this information to check the delivery status for each recipient of the message.

Return:

The list of status reports.

Since:

BlackBerry 10.0.0

QString subject ()

Retrieves the subject of this Message.

Return:

The message subject.

Since:

BlackBerry 10.0.0

qint64 totalAttachmentSize ()

Retrieves the size, in bytes, of all attachments for this Message.

This function returns the total size, in bytes, of all attachments. If attachments have not yet been downloaded for this message then this will be the estimated attachment size from the server.

Return:

The total size, in bytes, of all attachments for this Message, 0 if there are no attachments.

Since:

BlackBerry 10.3.0

long transmissionStatus ()

Retrieves the transmission status of this Message.

The transmission status of a message is represented by the MessageTransmissionStatus::Type enumeration and includes values such as Pending and Sent. The transmission status can be a bit flag that represents multiple statuses.

Return:

The message transmission status.

Since:

BlackBerry 10.0.0

Last modified: 2014-06-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus