NotebookEntryAttachment

Since: BlackBerry 10.0.0

#include <bb/pim/notebook/NotebookEntryAttachment>

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

The NotebookEntryAttachment class represents an attachment to a NotebookEntry.

Notebook entry attachments augment the Notebook experience by allowing media such as voice notes and images to be added to notebook entries. Attachments are specified by a MIME type, an account key, and a data ID. The account key and data ID should contain enough information to uniquely identify and retrieve the media item on the system.

The Remember application natively supports a small set of MIME types for NotebookEntryAttachment objects, as documented below, and will ignore attachments whose MIME types it does not recognize. However, you can create arbitrary NotebookEntryAttachment objects to be used in your own applications. In the future, this API may be extended to allow arbitrary MIME types to be registered for use within the Remember application.

The following MIME types are currently supported:

Media files:
  • audio/aac

  • audio/amr

  • audio/mp4

  • audio/qcp

  • audio/basic

  • audio/ogg

  • audio/x-aiff

  • audio/x-midi

  • audio/x-mpeg

  • audio/x-mpegurl

  • audio/x-scpls

  • audio/x-wav

  • image/bmp

  • image/cgm

  • image/gif

  • image/ief

  • image/jpeg

  • image/pict

  • image/png

  • image/svg+xml

  • image/tiff

  • image/vnd.djvu

  • image/x-cmu-raster

  • image/x-icon

  • image/x-jg

  • image/x-macpaint

  • image/x-photoshop

  • image/x-portable-anymap

  • image/x-portable-bitmap

  • image/x-portable-graymap

  • image/x-portable-pixmap

  • image/x-quicktime

  • image/x-rgb

  • image/x-xbitmap

  • image/x-xpixmap

  • image/x-xwindowdump

  • video/3gpp

  • video/3gpp2

  • video/h264

  • video/MP2T

  • video/mp4

  • video/mpeg

  • video/mpeg2

  • video/quicktime

  • video/vnd.mpegurl

  • video/x-dv

  • video/x-m4v

  • video/x-matroska

  • video/x-matroska-3d

  • video/x-ms-asf

  • video/x-ms-wma

  • video/x-ms-wmv

  • video/x-msvideo

  • video/x-rad-screenplay

  • video/x-sgi-movie

Documents:
  • application/pdf

  • application/msword

  • application/vnd.ms-excel

  • application/vnd.ms-excel.sheet.macroEnabled.12

  • application/vnd.ms-excel.template.macroEnabled.12

  • application/vnd.ms-powerpoint

  • application/vnd.ms-powerpoint.presentation.macroEnabled.12

  • application/vnd.ms-powerpoint.slideshow.macroEnabled.12

  • application/vnd.ms-powerpoint.template.macroEnabled.12

  • application/vnd.ms-word.document.macroEnabled.12

  • application/vnd.ms-word.template.macroEnabled.12

  • application/vnd.openxmlformats-officedocument.presentationml.presentation

  • application/vnd.openxmlformats-officedocument.presentationml.slideshow

  • application/vnd.openxmlformats-officedocument.presentationml.template

  • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

  • application/vnd.openxmlformats-officedocument.spreadsheetml.template

  • application/vnd.openxmlformats-officedocument.wordprocessingml.document

  • application/vnd.openxmlformats-officedocument.wordprocessingml.template

Zip files:
  • application/zip

Text:
  • text/plain

Contact cards:
  • text/vcard

Calendar events:
  • text/calendar

Security certificates:
  • application/x-x509-ca-cert

For these MIME types, the dataId represents the URL to access the raw file from the file system.

PIM data:
  • message/rfc822

For this MIME type, the dataId is a uib URL.

Example usage:
// Here's how to create a NotebookEntryAttachment representing a JPEG image.
NotebookEntryAttachment attachment;
attachment.setMimeType( "image/jpeg" );
attachment.setDataId( "file:///path/to/image" );


Overview

Public Functions Index

NotebookEntryAttachment ()
NotebookEntryAttachment (const NotebookEntryAttachment &other)
~NotebookEntryAttachment ()
QUrldataId () const
QStringmimeType () const
booloperator!= (const NotebookEntryAttachment &other) const
NotebookEntryAttachment &operator= (const NotebookEntryAttachment &other)
booloperator== (const NotebookEntryAttachment &other) const
voidsetDataId (const QUrl &dataId)
voidsetMimeType (const QString &mimeType)

Public Functions

NotebookEntryAttachment ()

Constructs a new NotebookEntryAttachment with default values.

Since:

BlackBerry 10.0.0

NotebookEntryAttachment (

Copy constructor.

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

Parameters
other

The NotebookEntryAttachment to be copied.

Since:

BlackBerry 10.0.0

~NotebookEntryAttachment ()

Destructor.

Since:

BlackBerry 10.0.0

QUrl dataId ()

Retrieves the data ID of this NotebookEntryAttachment.

Return:

The data ID of this NotebookEntryAttachment.

Since:

BlackBerry 10.0.0

QString mimeType ()

Retrieves the MIME type of this NotebookEntryAttachment.

Return:

The MIME type of this NotebookEntryAttachment.

Since:

BlackBerry 10.0.0

bool operator!= (

Inequality operator.

This operator returns true if the MIME type, account key, or data ID of the provided NotebookEntryAttachment are different from those of this NotebookEntryAttachment, and returns false otherwise. The QString objects that represent the MIME type and data ID are compared using the QString::compare() function.

Parameters
other

The NotebookEntryAttachment to check for inequality.

Return:

true if the provided NotebookEntryAttachment is not equal to this one, false otherwise.

Since:

BlackBerry 10.0.0

NotebookEntryAttachment & operator= (

Assignment operator.

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

Parameters
other

The NotebookEntryAttachment from which to copy all values.

Return:

A reference to this NotebookEntryAttachment.

Since:

BlackBerry 10.0.0

bool operator== (

Equality operator.

This operator returns true if the MIME type, account key, and data ID of the provided NotebookEntryAttachment are equal to those of this NotebookEntryAttachment, and returns false otherwise. The QString objects that represent the MIME type and data ID are compared using the QString::compare() function.

Parameters
other

The NotebookEntryAttachment to check for equality.

Return:

true if the provided NotebookEntryAttachment is equal to this one, false otherwise.

Since:

BlackBerry 10.0.0

void setDataId (

Sets the data ID for this NotebookEntryAttachment.

Parameters
dataId

The data ID for this NotebookEntryAttachment.

Since:

BlackBerry 10.0.0

void setMimeType (

Sets the MIME type for this NotebookEntryAttachment.

Parameters
mimeType

The MIME type for this NotebookEntryAttachment.

Since:

BlackBerry 10.0.0

Last modified: 2014-09-29



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

comments powered by Disqus