NotebookEntry

Since: BlackBerry 10.0.0

#include <bb/pim/notebook/NotebookEntry>

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

The NotebookEntry class represents an entry that is contained within a Notebook.

A NotebookEntry is a single "thought" or "action" that a user wants to track. Each NotebookEntry is contained by exactly one Notebook, allowing them to be grouped together as the user sees fit.

Each NotebookEntry has a status. It can be non-actionable (a "thought" that doesn't require any action on the part of the user) or actionable (an "action" the user intends to take by a certain date and time). Actionable NotebookEntry objects are either completed or not completed. For more information, see the NotebookEntryStatus::Type enumeration. Actionable NotebookEntry objects can have a due date and/or a reminder.

A NotebookEntry can be augmented with attachments, which are displayed within the Remember application, leading to a richer user experience. See the NotebookEntryAttachment class for information on what attachment MIME types are supported natively by the Remember application. You can add attachments with arbitrary MIME types to be handled by their own applications, but the Remember application will ignore MIME types that it does not recognize.

Example usage:
// Here's how to create an actionable NotebookEntry with a title and due date,
// and add it to 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;
NotebookEntry entry;
entry.setTitle( "New NotebookEntry" );
entry.setStatus( NotebookEntryStatus::NotCompleted );
entry.setDueDateTime( QDateTime::currentDateTime().addDays( 1 ) );
NotebookId notebookId = service.defaultNotebook().id();

// You should be sure to check the return code from addNotebookEntry() for
// success
service.addNotebookEntry( &entry, notebookId );


Overview

Public Functions Index

NotebookEntry ()
NotebookEntry (const NotebookEntry &other)
~NotebookEntry ()
voidaddAttachment (const NotebookEntryAttachment &attachment)
voidaddAttachments (const QList< NotebookEntryAttachment > &attachments)
QList< NotebookEntryAttachment >attachments () const
QDateTimecreationDateTime () const
NotebookEntryDescriptiondescription () const
QDateTimedueDateTime () const
NotebookEntryIdid () const
boolisValid () const
QDateTimelastModifiedDateTime () const
booloperator!= (const NotebookEntry &other) const
NotebookEntry &operator= (const NotebookEntry &other)
booloperator== (const NotebookEntry &other) const
NotebookIdparentNotebookId () const
QDateTimereminderTime () const
voidremoveAttachment (const NotebookEntryAttachment &attachment)
voidresetAttachments ()
voidresetDueDateTime ()
voidresetReminderTime ()
voidsetDescription (const NotebookEntryDescription &description)
voidsetDueDateTime (const QDateTime &dueDateTime)
voidsetReminderTime (const QDateTime &reminderTime)
voidsetStatus (NotebookEntryStatus::Type status)
voidsetTitle (const QString &title)
NotebookEntryStatus::Typestatus () const
QStringtitle () const

Public Functions

NotebookEntry ()

Constructs a new NotebookEntry with default values.

A default-constructed NotebookEntry is considered invalid until at least one of its values is set. You can determine whether a NotebookEntry is valid by calling isValid().

See also:

isValid()

Since:

BlackBerry 10.0.0

NotebookEntry (

Copy constructor.

This function constructs a NotebookEntry containing exactly the same values as the provided NotebookEntry.

Parameters
other

The NotebookEntry to be copied.

Since:

BlackBerry 10.0.0

~NotebookEntry ()

Destructor.

Since:

BlackBerry 10.0.0

void addAttachment (

Appends an attachment to the list of attachments for this NotebookEntry.

Parameters
attachment

The attachment to append to the list of attachments for this NotebookEntry.

Since:

BlackBerry 10.0.0

void addAttachments (

Appends a list of attachments for this NotebookEntry.

Parameters
attachments

The attachments to add to this NotebookEntry.

Since:

BlackBerry 10.0.0

QList< NotebookEntryAttachment > attachments ()

Retrieves the attachments of this NotebookEntry.

Return:

The attachments of this NotebookEntry.

Since:

BlackBerry 10.0.0

QDateTime creationDateTime ()

Retrieves the creation date and time of this NotebookEntry.

A NotebookEntry is automatically assigned a creation date and time when it is first committed to persistence using the NotebookService. The creation date and time cannot be changed using the Notebook API.

Return:

The creation date and time of this NotebookEntry.

Since:

BlackBerry 10.0.0

NotebookEntryDescription description ()

Retrieves the description of this NotebookEntry.

Return:

The description of this NotebookEntry.

Since:

BlackBerry 10.0.0

QDateTime dueDateTime ()

Retrieves the due date and time of this NotebookEntry.

Return:

The due date and time of this NotebookEntry.

Since:

BlackBerry 10.0.0

NotebookEntryId id ()

Retrieves the ID of this NotebookEntry.

The ID uniquely identifies a NotebookEntry in a particular account. The ID is assigned automatically by the database when a NotebookEntry is added using the NotebookService. You can't set the ID of a NotebookEntry manually.

Return:

The ID of this NotebookEntry.

Since:

BlackBerry 10.0.0

bool isValid ()

Indicates whether this NotebookEntry is valid.

A default-constructed NotebookEntry is considered invalid until at least one of its values is set. You should use this function to determine if a NotebookEntry is valid before you use it. For example, if you call NotebookService::notebookEntry() to retrieve a NotebookEntry but you provide a non-existent ID, the NotebookEntry object that is returned will be invalid.

Return:

true if this NotebookEntry is valid, false otherwise.

Since:

BlackBerry 10.0.0

QDateTime lastModifiedDateTime ()

Retrieves the last modified date and time of this NotebookEntry.

A NotebookEntry is automatically assigned a last modified date and time when it is first committed to persistence using the NotebookService. This is automatically updated each time it is modified. The last modified date and time cannot be changed using the Notebook API.

Return:

The last modified date and time of this NotebookEntry.

Since:

BlackBerry 10.2.0

bool operator!= (

Inequality operator.

This operator indicates whether the provided NotebookEntry contains a different title, description, due date/time, status, reminder or attachments than this NotebookEntry. The purpose of this operator is to compare only the user-editable contents of the two NotebookEntry objects; other fields, such as ID and creation date/time, are not considered.

To determine whether two NotebookEntry objects represent different notebook entries in the database, you should do an inequality comparison on the IDs of the two NotebookEntry objects, rather than on the NotebookEntry objects themselves.

Parameters
other

The NotebookEntry to compare to this one for inequality of user-editable contents.

Return:

true if the provided NotebookEntry has different user-editable contents than this NotebookEntry, false otherwise.

Since:

BlackBerry 10.0.0

NotebookEntry & operator= (

Assignment operator.

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

Parameters
other

The NotebookEntry from which to copy all values.

Return:

A reference to this NotebookEntry.

Since:

BlackBerry 10.0.0

bool operator== (

Equality operator.

This operator indicates whether the provided NotebookEntry contains the same title, description, due date/time, status, reminder and attachments as this NotebookEntry. The purpose of this operator is to compare only the user-editable contents of the two NotebookEntry objects; other fields, such as ID and creation date/time, are not considered.

To determine whether two NotebookEntry objects represent the same notebook entry in the database, you should do an equality comparison on the IDs of the two NotebookEntry objects, rather than on the NotebookEntry objects themselves.

Parameters
other

The NotebookEntry to compare to this one for equality of user-editable contents.

Return:

true if the provided NotebookEntry has the same user-editable contents as this NotebookEntry, false otherwise.

Since:

BlackBerry 10.0.0

NotebookId parentNotebookId ()

Retrieves the parent notebook ID of this NotebookEntry.

A NotebookEntry is contained by the Notebook whose ID matches the notebook ID of the NotebookEntry. Thus, this function is used to determine which Notebook this NotebookEntry belongs to.

Return:

The parent notebook ID of this NotebookEntry.

Since:

BlackBerry 10.0.0

QDateTime reminderTime ()

Retrieves the reminder date and time of this NotebookEntry.

Return:

The reminder date and time of this NotebookEntry.

Since:

BlackBerry 10.2.0

void removeAttachment (

Removes an attachment from the list of attachments for this NotebookEntry.

All attachments whose MIME type and data ID match those of the provided attachment are removed.

Parameters
attachment

The attachment to be removed from the list of attachments for this NotebookEntry.

Since:

BlackBerry 10.0.0

void resetAttachments ()

Removes all attachments from the list of attachments for this NotebookEntry.

Since:

BlackBerry 10.0.0

void resetDueDateTime ()

Resets the due date and time for this NotebookEntry.

This is equivalent to invoking setDueDateTime() with a null QDateTime object.

Since:

BlackBerry 10.0.0

void resetReminderTime ()

Resets the reminder date and time for this NotebookEntry.

This is equivalent to invoking setReminderTime() with a null QDateTime object.

Since:

BlackBerry 10.2.0

void setDescription (

Sets the description for this NotebookEntry.

Parameters
description

The new description for this NotebookEntry.

Since:

BlackBerry 10.0.0

void setDueDateTime (

Sets the due date and time for this NotebookEntry.

Parameters
dueDateTime

The new due date and time for this NotebookEntry.

Since:

BlackBerry 10.0.0

void setReminderTime (

Sets the reminder date and time for this NotebookEntry.

Parameters
reminderTime

The new reminder date and time for this NotebookEntry.

Since:

BlackBerry 10.2.0

void setStatus (

Sets the status for this NotebookEntry.

Parameters
status

The new status for this NotebookEntry

Since:

BlackBerry 10.0.0

void setTitle (

Sets the title for this NotebookEntry.

Parameters
title

The new title for this NotebookEntry.

Since:

BlackBerry 10.0.0

NotebookEntryStatus::Type status ()

Retrieves the status of this NotebookEntry.

Return:

The status of this NotebookEntry.

Since:

BlackBerry 10.0.0

QString title ()

Retrieves the title of this NotebookEntry.

Return:

The title of this NotebookEntry.

Since:

BlackBerry 10.0.0

Last modified: 2014-03-13

comments powered by Disqus