NotebookEntryFilter

Since: BlackBerry 10.0.0

#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 );


Overview

Public Functions Index

NotebookEntryFilter ()
NotebookEntryFilter (const NotebookEntryFilter &other)
~NotebookEntryFilter ()
boolaccepts (const NotebookEntry &entry) const
NotebookEntryDetailLevel::TypedetailLevel () const
QDateTimedueAfterDateTime () const
QDateTimedueDateTime () const
NotebookEntryDueDate::TypedueDateTimeType () const
boolhasDueDateTime () const
boolhasParentNotebookId () const
boolhasParentNotebookIds () const
boolhasReminderDateTime () const
boolhasSearchString () const
boolhasStatus () const
unsigned intlimit () const
unsigned intoffset () const
booloperator!= (const NotebookEntryFilter &other) const
NotebookEntryFilter &operator= (const NotebookEntryFilter &other)
booloperator== (const NotebookEntryFilter &other) const
NotebookIdparentNotebookId () const
QList< NotebookId >parentNotebookIds () const
QDateTimereminderAfterDateTime () const
QDateTimereminderDateTime () const
NotebookEntryDueDate::TypereminderDateTimeType () const
voidresetDueDateTime ()
voidresetLimit ()
voidresetOffset ()
voidresetParentNotebookId ()
voidresetParentNotebookIds ()
voidresetReminderDateTime ()
voidresetSearchString ()
voidresetStatus ()
NotebookEntrySearchField::TypessearchField () const
QStringsearchString () const
voidsetDetailLevel (NotebookEntryDetailLevel::Type detailLevel)
voidsetDueDateTime (NotebookEntryDueDate::Type type, const QDateTime &dueDateTime1=QDateTime())
voidsetDueDateTime (NotebookEntryDueDate::Type type, const QDateTime &dueDateTime1, const QDateTime &dueDateTime2)
voidsetLimit (unsigned int limit)
voidsetOffset (unsigned int offset)
voidsetParentNotebookId (const NotebookId &parentNotebookId)
voidsetParentNotebookIds (const QList< NotebookId > &parentNotebookIds)
voidsetReminderDateTime (NotebookEntryDueDate::Type type, const QDateTime &reminderDateTime1=QDateTime())
voidsetReminderDateTime (NotebookEntryDueDate::Type type, const QDateTime &reminderDateTime1, const QDateTime &reminderDateTime2)
voidsetSearchString (const QString &searchString, NotebookEntrySearchField::Types searchField=NotebookEntrySearchField::All)
voidsetSortSpecifiers (const QList< NotebookEntrySortSpecifier > &sortSpecifiers)
voidsetStatus (NotebookEntryStatus::Types status)
QList< NotebookEntrySortSpecifier >sortSpecifiers () const
NotebookEntryStatus::Typesstatus () const

Public Functions

NotebookEntryFilter ()

Constructs a new NotebookEntryFilter with no criteria set.

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

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

NotebookEntryDetailLevel::Type detailLevel ()

Retrieves the detail level being used by this NotebookEntryFilter.

Return:

Detail level used by this NotebookEntryFilter.

Since:

BlackBerry 10.2.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

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

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

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

Deprecated

Please use hasParentNotebookIds instead.

bool hasParentNotebookIds ()

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

Return:

True if this NotebookEntryFilter is filtering based on parent notebook IDs, false otherwise.

Since:

BlackBerry 10.3.0

bool hasReminderDateTime ()

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

Return:

True if this NotebookEntryFilter is filtering based on reminder date/time, false otherwise.

Since:

BlackBerry 10.2.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

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

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

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

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

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

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

Deprecated

Please use parentNotebookIds instead.

QList< NotebookId > parentNotebookIds ()

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

Return:

The parent notebook ID criteria being used by this NotebookEntryFilter. If the parent notebook ID criteria has not been set or has been reset, an empty QList<NotebookId> is returned.

Since:

BlackBerry 10.3.0

QDateTime reminderAfterDateTime ()

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

Return:

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

Since:

BlackBerry 10.2.0

QDateTime reminderDateTime ()

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

Return:

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

Since:

BlackBerry 10.2.0

NotebookEntryDueDate::Type reminderDateTimeType ()

Retrieves the reminder date type being used by this NotebookEntryFilter.

Return:

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

Since:

BlackBerry 10.2.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

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

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

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

deprecated Please use resetParentNotebookIds instead.

void resetParentNotebookIds ()

Resets the parent notebook ID criteria for this NotebookEntryFilter.

Calling this function prevents this NotebookEntryFilter from rejecting NotebookEntry objects based on parent notebook ID, and is equivalent to invoking setParentNotebookIds() with an empty QList<NotebookId>.

Since:

BlackBerry 10.3.0

void resetReminderDateTime ()

Resets the reminder date/time criteria for this NotebookEntryFilter.

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

Since:

BlackBerry 10.2.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

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

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

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

void setDetailLevel (

Sets the sort columns and sort orders of this NotebookEntryFilter using a list of NotebookEntrySortSpecifier objects.

The default sort column is Title and the default sort order is Ascending. The search results are first sorted according to the first NotebookEntrySortSpecifier in the provided list, then by the second NotebookEntrySortSpecifier in the list, and so on.

Parameters
detailLevel

The detail level to be set.

Since:

BlackBerry 10.2.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 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 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 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

Deprecated

Please use setParentNotebookIds instead.

void setParentNotebookIds (

Sets the parent notebook ID criteria for this NotebookEntryFilter.

Once set, this NotebookEntryFilter will only accept NotebookEntry objects with a parent notebook ID that is in the list of provided NotebookId objects. If the provided list is empty, then this NotebookEntryFilter does not reject NotebookEntry objects based on parent notebook IDs. Any invalid NotebookId objects are not used by this NotebookEntryFilter.

Parameters
parentNotebookIds

The list of parent notebook ID criteria for this NotebookEntryFilter.

Since:

BlackBerry 10.3.0

void setReminderDateTime (

Sets the reminder date/time criteria for this NotebookEntryFilter.

This is an overloaded function. This function and NotebookEntryFilter::setReminderDateTime(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 date types to filter on.

reminderDateTime1

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

Since:

BlackBerry 10.2.0

void setReminderDateTime (

Sets the reminder date/time criteria for this NotebookEntryFilter.

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 accepts only 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: reminderDateTime1 is used as the "reminder by" date/time; reminderDateTime2 is ignored and can be omitted. If reminderDateTime1 is invalid, the reminder date type is set to NotebookEntryDueDate::AnyDate.

  • NotebookEntryDueDate::AfterSpecificDate: reminderDateTime1 is used as the "reminder after" date/time; reminderDateTime2 is ignored and can be omitted. If reminderDateTime1 is invalid, the reminder date type is set to NotebookEntryDueDate::AnyDate.

  • NotebookEntryDueDate::WithinSpecificRange: reminderDateTime1 is used as the "reminder after" date/time; reminderDateTime2 is used as the "reminder 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 reminderDateTime1 or reminderDateTime2 are invalid, the reminder date type is set to NotebookEntryDueDate::BySpecificDate or NotebookEntryDueDate::AfterSpecificDate as appropriate. If both parameters are invalid, the reminder date type is set to NotebookEntryDueDate::AnyDate.

Parameters
type

One of the available reminder date types to filter on.

reminderDateTime1

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

reminderDateTime2

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

Since:

BlackBerry 10.2.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. The maximum length of the search string that can be handled by the NotebookService is 250 characters.

searchField

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

Since:

BlackBerry 10.0.0

void setSortSpecifiers (

Sets the sort columns and sort orders of this NotebookEntryFilter using a list of NotebookEntrySortSpecifier objects.

The default sort column is Title and the default sort order is Ascending. The search results are first sorted according to the first NotebookEntrySortSpecifier in the provided list, then by the second NotebookEntrySortSpecifier in the list, and so on.

Parameters
sortSpecifiers

The set of sort column and sort order pairs to set, represented by NotebookEntrySortSpecifier objects.

Since:

BlackBerry 10.2.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

QList< NotebookEntrySortSpecifier > sortSpecifiers ()

Retrieves the list of sort specifiers being used by this NotebookEntryFilter.

Return:

A list of the sort specifiers being used by this NotebookEntryFilter.

Since:

BlackBerry 10.2.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

Last modified: 2014-09-30



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

comments powered by Disqus