Calendar

The following information shows you how to use the invocation framework with the Calendar app. If you are developing an app using C++ or QML, see Calendar for information on using the Calendar API.

Creating an event

Here are the invocation attributes you use to open a calendar card to create an event:

Attribute Value
Target ID

sys.pim.calendar.viewer.eventcreate

Action

bb.action.CREATE

MIME type

text/calendar

Description Data (optional)
Account ID of the event unsigned int accountId
Folder ID of the event unsigned int folderId

List of participant email addresses as a QString

QVariantList participants
Subject of the event QString subject
Body of the event Qstring body
Start time of the event QDateTime startTime
Location of the event QString location
Duration of the event int duration

If you're using C++, data must be a PPS-encoded QVariantMap, as follows:
QVariantMap map;
map.insert("accountid", "123456");    
map.insert("folderid", "123");    
...
QByteArray requestData = PpsObject::encode(map, NULL);

Picking an existing event

Here are the invocation attributes you use to open a calendar card to pick an existing event:

Attribute Value
Target ID

sys.pim.calendar.viewer.nav

Action

bb.calendar.PICK

MIME type

text/calendar

Here's the card response that you receive:

Reason Data Description
Done Event data in VCS format This response is returned when the user picks an event, after which the card closes.

Editing an existing event

Here are the invocation attributes you use to open a calendar card to edit an existing event:

Attribute Value
Target ID

sys.pim.calendar.viewer.eventcreate

Action

bb.calendar.EDIT

MIME type

text/calendar

Description Data
Account ID of the existing event unsigned int accountId
Folder ID of the event (optional) unsigned int folderId
Event ID unsigned int eventID
Start time of the event (optional) QString startTime

The start time lets you differentiate between any two or more recurring events that have the same eventID.

If you're using C++, data must be a PPS-encoded QVariantMap, as follows:
bb::system::InvokeRequest req;
req.setMimeType("text/calendar");
req.setTarget("sys.pim.calendar.viewer.eventcreate");
req.setAction("bb.calendar.EDIT");
QVariantMap data = QVariantMap();
data["accountId"] = event.accountId();
data["eventId"] = event.id();
data["folder"] = event.folderId();
data["startTime"] = event.startTime().toString();
req.setData(PpsObject::encode(data));
m_invokeManager->invoke(req);

Viewing an .ics file

Here are the invocation attributes you use to launch a calendar card to view an .ics file:

Attribute Value
Target ID

sys.pim.calendar.viewer.ics

Action

bb.action.OPEN

MIME type

text/calendar

URI

file:///path/to/my/file/filename.ics

If you want to open the .ics file for a specific account, you can set an account ID in the data attribute of the invocation request.

Description Data (optional)
Account ID of the existing event unsigned int accountId

If you're using C++, data must be a PPS-encoded QVariantMap, as follows:
QVariantMap map;
map.insert("accountId", 123456);    
QByteArray requestData = PpsObject::encode(map, NULL);

Opening the calendar app

Here are the invocation attributes you use to open the calendar app:

Attribute Value
Action bb.calendar.OPEN
MIME type text/calendar
Data

A QUrl object

If you're using C++, the QUrl data object needs to be populated using QUrl::addQueryItem(QString name, QString value). The table below shows the valid query names and values for this invocation:

Query name Query value Description
view
  • monthly
  • agenda
  • people
  • schedule
  • weekly
Opens a specific view of the calendar app (for example, monthly view).
calendars
  • <account-id>-<folderId>
  • <account-id>-<syncId>
Opens the calendar app with only the specified calendars visible. You can enable multiple calendars by providing comma-separated list of <account-id>-<folderId> and <account-id>-<syncId>.
date Date must be in the following format: Wed Jun 13 2012 Opens the calendar view for the specified date.

Viewing an existing event

Here are the invocation attributes you use to launch a calendar card to view an existing event:

Attribute Value
Target ID

sys.pim.calendar.viewer.ics

Action

bb.calendar.OPEN

MIME type

text/calendar

Description Data (optional)
Account ID of the existing event unsigned int accountId
Event ID of the existing event unsigned int eventId
Start time of the existing event. You can use this attribute to distinguish between any recurring events that have the same event ID. QString startTime

If you're using C++, data must be a PPS-encoded QVariantMap, as follows:
QVariantMap map;
map.insert("accountId", 123456);    
map.insert("eventId", 123);    
map.insert("startTime", "2012-05-25 11:30:00");    // Needed for recurring events
QByteArray requestData = PpsObject::encode(map, NULL);

Here are the invocation attributes you use to open the calendar app to view an existing event:

Attribute Value
Action bb.calendar.VIEW
MIME type text/calendar
Data

A QUrl object

If you're using C++, the QUrl data object needs to be populated using QUrl::addQueryItem(QString name, QString value). The table below shows the valid query names and values for this invocation:

Query name Query value Description
accountId <account-id> Account ID of the event.
eventId <event-id> Event ID of the event.
date The start time must be in the following format: 2012-06-13 09:39:56 The start time of the event. This attribute is required only for recurring events to identify which of the events in a recurring event should be opened.

To learn more about manipulating calendar entries on a device, see Calendar.

Last modified: 2014-09-30



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

comments powered by Disqus