MessageFilter

Since: BlackBerry 10.0.0

#include <bb/pim/message/MessageFilter>

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

The MessageFilter class lets you filter lists of messages based on key-value pairs.

You can use this class to specify a set of criteria for messages, and then apply those criteria when you retrieve messages using the MessageService. For example, you can specify that you want to retrieve a list of messages in ascending order, with a particular set of participants and a maximum of 20 results. Then, you can call MessageService::messages() and provide the filter as a parameter to retrieve the messages.

See also:

MessageService


Overview

Public Functions Index

MessageFilter ()
~MessageFilter ()
boolcontains (const QString &key) const
voidinsert (const QString &key, const QVariant &value)
const QVariantvalue (const QString &key) const

Public Static Attributes

const QString AnchorId ()

Represents the anchor ID key.

Since:

BlackBerry 10.0.0

const QString Ascending ()

Represents the ascending key.

This key specifies whether the list of messages returned is in ascending order. This key is valid for use with SMS/MMS accounts.

Since:

BlackBerry 10.0.0

const QString Broadcast ()

Represents the broadcast key.

This key filters the list of messages based on whether the messages have been broadcasted. This key is valid for use with SMS/MMS accounts.

Since:

BlackBerry 10.0.0

const QString ContactId ()

Represents the contact ID key.

This key filters the list of messages based on the contact ID of the message contact for each message. This key is valid for use with SMS/MMS accounts.

Since:

BlackBerry 10.0.0

const QString ConversationId ()

Represents the conversation ID key.

This key filters the list of messages based on the conversation that each message belongs to. This key is valid for use for SMS/MMS accounts.

Since:

BlackBerry 10.0.0

const QString MessageId ()

Represents the message ID key.

This key filters the list of messages based on the message ID of each message. This key is valid for non-SMS/MMS accounts that are part of the core PIM APIs.

Since:

BlackBerry 10.0.0

const QString MessagesWithIds ()

Represents the messages with IDs key.

This key filters the list of messages based on the list of message IDs. This key is valid for non-SMS/MMS accounts that are part of the core PIM APIs.

Since:

BlackBerry 10.0.0

const QString Offset ()

Represents the offset key.

This key filters the list of messages based on an offset value. This key is valid for use with SMS/MMS accounts.

Since:

BlackBerry 10.0.0

const QString Participants ()

Represents the participants key.

This key filters the list of messages based on the participants. This key is valid for use with SMS/MMS accounts.

Since:

BlackBerry 10.0.0

const QString Quantity ()

Represents the quantity key.

You can use this key to limit the number of messages or conversations that are returned from the MessageService.

Since:

BlackBerry 10.0.0

const QString TransmissionStatus ()

Represents the transmission status key.

This key filters the list of messages based on their transmission statuses. This key is valid for use with SMS/MMS accounts.

Since:

BlackBerry 10.0.0

Public Functions

MessageFilter ()

Constructs a new MessageFilter.

Since:

BlackBerry 10.0.0

~MessageFilter ()

Destructor.

Since:

BlackBerry 10.0.0

bool contains (

Indicates whether this MessageFilter has a value for the provided key.

The provided key should be one of the constants defined in this class (such as MessageFilter::AnchorId, MessageFilter::Quantity, and so on).

Parameters
key

The key to search for.

Return:

true if this MessageFilter has a value for the provided key, false otherwise.

Since:

BlackBerry 10.0.0

void insert (

Inserts a filter criterion with the provided key and value.

The provided key should be one of the constants defined in this class (such as MessageFilter::AnchorId, MessageFilter::Quantity, and so on). The provided value should be a QVariant that wraps the desired value for the key. For example, the value for the Quantity key could be set as QVariant("10").

Parameters
key

The key to set the value for.

value

The value to set for the key.

Since:

BlackBerry 10.0.0

const QVariant value (

Retrieves the value of the provided key.

The provided key should be one of the constants defined in this class (such as MessageFilter::AnchorId, MessageFilter::Quantity, and so on). The returned value is a QVariant that wraps the value that's associated with the provided key.

Parameters
key

The key to search for.

Return:

The value of the provided key.

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