NotebookEntryFilter

#include <bb/pim/notebook/NotebookEntryFilter>

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

The NotebookEntryFilter class represents a filter that can be used to search and count notebook entries.

A NotebookEntryFilter is used to retrieve lists or counts of NotebookEntry objects that match certain criteria, which are specified using setter functions. Filter criteria are cumulative; a NotebookEntry must match all criteria set on the filter in order to be accepted by the filter.

A NotebookEntryFilter can also be used to test if individual NotebookEntry objects should be accepted. This can be useful if a list of NotebookEntry objects has already been retrieved and a subset based on particular criteria is required.

Example usage:
// Here's how to create a filter for retrieving NotebookEntry objects in the default Notebook.
// Note that service objects are potentially expensive to initialize, so you should not create
// them on a per-use basis as is done below.
NotebookService service;
Notebook defaultNotebook = service.defaultNotebook();
NotebookEntryFilter filter;
filter.setParentNotebookId( defaultNotebook.id() );
QList<NotebookEntry> entries = service.notebookEntries( filter );
Since:

BlackBerry 10.0.0

Public Functions Index

NotebookEntryFilter ()
NotebookEntryFilter (const NotebookEntryFilter &other)
~NotebookEntryFilter ()
NotebookEntryFilter &operator= (const NotebookEntryFilter &other)
booloperator== (const NotebookEntryFilter &other) const
booloperator!= (const NotebookEntryFilter &other) const
boolaccepts (const NotebookEntry &entry) const
voidsetDueDateTime (NotebookEntryDueDate::Type type, const QDateTime &dueDateTime1=QDateTime())
voidsetDueDateTime (NotebookEntryDueDate::Type type, const QDateTime &dueDateTime1, const QDateTime &dueDateTime2)
voidresetDueDateTime ()
QDateTimedueDateTime () const
QDateTimedueAfterDateTime () const
NotebookEntryDueDate::TypedueDateTimeType () const
boolhasDueDateTime () const
voidsetParentNotebookId (const NotebookId &parentNotebookId)
voidresetParentNotebookId ()
NotebookIdparentNotebookId () const
boolhasParentNotebookId () const
voidsetSearchString (const QString &searchString, NotebookEntrySearchField::Types searchField=NotebookEntrySearchField::All)
voidresetSearchString ()
QStringsearchString () const
NotebookEntrySearchField::TypessearchField () const
boolhasSearchString () const
voidsetStatus (NotebookEntryStatus::Types status)
voidresetStatus ()
NotebookEntryStatus::Typesstatus () const
boolhasStatus () const
voidsetOffset (unsigned int offset)
voidresetOffset ()
unsigned intoffset () const
voidsetLimit (unsigned int limit)
voidresetLimit ()
unsigned intlimit () const

Public Functions

NotebookEntryFilter ()

Constructs a new NotebookEntryFilter with no criteria set.

A default-constructed filter accepts all NotebookEntry objects.

Since:

BlackBerry 10.0.0

NotebookEntryFilter (

Copy constructor.

This function constructs a NotebookEntryFilter containing exactly the same criteria as the provided NotebookEntryFilter.

Parameters
other

The NotebookEntryFilter to be copied.

Since:

BlackBerry 10.0.0

~NotebookEntryFilter ()

Destructor.

Since:

BlackBerry 10.0.0

NotebookEntryFilter & operator= (

Assignment operator.

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

Parameters
other

The NotebookEntryFilter from which to copy all values.

Return:

A reference to this NotebookEntryFilter.

Since:

BlackBerry 10.0.0

bool operator== (

Equality operator.

This operator determines if this NotebookEntryFilter has the same values as another NotebookEntryFilter. If two NotebookEntryFilter objects are considered equal by this operator, they will both accept the same NotebookEntry objects.

Parameters
other

The NotebookEntryFilter to compare to.

Return:

true if the values are considered equal, false otherwise.

Since:

BlackBerry 10.0.0

bool operator!= (

Inequality operator.

This operator determines if this NotebookEntryFilter has any different values from another NotebookEntryFilter.

Parameters
other

The NotebookEntryFilter to compare to.

Return:

true if any of the values are not considered equal, false otherwise.

Since:

BlackBerry 10.0.0

bool accepts (

Indicates whether the provided NotebookEntry is accepted by this NotebookEntryFilter.

The provided NotebookEntry is accepted if it matches all criteria set on this NotebookEntryFilter.

Parameters
entry

The NotebookEntry to check for acceptance by this NotebookEntryFilter.

Return:

true if the provided NotebookEntry is accepted by this NotebookEntryFilter, false otherwise.

Since:

BlackBerry 10.0.0

void setDueDateTime (

Sets the due date/time criteria for this NotebookEntryFilter.

This is an overloaded function. This function and NotebookEntryFilter::setDueDateTime(NotebookEntryDueDate::Type, const QDateTime &, const QDateTime &) should be thought of conceptually as a single function in which one or both of the QDateTime parameters can be omitted, depending on the value of the type parameter. Any omitted QDateTime parameters are assigned null QDateTime objects by default.

Parameters
type

One of the available due date types to filter on.

dueDateTime1

The "due after" or "due by" date/time criterion for this NotebookEntryFilter, depending on the value of the type parameter.

Since:

BlackBerry 10.0.0

void setDueDateTime (

Sets the due date/time criteria for this NotebookEntryFilter.

Note: The two overloaded versions of this function should be thought of as a single function in which one or both of the QDateTime arguments can be omitted, depending on the value of the type parameter. Any omitted QDateTime parameters are assigned null QDateTime objects by default.

Once set, this NotebookEntryFilter will only accept NotebookEntry objects based on the specified type and QDateTime arguments. The QDateTime objects are interpreted differently, depending on the type parameter, as follows:
  • NotebookEntryDueDate::NotSpecified: Both QDateTime objects are ignored and can be omitted.

  • NotebookEntryDueDate::NoDate: Both QDateTime objects are ignored and can be omitted.

  • NotebookEntryDueDate::AnyDate: Both QDateTime objects are ignored and can be omitted.

  • NotebookEntryDueDate::BySpecificDate: dueDateTime1 is used as the "due by" date/time; dueDateTime2 is ignored and can be omitted. If dueDateTime1 is invalid, then the due date type is set to NotebookEntryDueDate::AnyDate.

  • NotebookEntryDueDate::AfterSpecificDate: dueDateTime1 is used as the "due after" date/time; dueDateTime2 is ignored and can be omitted. If dueDateTime1 is invalid, then the due date type is set to NotebookEntryDueDate::AnyDate.

  • NotebookEntryDueDate::WithinSpecificRange: dueDateTime1 is used as the "due after" date/time; dueDateTime2 is used as the "due by" date/time. In other words, when selecting a range of dates/times, you specify the minimum date/time, followed by the maximum date/time. If either of dueDateTime1 or dueDateTime2 is invalid, then the due date type is set to NotebookEntryDueDate::BySpecificDate or NotebookEntryDueDate::AfterSpecificDate as appropriate; if they are both invalid, then the due date type is set to NotebookEntryDueDate::AnyDate.

Parameters
type

One of the available due date types to filter on.

dueDateTime1

The "due after" or "due by" date/time criterion for this NotebookEntryFilter, depending on the value of the type parameter.

dueDateTime2

The "due by" date/time criterion (only used when type is NotebookEntryDueDate::WithinSpecificRange).

Since:

BlackBerry 10.0.0

void resetDueDateTime ()

Resets the due date/time criteria for this NotebookEntryFilter.

Calling this function prevents this NotebookEntryFilter from rejecting NotebookEntry objects based on due date/time, and is equivalent to invoking setDueDateTime() with NotebookEntryDueDate::NotSpecified.

Since:

BlackBerry 10.0.0

QDateTime dueDateTime ()

Retrieves the "due by" date/time criterion being used by this NotebookEntryFilter.

Return:

The "due by" date/time criterion being used by this NotebookEntryFilter. If the "due by" date/time criterion is not set or has been reset, a null QDateTime is returned.

Since:

BlackBerry 10.0.0

QDateTime dueAfterDateTime ()

Retrieves the "due after" date/time criterion being used by this NotebookEntryFilter.

Return:

The "due after" date/time criterion being used by this NotebookEntryFilter. If the "due after" date/time criterion is not set or has been reset, a null QDateTime is returned.

Since:

BlackBerry 10.0.0

NotebookEntryDueDate::Type dueDateTimeType ()

Retrieves the due date type being used by this NotebookEntryFilter.

Return:

The due date type being used by this NotebookEntryFilter. If the due date criterion is not set or has been reset, NotebookEntryDueDate::NotSpecified is returned.

Since:

BlackBerry 10.0.0

bool hasDueDateTime ()

Determines whether this NotebookEntryFilter is filtering based on due date/time.

Return:

true if this NotebookEntryFilter is filtering based on due date/time, false otherwise.

Since:

BlackBerry 10.0.0

void setParentNotebookId (

Sets the parent notebook ID criterion for this NotebookEntryFilter.

Once set, this NotebookEntryFilter will only accept NotebookEntry objects with a parent notebook ID that is equal to the provided NotebookId. If the provided NotebookId is not valid, then this NotebookEntryFilter does not reject NotebookEntry objects based on parent notebook ID.

Parameters
parentNotebookId

The parent notebook ID criterion for this NotebookEntryFilter.

Since:

BlackBerry 10.0.0

void resetParentNotebookId ()

Resets the parent notebook ID criterion for this NotebookEntryFilter.

Calling this function prevents this NotebookEntryFilter from rejecting NotebookEntry objects based on parent notebook ID, and is equivalent to invoking setParentNotebookId() with an invalid NotebookId.

Since:

BlackBerry 10.0.0

NotebookId parentNotebookId ()

Retrieves the parent notebook ID criterion being used by this NotebookEntryFilter.

Return:

The parent notebook ID criterion being used by this NotebookEntryFilter. If the parent notebook ID criterion is not set or has been reset, an invalid NotebookId is returned.

Since:

BlackBerry 10.0.0

bool hasParentNotebookId ()

Indicates whether this NotebookEntryFilter is filtering based on parent notebook ID.

Return:

true if this NotebookEntryFilter is filtering based on parent notebook ID, false otherwise.

Since:

BlackBerry 10.0.0

void setSearchString (
  • const QString &searchString,
  • NotebookEntrySearchField::TypessearchField )

Sets the search string and search field criteria for this NotebookEntryFilter.

Once set, this NotebookEntryFilter will only accept NotebookEntry objects containing the specified search string within the provided search field or fields. If the provided string is null or empty, then this NotebookEntryFilter does not reject NotebookEntry objects based on search strings.

Parameters
searchString

The search string criterion for this NotebookEntryFilter.

searchField

The search field criterion for this NotebookEntryFilter. If not specified, all text fields will be searched.

Since:

BlackBerry 10.0.0

void resetSearchString ()

Resets the search string and search field criteria for this NotebookEntryFilter.

Calling this function prevents this NotebookEntryFilter from rejecting NotebookEntry objects based on search string, and is equivalent to invoking setSearchString() with a null QString.

Since:

BlackBerry 10.0.0

QString searchString ()

Retrieves the search string criterion being used by this NotebookEntryFilter.

Return:

The search string criterion being used by this NotebookEntryFilter. If a search string criterion is not set or has been reset, a null QString is returned.

Since:

BlackBerry 10.0.0

NotebookEntrySearchField::Types searchField ()

Retrieves the search field criterion being used by this NotebookEntryFilter.

Return:

The search field criterion being used by this NotebookEntryFilter. If a search string criterion is not set or has been reset, NotebookEntrySearchField::All is returned.

Since:

BlackBerry 10.0.0

bool hasSearchString ()

Determines whether this NotebookEntryFilter is filtering based on search strings.

Return:

true if this NotebookEntryFilter is filtering based on search strings, false otherwise.

Since:

BlackBerry 10.0.0

void setStatus (
  • NotebookEntryStatus::Typesstatus)

Sets the status criterion for this NotebookEntryFilter.

Once set, this NotebookEntryFilter will only accept NotebookEntry objects with any of the status flags that are provided.

Parameters
status

A set of allowed statuses for this NotebookEntryFilter.

Since:

BlackBerry 10.0.0

void resetStatus ()

Resets the status criterion for this NotebookEntryFilter.

Calling this function prevents this NotebookEntryFilter from rejecting NotebookEntry objects based on status, and is equivalent to invoking setStatus() with 0.

Since:

BlackBerry 10.0.0

NotebookEntryStatus::Types status ()

Retrieves the status criterion being used by this NotebookEntryFilter.

Return:

A set of allowed statuses being used by this NotebookEntryFilter.

Since:

BlackBerry 10.0.0

bool hasStatus ()

Indicates whether this NotebookEntryFilter is filtering based on status.

Return:

true if this NotebookEntryFilter is filtering based on status, false otherwise.

Since:

BlackBerry 10.0.0

void setOffset (
  • unsigned intoffset)

Sets the offset for this NotebookEntryFilter.

Setting this value will skip the first offset number of NotebookEntry objects that would otherwise be returned. If offset is larger than the number of NotebookEntry objects that would otherwise be returned, then no NotebookEntry objects will be accepted by this NotebookEntryFilter.

Parameters
offset

The offset value for this NotebookEntryFilter.

Since:

BlackBerry 10.0.0

void resetOffset ()

Resets the offset for this NotebookEntryFilter.

Invoking this function is equivalent to invoking setOffset() with a value of 0.

Since:

BlackBerry 10.0.0

unsigned int offset ()

Retrieves the offset for this NotebookEntryFilter.

Return:

The offset value for this NotebookEntryFilter, or 0 if an offset is not set.

Since:

BlackBerry 10.0.0

void setLimit (
  • unsigned intlimit)

Sets the limit for this NotebookEntryFilter.

This function restricts the maximum number of NotebookEntry objects that are accepted by this NotebookEntryFilter.

Parameters
limit

The limit value for this NotebookEntryFilter. A value of 0 means that there is no limit.

Since:

BlackBerry 10.0.0

void resetLimit ()

Resets the limit for this NotebookEntryFilter.

Invoking this function is equivalent to invoking setLimit() with a value of 0.

Since:

BlackBerry 10.0.0

unsigned int limit ()

Retrieves the limit for this NotebookEntryFilter.

Return:

The limit for this NotebookEntryFilter, or 0 if a limit is not set.

Since:

BlackBerry 10.0.0