MessageContact

Since: BlackBerry 10.0.0

#include <bb/pim/message/MessageContact>

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

The MessageContact class represents a recipient or sender of a message.

This class includes information about recipients and senders of messages, such as type ("To", "Cc", and so on), name, and email address. You can create MessageContact objects and add them to Message objects as recipients or senders.

You can use the MessageService class to retrieve a specific message or list of messages. Then, you can retrieve the list of recipients by calling Message::recipients(), or retrieve the sender by calling Message::sender().


Overview

Public Types Index

enum Type

To, Cc 1, Bcc 2, From 3, ReplyTo 4

Public Functions Index

MessageContact ()
MessageContact (MessageContactPrivate *messageContactPrivate)
MessageContact (MessageContactKey id, MessageContact::Type type, const QString &name, const QString &address, unsigned char ton=0, unsigned char npi=0)
MessageContact (const MessageContact &other)
~MessageContact ()
QStringaddress () const
QStringdisplayableName () const
MessageContactKeyid () const
boolisValid () const
QStringname () const
unsigned charnpi () const
MessageContact &operator= (const MessageContact &other)
booloperator== (const MessageContact &other) const
unsigned charton () const
MessageContact::Typetype () const

Public Types

Type

An enumeration of supported message contact types.

Since:

BlackBerry 10.0.0

To

Indicates that the message contact is listed in the To field.

Cc 1

Indicates that the message contact is listed in the Cc field.

Since:

BlackBerry 10.0.0

Bcc 2

Indicates that the message contact is listed in the Bcc field.

Since:

BlackBerry 10.0.0

From 3

Indicates that the message contact is listed in the From field.

Since:

BlackBerry 10.0.0

ReplyTo 4

Indicates that the message contact is listed in the ReplyTo field.

Since:

BlackBerry 10.0.0

Public Functions

MessageContact ()

Constructs a new MessageContact.

Since:

BlackBerry 10.0.0

MessageContact (
  • MessageContactPrivate *messageContactPrivate)

Constructs a MessageContact with the provided private message contact information.

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

Parameters
messageContactPrivate

The private message contact information to use.

Since:

BlackBerry 10.0.0

MessageContact (

Constructs a MessageContact with the provided type, name, and email address.

Parameters
id

The ID of the message contact to construct.

type

The type of contact to construct (for example, "To", "Cc", and so on).

name

The name of the contact.

address

The email address of the contact.

ton

The type of network. This parameter is optional, and is used only for alphanumeric addresses in SMS.

npi

The numbering plan identification. This parameter is optional, and is used only for alphanumeric addresses in SMS.

Since:

BlackBerry 10.0.0

MessageContact (

Copy constructor.

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

Parameters
other

The MessageContact to be copied.

Since:

BlackBerry 10.0.0

~MessageContact ()

Destructor.

Since:

BlackBerry 10.0.0

QString address ()

Retrieves the email address of this MessageContact.

This function returns the actual email address that's provided by the service.

Return:

The message contact's email address.

Since:

BlackBerry 10.0.0

QString displayableName ()

Retrieves the displayable name of this MessageContact.

This function returns the displayable name value, which includes the contact name, friendly name, and email address (in that order).

Return:

The message contact's displayable name.

Since:

BlackBerry 10.0.0

MessageContactKey id ()

Retrieves the ID of this MessageContact.

Return:

The message contact's ID.

Since:

BlackBerry 10.0.0

bool isValid ()

Indicates whether this MessageContact is valid.

Return:

true if this MessageContact is valid, false otherwise.

Since:

BlackBerry 10.0.0

QString name ()

Retrieves the name of this MessageContact.

This function returns the display name that's provided by the service.

Return:

The message contact's name.

Since:

BlackBerry 10.0.0

unsigned char npi ()

Retrieves the numbering plan identification of this MessageContact.

This function returns the numbering plan identification (NPI). This value is used only for alphanumeric addresses in SMS.

Return:

The numbering plan identification.

Since:

BlackBerry 10.0.0

MessageContact & operator= (

Assignment operator.

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

Parameters
other

The MessageContact from which to copy all values.

Return:

A MessageContact with all copied data.

Since:

BlackBerry 10.0.0

bool operator== (

Equality operator.

This operator indicates whether this MessageContact has the same values as the provided MessageContact.

Parameters
other

The MessageContact to compare values with.

Return:

true if the MessageContact objects are considered equal, false otherwise.

Since:

BlackBerry 10.0.0

unsigned char ton ()

Retrieves the type of network of this MessageContact.

This function returns the type of the network (TON). This value is used only for alphanumeric addresses in SMS.

Return:

The type of network.

Since:

BlackBerry 10.0.0

MessageContact::Type type ()

Retrieves the type of this MessageContact.

This function returns the type as an enumeration value in the MessageContact::Type enumeration, and includes values such as "To" and "Cc".

Return:

The message contact's type.

Since:

BlackBerry 10.0.0

Last modified: 2014-09-30



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

comments powered by Disqus