ConversationBuilder

Since: BlackBerry 10.0.0

#include <bb/pim/message/ConversationBuilder>

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

The ConversationBuilder class lets you create, and specify properties for, a new Conversation.

You can use this class to set properties, such as latest message ID, subject, and participant list, for a Conversation. This class uses the builder pattern to create a Conversation and set its properties. Each of the setter functions returns a self reference to the builder, allowing you to chain function calls together.

See also:

Conversation


Overview

Public Functions Index

~ConversationBuilder ()
bb::pim::account::AccountKeyaccountId () const
ConversationBuilder &accountId (bb::pim::account::AccountKey accountId)
ConversationKeyconversationId () const
ConversationBuilder &conversationId (ConversationKey conversationId)
QList< FolderKey >folderIds () const
ConversationBuilder &folderIds (const QList< FolderKey > &folderIds)
MessageKeylatestMessageId () const
ConversationBuilder &latestMessageId (MessageKey latestMessageId)
intmessageCount () const
ConversationBuilder &messageCount (int messageCount)
QStringname () const
ConversationBuilder &name (const QString &name)
operator Conversation ()
QList< MessageContact >participants () const
ConversationBuilder &participants (QList< MessageContact > participants)
ConversationStatus::Typesstatus () const
ConversationBuilder &status (ConversationStatus::Types status)
QStringsubject () const
ConversationBuilder &subject (const QString &subject)
QStringsummary () const
ConversationBuilder &summary (const QString &summary)
QDateTimetimeStamp () const
ConversationBuilder &timeStamp (QDateTime timeStamp)
longtransmissionStatus () const
ConversationBuilder &transmissionStatus (long status)
QStringtype () const
intunreadMessageCount () const
ConversationBuilder &unreadMessageCount (int unreadMessageCount)

Static Public Functions Index

ConversationBuilder *create ()
ConversationBuilder *create (const Conversation &conversation)

Public Functions

~ConversationBuilder ()

Destructor.

Since:

BlackBerry 10.0.0

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

Retrieves the account ID of the Conversation that this ConversationBuilder represents.

You can use this ID to determine which account the conversation belongs to.

Return:

The conversation's account ID.

Since:

BlackBerry 10.0.0

ConversationBuilder & accountId (
  • bb::pim::account::AccountKeyaccountId)

Sets the account ID of the conversation.

Parameters
accountId

The conversation's account ID.

Return:

A ConversationBuilder with the provided account ID.

Since:

BlackBerry 10.0.0

ConversationKey conversationId ()

Retrieves the ID of the Conversation that this ConversationBuilder represents.

This ID is unique per account.

Return:

The conversation's ID.

Since:

BlackBerry 10.0.0

ConversationBuilder & conversationId (

Sets the ID of the conversation.

Parameters
conversationId

The conversation's ID.

Return:

A ConversationBuilder with the provided conversation ID.

Since:

BlackBerry 10.0.0

QList< FolderKey > folderIds ()

Retrieves the list of folder IDs for the Conversation that this ConversationBuilder represents.

The folder IDs are based on the folder ID of each message in the conversation (in no particular order).

For example, consider a conversation that consists of messages from the following folders:
  • inbox

  • inbox

  • sent

  • inbox

In this case, this function returns a QList with two folder IDs: inbox and sent.

Return:

The conversation's folder IDs.

Since:

BlackBerry 10.0.0

ConversationBuilder & folderIds (
  • const QList< FolderKey > &folderIds)

Sets the folder ID list of the conversation.

Parameters
folderIds

The list of folder IDs.

Return:

A ConversationBuilder with the provided folder ID list.

Since:

BlackBerry 10.0.0

MessageKey latestMessageId ()

Retrieves the ID of the most recent message in the Conversation that this ConversationBuilder represents.

Return:

The ID of the most recent message in the conversation.

Since:

BlackBerry 10.0.0

ConversationBuilder & latestMessageId (
  • MessageKeylatestMessageId)

Sets the ID of the most recent message in the conversation.

Parameters
latestMessageId

The ID of the most recent message in the conversation.

Return:

A ConversationBuilder with the provided ID of the most recent message.

Since:

BlackBerry 10.0.0

int messageCount ()

Retrieves the number of messages in the Conversation that this ConversationBuilder represents.

Return:

The number of messages in the conversation.

Since:

BlackBerry 10.0.0

ConversationBuilder & messageCount (
  • intmessageCount)

Sets the number of messages in the conversation.

Parameters
messageCount

The number of messages in the conversation.

Return:

A ConversationBuilder with the provided number of messages.

Since:

BlackBerry 10.0.0

QString name ()

Retrieves the name of the Conversation that this ConversationBuilder represents.

Return:

The conversation's name.

Since:

BlackBerry 10.0.0

ConversationBuilder & name (

Sets the name of the conversation.

Parameters
name

The conversation's name.

Return:

A ConversationBuilder with the provided name.

Since:

BlackBerry 10.0.0

operator Conversation ()

Cast operator.

This operator casts an object to the Conversation type.

Since:

BlackBerry 10.0.0

QList< MessageContact > participants ()

Retrieves a list of the participants in the Conversation that this ConversationBuilder represents.

Return:

A list of the conversation's participants.

Since:

BlackBerry 10.0.0

ConversationBuilder & participants (

Sets the participants of the conversation.

Parameters
participants

The conversation's participants.

Return:

A ConversationBuilder with the provided participants.

Since:

BlackBerry 10.0.0

ConversationStatus::Types status ()

Retrieves a bitmask representing the status of the Conversation that this ConversationBuilder represents.

The ConversationStatus class includes the possible flags for the status of a conversation.

Return:

A bitmask representing the status of the conversation.

Since:

BlackBerry 10.0.0

ConversationBuilder & status (
  • ConversationStatus::Typesstatus)

Sets the status of the conversation.

See ConversationStatus for a list of possible flags.

Parameters
status

The conversation's status.

Return:

A ConversationBuilder with the provided status.

Since:

BlackBerry 10.0.0

QString subject ()

Retrieves the subject of the Conversation that this ConversationBuilder represents.

Return:

The conversation's subject.

Since:

BlackBerry 10.0.0

ConversationBuilder & subject (

Sets the subject of the conversation.

Parameters
subject

The conversation's subject.

Return:

A ConversationBuilder with the provided subject.

Since:

BlackBerry 10.0.0

QString summary ()

Retrieves the summary of the Conversation that this ConversationBuilder represents.

Return:

The conversation's summary.

Since:

BlackBerry 10.0.0

ConversationBuilder & summary (

Sets the summary of the conversation.

Parameters
summary

The conversation's summary.

Return:

A ConversationBuilder with the provided summary.

Since:

BlackBerry 10.0.0

QDateTime timeStamp ()

Retrieves the timestamp of the Conversation that this ConversationBuilder represents.

Return:

The conversation's timestamp.

Since:

BlackBerry 10.0.0

ConversationBuilder & timeStamp (

Sets the timestamp of the conversation.

Parameters
timeStamp

The conversation's timestamp.

Return:

A ConversationBuilder with the provided timestamp.

Since:

BlackBerry 10.0.0

long transmissionStatus ()

Retrieves the raw transmission status of the Conversation that this ConversationBuilder represents.

Note that this is the status of the latest message in the conversation, coming from the data store.

Return:

The conversation's raw transmission status.

Since:

BlackBerry 10.0.0

ConversationBuilder & transmissionStatus (
  • longstatus)

Sets the raw transmission status of the most recent message in the conversation.

Parameters
status

The status of the most recent message in the conversation.

Return:

A ConversationBuilder with the provided status of the most recent message.

Since:

BlackBerry 10.0.0

QString type ()

Returns the type of the Conversation that this ConversationBuilder represents.

Return:

The conversation's type.

Since:

BlackBerry 10.0.0

int unreadMessageCount ()

Retrieves the number of unread messages in the Conversation that this ConversationBuilder represents.

Return:

The number of unread messages in the conversation.

Since:

BlackBerry 10.0.0

ConversationBuilder & unreadMessageCount (
  • intunreadMessageCount)

Sets the number of unread messages in the conversation.

Parameters
unreadMessageCount

The number of unread messages in the conversation.

Return:

A ConversationBuilder with the provided number of unread messages.

Since:

BlackBerry 10.0.0

Static Public Functions

ConversationBuilder * create ()

Creates a new ConversationBuilder.

Return:

A ConversationBuilder object.

Since:

BlackBerry 10.0.0

ConversationBuilder * create (

Creates a new ConversationBuilder using the provided ConversationBuilder.

Return:

A ConversationBuilder object that contains the same values as the provided ConversationBuilder.

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