AttachmentFilter

Since: BlackBerry 10.0.2

#include <bb/pim/message/AttachmentFilter>

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

The AttachmentFilter class lets you filter lists of attachments based on key-value pairs.

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

See also:

MessageService


Overview

Public Static Attributes Index

const char *AnchorAccountId
const char *AnchorAttachmentId
const char *Ascending
const char *Order
const char *Quantity
const char *SearchValue

Public Functions Index

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

Public Static Attributes

const char * AnchorAccountId ()

Represents the attachment anchor ID's corresponding account ID.

This key is the account ID of the attachment anchor ID.

Since:

BlackBerry 10.0.2

const char * AnchorAttachmentId ()

Represents the attachment anchor ID key.

The attachment anchor ID works as a marker ID (Attachment.id()) from which a set of attachments are returned from the MessageService. You can use this key to retrieve lists of attachments in chunks.

Since:

BlackBerry 10.0.2

const char * Ascending ()

Represents the ascending key.

This key specifies whether the list of attachments returned is in ascending order.

Since:

BlackBerry 10.0.2

const char * Order ()

Specifies the sort order of the attachments list.

This value specifies the order by which the list of attachments are to be sorted. Valid values are "date", "sender", "name" or "type". If not specified, the order will be by "date"

Since:

BlackBerry 10.0.2

const char * Quantity ()

Represents the quantity key.

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

Since:

BlackBerry 10.0.2

const char * SearchValue ()

Represents the search value for attachment names.

This search value filters the list of attachments based on whether the attachment name begins with ( or contains ) the search value.

Since:

BlackBerry 10.0.2

Public Functions

AttachmentFilter ()

Constructs a new AttachmentFilter.

Since:

BlackBerry 10.0.2

~AttachmentFilter ()

Destructor.

Since:

BlackBerry 10.0.2

bool contains (

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

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

Parameters
key

The key to search for.

Return:

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

Since:

BlackBerry 10.0.2

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 AttachmentFilter::AnchorAttachmentId, AttachmentFilter::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.2

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 AttachmentFilter::AnchorAttachmentId, AttachmentFilter::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.2

Last modified: 2014-03-13

comments powered by Disqus