NotebookEntry
#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.
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.
// 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(); service.addNotebookEntry( &entry, notebookId ); // should check return code for success
BlackBerry 10.0.0
Public Functions Index
| NotebookEntry () | |
| NotebookEntry (const NotebookEntry &other) | |
| ~NotebookEntry () | |
| NotebookEntry & | operator= (const NotebookEntry &other) |
| bool | operator== (const NotebookEntry &other) const |
| bool | operator!= (const NotebookEntry &other) const |
| bool | isValid () const |
| NotebookEntryId | id () const |
| NotebookId | parentNotebookId () const |
| void | setTitle (const QString &title) |
| QString | title () const |
| void | setDescription (const NotebookEntryDescription &description) |
| NotebookEntryDescription | description () const |
| QDateTime | creationDateTime () const |
| void | setDueDateTime (const QDateTime &dueDateTime) |
| void | resetDueDateTime () |
| QDateTime | dueDateTime () const |
| void | setStatus (NotebookEntryStatus::Type status) |
| NotebookEntryStatus::Type | status () const |
| void | addAttachment (const NotebookEntryAttachment &attachment) |
| void | addAttachments (const QList< NotebookEntryAttachment > &attachments) |
| QList< NotebookEntryAttachment > | attachments () const |
| void | removeAttachment (const NotebookEntryAttachment &attachment) |
| void | resetAttachments () |
Public Functions
Constructs a new NotebookEntry with default values.
Copy constructor.
This function constructs a NotebookEntry containing exactly the same values as the provided NotebookEntry.
| Parameters | |
|---|---|
| other |
The NotebookEntry to be copied. |
BlackBerry 10.0.0
Destructor.
BlackBerry 10.0.0
NotebookEntry &
Assignment operator.
This operator copies all values from the provided NotebookEntry into this NotebookEntry.
| Parameters | |
|---|---|
| other |
The NotebookEntry from which to copy all values. |
A reference to this NotebookEntry.
BlackBerry 10.0.0
bool
Equality operator.
This operator indicates whether the provided NotebookEntry contains the same title, description, due date/time, status 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. |
true if the provided NotebookEntry has the same user-editable contents as this NotebookEntry, false otherwise.
BlackBerry 10.0.0
bool
Inequality operator.
This operator indicates whether the provided NotebookEntry contains a different title, description, due date/time, status 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. |
true if the provided NotebookEntry has different user-editable contents than this NotebookEntry, false otherwise.
BlackBerry 10.0.0
bool
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.
true if this NotebookEntry is valid, false otherwise.
BlackBerry 10.0.0
NotebookEntryId
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.
The ID of this NotebookEntry.
BlackBerry 10.0.0
NotebookId
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.
The parent notebook ID of this NotebookEntry.
BlackBerry 10.0.0
void
Sets the title for this NotebookEntry.
| Parameters | |
|---|---|
| title |
The new title for this NotebookEntry. |
BlackBerry 10.0.0
QString
Retrieves the title of this NotebookEntry.
The title of this NotebookEntry.
BlackBerry 10.0.0
void
Sets the description for this NotebookEntry.
| Parameters | |
|---|---|
| description |
The new description for this NotebookEntry. |
BlackBerry 10.0.0
NotebookEntryDescription
Retrieves the description of this NotebookEntry.
The description of this NotebookEntry.
BlackBerry 10.0.0
QDateTime
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.
The creation date and time of this NotebookEntry.
BlackBerry 10.0.0
void
Sets the due date and time for this NotebookEntry.
| Parameters | |
|---|---|
| dueDateTime |
The new due date and time for this NotebookEntry. |
BlackBerry 10.0.0
void
Resets the due date and time for this NotebookEntry.
This is equivalent to invoking setDueDateTime() with a null QDateTime object.
BlackBerry 10.0.0
QDateTime
Retrieves the due date and time of this NotebookEntry.
The due date and time of this NotebookEntry.
BlackBerry 10.0.0
void
Sets the status for this NotebookEntry.
| Parameters | |
|---|---|
| status |
The new status for this NotebookEntry |
BlackBerry 10.0.0
NotebookEntryStatus::Type
Retrieves the status of this NotebookEntry.
The status of this NotebookEntry.
BlackBerry 10.0.0
void
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. |
BlackBerry 10.0.0
void
Appends a list of attachments for this NotebookEntry.
| Parameters | |
|---|---|
| attachments |
The attachments to add to this NotebookEntry. |
BlackBerry 10.0.0
QList< NotebookEntryAttachment >
Retrieves the attachments of this NotebookEntry.
The attachments of this NotebookEntry.
BlackBerry 10.0.0
void
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. |
BlackBerry 10.0.0
void
Removes all attachments from the list of attachments for this NotebookEntry.
BlackBerry 10.0.0