MessageBody

Since: BlackBerry 10.0.0

#include <bb/pim/message/MessageBody>

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

The MessageBody class represents the body of a message.

A Message typically has a body that includes the actual contents of the message. You can use this class to retrieve information about the message body, such as type (plain text or HTML), available length, and data. You can retrieve a Message by calling MessageService::message() and then retrieve the body of that message by calling Message::body().


Overview

Public Types Index

enum Type

PlainText =0, Html = 1

Public Functions Index

MessageBody ()
MessageBody (const MessageBody &other)
MessageBody (MessageBodyPrivate *messageBodyPrivate)
~MessageBody ()
intavailableLength () const
QStringcontentType () const
QByteArraydata ()
QStringfileName () const
boolisPartial () const
boolisValid () const
MessageBody &operator= (const MessageBody &other)
QStringplainText ()
MessageBody::Typetype () const

Public Types

Type

An enumeration of the supported types of body text.

You can use this information to retrieve plain text or HTML body text from a message.

Since:

BlackBerry 10.0.0

PlainText =0

Indicates that the body is plain text.

Html = 1

Indicates that the body is HTML.

Since:

BlackBerry 10.0.0

Public Functions

MessageBody ()

Constructs a new MessageBody.

Since:

BlackBerry 10.0.0

MessageBody (

Copy constructor.

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

Parameters
other

The MessageBody to be copied.

Since:

BlackBerry 10.0.0

MessageBody (
  • MessageBodyPrivate *messageBodyPrivate)

Constructs a MessageBody with the provided private message body information.

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

Parameters
messageBodyPrivate

The private message body information to use.

Since:

BlackBerry 10.0.0

~MessageBody ()

Destructor.

Since:

BlackBerry 10.0.0

int availableLength ()

Retrieves the available length of this MessageBody.

Return:

The available length.

Since:

BlackBerry 10.0.0

QString contentType ()

Retrieves the full content type of this MessageBody.

This function returns the full content type of the message body (for example, "text/html; charset=utf-8").

Return:

The full content type.

Since:

BlackBerry 10.0.0

QByteArray data ()

Retrieves the content of this MessageBody.

This content is typically loaded lazily when this function is called.

Return:

The message body content.

Since:

BlackBerry 10.0.0

QString fileName ()

Retrieves the absolute file name of this MessageBody.

Return:

The absolute file name.

Since:

BlackBerry 10.0.0

bool isPartial ()

Indicates whether this MessageBody is partially downloaded.

Return:

true if the message body only partially downloaded, false otherwise.

Since:

BlackBerry 10.0.0

bool isValid ()

Indicates whether this MessageBody is valid.

Return:

true if this MessageBody is valid, false otherwise.

Since:

BlackBerry 10.0.0

MessageBody & operator= (

Assignment operator.

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

Parameters
other

The MessageBody from which to copy all values.

Return:

A MessageBody with all copied data.

Since:

BlackBerry 10.0.0

QString plainText ()

Retrieves the content of this MessageBody in plain text.

This function always returns the plain text version of the content.

Return:

The content in plain text.

Since:

BlackBerry 10.0.0

MessageBody::Type type ()

Retrieves the type of this MessageBody.

This function returns the type as a MessageBody object and includes values such as "plain text" or "HTML". You can use this information to render the body content in your app.

Return:

The message body type.

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