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.
// 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 );
BlackBerry 10.0.0
Public Functions Index
| NotebookEntryFilter () | |
| NotebookEntryFilter (const NotebookEntryFilter &other) | |
| ~NotebookEntryFilter () | |
| NotebookEntryFilter & | operator= (const NotebookEntryFilter &other) |
| bool | operator== (const NotebookEntryFilter &other) const |
| bool | operator!= (const NotebookEntryFilter &other) const |
| bool | accepts (const NotebookEntry &entry) const |
| void | setDueDateTime (NotebookEntryDueDate::Type type, const QDateTime &dueDateTime1=QDateTime()) |
| void | setDueDateTime (NotebookEntryDueDate::Type type, const QDateTime &dueDateTime1, const QDateTime &dueDateTime2) |
| void | resetDueDateTime () |
| QDateTime | dueDateTime () const |
| QDateTime | dueAfterDateTime () const |
| NotebookEntryDueDate::Type | dueDateTimeType () const |
| bool | hasDueDateTime () const |
| void | setParentNotebookId (const NotebookId &parentNotebookId) |
| void | resetParentNotebookId () |
| NotebookId | parentNotebookId () const |
| bool | hasParentNotebookId () const |
| void | setSearchString (const QString &searchString, NotebookEntrySearchField::Types searchField=NotebookEntrySearchField::All) |
| void | resetSearchString () |
| QString | searchString () const |
| NotebookEntrySearchField::Types | searchField () const |
| bool | hasSearchString () const |
| void | setStatus (NotebookEntryStatus::Types status) |
| void | resetStatus () |
| NotebookEntryStatus::Types | status () const |
| bool | hasStatus () const |
| void | setOffset (unsigned int offset) |
| void | resetOffset () |
| unsigned int | offset () const |
| void | setLimit (unsigned int limit) |
| void | resetLimit () |
| unsigned int | limit () const |
Public Functions
Constructs a new NotebookEntryFilter with no criteria set.
A default-constructed filter accepts all NotebookEntry objects.
BlackBerry 10.0.0
Copy constructor.
This function constructs a NotebookEntryFilter containing exactly the same criteria as the provided NotebookEntryFilter.
| Parameters | |
|---|---|
| other |
The NotebookEntryFilter to be copied. |
BlackBerry 10.0.0
Destructor.
BlackBerry 10.0.0
NotebookEntryFilter &
Assignment operator.
This operator copies all values from the provided NotebookEntryFilter into this NotebookEntryFilter.
| Parameters | |
|---|---|
| other |
The NotebookEntryFilter from which to copy all values. |
A reference to this NotebookEntryFilter.
BlackBerry 10.0.0
bool
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. |
true if the values are considered equal, false otherwise.
BlackBerry 10.0.0
bool
Inequality operator.
This operator determines if this NotebookEntryFilter has any different values from another NotebookEntryFilter.
| Parameters | |
|---|---|
| other |
The NotebookEntryFilter to compare to. |
true if any of the values are not considered equal, false otherwise.
BlackBerry 10.0.0
bool
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. |
true if the provided NotebookEntry is accepted by this NotebookEntryFilter, false otherwise.
BlackBerry 10.0.0
void
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. |
BlackBerry 10.0.0
void
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.
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). |
BlackBerry 10.0.0
void
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.
BlackBerry 10.0.0
QDateTime
Retrieves the "due by" date/time criterion being used by this NotebookEntryFilter.
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.
BlackBerry 10.0.0
QDateTime
Retrieves the "due after" date/time criterion being used by this NotebookEntryFilter.
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.
BlackBerry 10.0.0
NotebookEntryDueDate::Type
Retrieves the due date type being used by this NotebookEntryFilter.
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.
BlackBerry 10.0.0
bool
Determines whether this NotebookEntryFilter is filtering based on due date/time.
true if this NotebookEntryFilter is filtering based on due date/time, false otherwise.
BlackBerry 10.0.0
void
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. |
BlackBerry 10.0.0
void
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.
BlackBerry 10.0.0
NotebookId
Retrieves the parent notebook ID criterion being used by this NotebookEntryFilter.
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.
BlackBerry 10.0.0
bool
Indicates whether this NotebookEntryFilter is filtering based on parent notebook ID.
true if this NotebookEntryFilter is filtering based on parent notebook ID, false otherwise.
BlackBerry 10.0.0
void
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. |
BlackBerry 10.0.0
void
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.
BlackBerry 10.0.0
QString
Retrieves the search string criterion being used by this NotebookEntryFilter.
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.
BlackBerry 10.0.0
NotebookEntrySearchField::Types
Retrieves the search field criterion being used by this NotebookEntryFilter.
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.
BlackBerry 10.0.0
bool
Determines whether this NotebookEntryFilter is filtering based on search strings.
true if this NotebookEntryFilter is filtering based on search strings, false otherwise.
BlackBerry 10.0.0
void
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. |
BlackBerry 10.0.0
void
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.
BlackBerry 10.0.0
NotebookEntryStatus::Types
Retrieves the status criterion being used by this NotebookEntryFilter.
A set of allowed statuses being used by this NotebookEntryFilter.
BlackBerry 10.0.0
bool
Indicates whether this NotebookEntryFilter is filtering based on status.
true if this NotebookEntryFilter is filtering based on status, false otherwise.
BlackBerry 10.0.0
void
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. |
BlackBerry 10.0.0
void
Resets the offset for this NotebookEntryFilter.
Invoking this function is equivalent to invoking setOffset() with a value of 0.
BlackBerry 10.0.0
unsigned int
Retrieves the offset for this NotebookEntryFilter.
The offset value for this NotebookEntryFilter, or 0 if an offset is not set.
BlackBerry 10.0.0
void
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. |
BlackBerry 10.0.0
void
Resets the limit for this NotebookEntryFilter.
Invoking this function is equivalent to invoking setLimit() with a value of 0.
BlackBerry 10.0.0
unsigned int
Retrieves the limit for this NotebookEntryFilter.
The limit for this NotebookEntryFilter, or 0 if a limit is not set.
BlackBerry 10.0.0