The Internet Calendaring and Scheduling Core Object Specification (iCalendar), defines a format for exchanging event items. Mapping to specified event/task attributes in this API is as per this specification. For details, see RFC 5545.
This API provides functionality to read, create, delete, and update items in specific calendars. Calendars can be obtained using the getCalendars() method, which returns an array of Calendar objects.
For more information on the Calendar features, see Calendar Guide.
Since: 1.0
typedef (CalendarEventId or CalendarTaskId) CalendarItemId;
Since: 1.0
enum CalendarType { "EVENT", "TASK" };
Since: 1.0
The following types are supported:
enum CalendarTextFormat { "ICALENDAR_20", "VCALENDAR_10" };
Since: 1.0
The following values are supported:
enum AlarmMethod { "SOUND", "DISPLAY" };
Since: 1.0
The following values are supported:
enum RecurrenceRuleFrequency { "DAILY", "WEEKLY", "MONTHLY", "YEARLY" };
Since: 1.0
Only the following values are valid for this attribute:
enum ByDayValue { "MO", "TU", "WE", "TH", "FR", "SA", "SU" };
Since: 1.0
"MO" to "SU" correspond to "Monday" to "Sunday".
enum EventAvailability { "BUSY", "FREE" };
Since: 1.0
The following values are supported:
enum AttendeeType { "INDIVIDUAL", "GROUP", "RESOURCE", "ROOM", "UNKNOWN" };
Since: 1.0
At least the following values must be supported:
enum AttendeeStatus { "PENDING", "ACCEPTED", "DECLINED", "TENTATIVE", "DELEGATED", "COMPLETED", "IN_PROCESS" };
Since: 1.0
At least the following values must be supported:
enum AttendeeRole { "REQ_PARTICIPANT", "OPT_PARTICIPANT", "NON_PARTICIPANT", "CHAIR" };
Since: 1.0
At least the following values must be supported:
enum CalendarItemPriority { "HIGH", "MEDIUM", "LOW" };
Since: 1.0
The following values are supported:
enum CalendarItemVisibility { "PUBLIC", "PRIVATE", "CONFIDENTIAL" };
Since: 1.0
The following values are supported:
enum CalendarItemStatus { "TENTATIVE", "CONFIRMED", "CANCELLED", "NEEDS_ACTION", "IN_PROCESS", "COMPLETED" };
Since: 1.0
For an event, the possible values are:
For a task, the possible values are:
[NoInterfaceObject] interface CalendarManagerObject{ readonly attribute CalendarManager calendar; };
Tizen implements CalendarManagerObject;
Since: 1.0
[NoInterfaceObject] interface CalendarManager { void getCalendars(CalendarType type, CalendarArraySuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); Calendar getUnifiedCalendar(CalendarType type) raises(WebAPIException); Calendar getDefaultCalendar(CalendarType type) raises(WebAPIException); void addCalendar(Calendar calendar) raises(WebAPIException); void removeCalendar(CalendarType type, CalendarId id) raises(WebAPIException); Calendar getCalendar(CalendarType type, CalendarId id) raises(WebAPIException); };
Since: 1.0
getCalendars
void getCalendars(CalendarType type, CalendarArraySuccessCallback successCallback, optional ErrorCallback? errorCallback);
Since: 1.0
If the operation completes successfully, the successCallback() must be invoked with all the calendars found and available. The first calendar in the list is always the default calendar.
If no Calendar object is available, the successCallback() is invoked with an empty array.
The ErrorCallback method is launched with these error types:
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.read
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if this feature is not supported.
Code example:
var calendar; function eventFoundCallback(events) { // The event has been successfully found. // Changes the summary. events[0].summary = 'HTML6 Webinar'; calendar.update(events[0]); console.log('First event was updated!'); } // Defines the error callback for all the asynchronous calls. function errorCallback(response) { console.log( 'The following error occurred: ' + response.name); } // Defines the success callback for retrieving the list of calendars. function calendarListCallback(calendars) { if(calendars.length > 0) { calendar = calendars[0]; console.log('The calendar id is ' + calendar.id + ' and name ' + calendar.name); var ev = new tizen.CalendarEvent({description:'HTML5 Introduction', summary:'HTML5 Webinar', startDate: new tizen.TZDate(2011, 3, 30, 10, 0), duration: new tizen.TimeDuration(1, "HOURS"), location:'Huesca'}); calendar.add(ev); // The event has been successfully added. // Checks whether the added event can be retrieved from the calendar. // If the calendar was empty, only the item added through add() should be returned. var filter = new tizen.AttributeFilter('summary', 'CONTAINS', 'HTML5'); calendar.find(eventFoundCallback, errorCallback, filter); } } // Gets a list of available calendars. tizen.calendar.getCalendars("EVENT", calendarListCallback, errorCallback);
getUnifiedCalendar
Calendar getUnifiedCalendar(CalendarType type);
Since: 2.1
If an item is added to the unified calendar, it will be saved in the default calendar.
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.read
Parameters:
Return value:
Calendar The unified Calendar object.Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type InvalidValuesError, if any of the input parameters contain an invalid value.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if this feature is not supported.
with error type UnknownError, if any other error occurs.
Code example:
var unifiedCalendar; // Defines the error callback for all the asynchronous calls. function errorCallback(response) { console.log( 'The following error occurred: ' + response.name); } function eventFoundCallback(events) { // The event has been successfully found. // Changes the summary. events[0].summary = 'HTML6 Webinar'; unifiedCalendar.update(events[0]); console.log('First event was updated!'); } // Gets the unified calendar. unifiedCalendar = tizen.calendar.getUnifiedCalendar("EVENT"); var ev = new tizen.CalendarEvent({description:'HTML5 Introduction', summary:'HTML5 Webinar ', startDate: new tizen.TZDate(2011, 3, 30, 10, 0), duration: new tizen.TimeDuration(1, "HOURS"), location:'Huesca'}); unifiedCalendar.add(ev); // The event has been added. // Checks whether the added event can be retrieved from the calendar. // If the calendar was empty, only the item added through add() should be returned. var filter = new tizen.AttributeFilter('summary', 'CONTAINS', 'HTML5'); unifiedCalendar.find(eventFoundCallback, errorCallback, filter);
getDefaultCalendar
Calendar getDefaultCalendar(CalendarType type);
Since: 1.0
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.read
Parameters:
Return value:
Calendar The default Calendar objectExceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type InvalidValuesError, if any of the input parameters contain an invalid value.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if this feature is not supported.
with error type UnknownError, if any other error occurs.
Code example:
var myCalendar; // Defines the error callback for all the asynchronous calls. function errorCallback(response) { console.log( 'The following error occurred: ' + response.name); } function eventFoundCallback(events) { // The event has been successfully found. // Changes the summary. events[0].summary = 'HTML6 Webinar'; myCalendar.update(events[0]); console.log('First event was updated!'); } // Gets the default calendar. myCalendar = tizen.calendar.getDefaultCalendar("EVENT"); var ev = new tizen.CalendarEvent({description:'HTML5 Introduction', summary:'HTML5 Webinar ', startDate: new tizen.TZDate(2011, 3, 30, 10, 0), duration: new tizen.TimeDuration(1, "HOURS"), location:'Huesca'}); myCalendar.add(ev); // The event has been added. // Checks whether the added event can be retrieved from the calendar. // If the calendar was empty, only the item added through add() should be returned. var filter = new tizen.AttributeFilter('summary', 'CONTAINS', 'HTML5'); myCalendar.find(eventFoundCallback, errorCallback, filter);
addCalendar
void addCalendar(Calendar calendar);
Since: 2.3
If the calendar is successfully inserted in the database, the Calendar object will have its identifier (id attribute) set when the function returns.
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.write
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if this feature is not supported.
with error type UnknownError, if the calendar could not be inserted to an unknown error.
Code example:
var appId = tizen.application.getCurrentApplication().appInfo.id; tizen.account.getAccounts(function(accounts) { var account = accounts[0]; if(account) { var calendar = new tizen.Calendar( account.id, 'remote calendar', 'TASK' ); tizen.calendar.addCalendar(calendar); } }, function(e) { console.log('Error: ' + e.message); }, appId);
removeCalendar
void removeCalendar(CalendarType type, CalendarId id);
Since: 2.3
Removes the calendar that corresponds to the specified identifier from the database. The function will throw an exception if it failed to remove the specified calendar.
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.write
Parameters:
Exceptions:
with error type NotFoundError, if there is no calendar with the given identifier.
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type InvalidValuesError, if the identifier represents default calendar.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if this feature is not supported.
with error type UnknownError, if the calendar could not be removed to an unknown error.
Code example:
var appId = tizen.application.getCurrentApplication().appInfo.id; tizen.account.getAccounts(function(accounts) { var account = accounts[0]; if(account) { var calendar = new tizen.Calendar( account.id, 'remote calendar', 'TASK' ); tizen.calendar.addCalendar(calendar); tizen.calendar.removeCalendar('TASK', calendar.id); } }, function(e) { console.log('Error: ' + e.message); }, appId);
getCalendar
Calendar getCalendar(CalendarType type, CalendarId id);
Since: 1.0
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.read
Parameters:
Return value:
Calendar The matching Calendar objectExceptions:
with error type NotFoundError, if there is no calendar with the given identifier.
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type InvalidValuesError, if any of the input parameters contain an invalid value.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if this feature is not supported.
with error type UnknownError, if any other error occurs.
Code example:
var calendarId; // calendarId supposed to be initialized try { var calendar = tizen.calendar.getCalendar("EVENT", calendarId); console.log("Successfully retrieved event calendar with id: " + calendarId); } catch(err) { console.log("Error: " + err.name); }
[Constructor(AccountId accountId, DOMString name, CalendarType type)] interface Calendar { readonly attribute CalendarId id; readonly attribute DOMString name; readonly attribute AccountId? accountId; CalendarItem get(CalendarItemId id) raises(WebAPIException); void add(CalendarItem item) raises(WebAPIException); void addBatch(CalendarItem[] items, optional CalendarItemArraySuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); void update(CalendarItem item, optional boolean? updateAllInstances) raises(WebAPIException); void updateBatch(CalendarItem[] items, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback, optional boolean? updateAllInstances) raises(WebAPIException); void remove(CalendarItemId id) raises(WebAPIException); void removeBatch(CalendarItemId[] ids, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); void find(CalendarItemArraySuccessCallback successCallback, optional ErrorCallback? errorCallback, optional AbstractFilter? filter, optional SortMode? sortMode) raises(WebAPIException); long addChangeListener(CalendarChangeCallback successCallback) raises(WebAPIException); void removeChangeListener(long watchId) raises(WebAPIException); };
Since: 2.3
This interface offers the following methods to manage events in a calendar:
Code example:
var appId = tizen.application.getCurrentApplication().appInfo.id; tizen.account.getAccounts(function(accounts) { var account = accounts[0]; if(account) { var calendar = new tizen.Calendar( account.id, 'remote calendar', 'TASK' ); // 'calendar' variable is not available until it is inserted into the database. tizen.calendar.addCalendar(calendar); } }, function(e) { console.log('Error: ' + e.message); }, appId);
Calendar(AccountId accountId, DOMString name, CalendarType type);
Since: 1.0
Since: 1.0
Code example:
// Gets the default calendar and show its name. var calendar = tizen.calendar.getDefaultCalendar("EVENT"); console.log('The calendar name is ' + calendar.name);
Since: 2.3
get
CalendarItem get(CalendarItemId id);
Since: 1.0
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.read
Parameters:
Return value:
CalendarItem The matching CalendarItem object.Exceptions:
with error type NotFoundError, if there is no calendar item with the given identifier.
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type InvalidValuesError, if any of the input parameters contain an invalid value.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if this feature is not supported.
with error type UnknownError, if any other error occurs.
Code example:
var myCalendar; // Calendar supposed to be initialized var itemId; // Calendar item identifier try { var item = myCalendar.get(itemId); console.log("Successfully retrieved item with id: " + itemId); } catch(err) { console.log("Error: " + err.name); }
add
void add(CalendarItem item);
Since: 1.0
If the item is successfully inserted in the calendar, the CalendarItem will have its identifier (id attribute) set when the method returns.
To update an existing item, call the update() method instead. If you wish to add a copy of an existing CalendarItem object, call CalendarItem.clone() method first and pass the clone to the add() method.
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.write
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type InvalidValuesError, if any of the input parameters contain an invalid value.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if the feature is not supported.
with error type UnknownError, if any other error occurs.
Code example:
// Gets the default calendar. var calendar = tizen.calendar.getDefaultCalendar("EVENT"); var ev = new tizen.CalendarEvent({description:'HTML5 Introduction', summary:'HTML5 Webinar ', startDate: new tizen.TZDate(2011, 3, 30, 10, 0), duration: new tizen.TimeDuration(1, "HOURS"), location:'Huesca'}); calendar.add(ev); console.log('Event added with uid ' + ev.id.uid);
addBatch
void addBatch(CalendarItem[] items, optional CalendarItemArraySuccessCallback? successCallback, optional ErrorCallback? errorCallback);
Since: 1.0
If all the items are successfully added to the calendar, the success callback will be invoked, passing the list of CalendarItem objects that were added, with their identifier set (id attribute).
The ErrorCallback method is launched with these error types:
If you wish to update an existing item, call the update() method instead. If you wish to add a copy of an existing CalendarItem object, call CalendarItem.clone() method first and pass the clone to the add() method.
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.write
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if the feature is not supported.
Code example:
// Defines the error callback. function errorCallback(response) { console.log( 'The following error occurred: ' + response.name); } function addEventsSuccess(events) { console.log("Successfully added " + events.length + " events!"); } // Gets the default calendar. var calendar = tizen.calendar.getDefaultCalendar("EVENT"); var ev = new tizen.CalendarEvent({description:'HTML5 Introduction', summary:'HTML5 Webinar ', startDate: new tizen.TZDate(2011, 3, 30, 10, 0), duration: new tizen.TimeDuration(1, "HOURS"), location:'Huesca'}); calendar.addBatch([ev], addEventsSuccess, errorCallback);
update
void update(CalendarItem item, optional boolean? updateAllInstances);
Since: 1.0
In case of recurring events, the default behavior is to update all their instances (including their detached ones), as well. If you do not want that, the updateAllInstances flag should be set to false.
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.write
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type InvalidValuesError, if any of the input parameters contain an invalid value.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if the feature is not supported.
with error type UnknownError, if any other error occurs.
Code example:
var myCalendar; // Defines the error callback. function errorCallback(response) { console.log( 'The following error occurred: ' + response.name); } // Defines the event success callback. function eventSearchSuccessCallback(events) { events[0].description = 'New Description'; // Updates the first existing event. myCalendar.update(events[0]); console.log("The first item description was updated!"); } // Gets the default calendar. myCalendar = tizen.calendar.getDefaultCalendar("EVENT"); // Finds all events in a Calendar. myCalendar.find(eventSearchSuccessCallback, errorCallback);
updateBatch
void updateBatch(CalendarItem[] items, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback, optional boolean? updateAllInstances);
Since: 1.0
In case of recurring events, the default behavior is to update all their instances (including their detached ones) as well. The updateAllInstances flag should be set to false to change the default behavior.
The ErrorCallback method is launched with these error types:
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.write
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if the feature is not supported.
Code example:
var myCalendar; // Defines the error callback. function errorCallback(response) { console.log( 'The following error occurred: ' + response.name); } // Defines the success callback. function updateEventsSuccess() { console.log("Successfully updated !" ); } // Defines the event success callback. function eventSearchSuccessCallback(events) { events[0].description = 'New Description 1'; events[1].description = 'New Description 2'; // Updates the first two existing events. myCalendar.updateBatch(events.slice(0,2), updateEventsSuccess, errorCallback); } // Gets the default calendar. myCalendar = tizen.calendar.getDefaultCalendar("EVENT"); // Finds all events in Calendar. myCalendar.find(eventSearchSuccessCallback, errorCallback);
remove
void remove(CalendarItemId id);
Since: 1.0
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.write
Remark : For (recurring) events: In the case of calendar events, if the recurrence ID (rid attribute) is set to null, this method will remove the event identified by uid, and all of its possible detached instances.
Parameters:
Exceptions:
with error type NotFoundError, if the identifier does not match any item in the calendar.
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type InvalidValuesError, if any of the input parameters contain an invalid value.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if the feature is not supported.
with error type UnknownError, if the item could not be removed because of an unknown error.
Code example:
var myCalendar; // Defines the error callback. function errorCallback(response) { console.log( 'The following error occurred: ' + response.name); } // Defines the event success callback. function eventSearchSuccessCallback(events) { // Deletes the first existing event. myCalendar.remove(events[0].id); console.log('The first event was removed'); } // Gets default calendar. myCalendar = tizen.calendar.getDefaultCalendar("EVENT"); // Finds all events in Calendar. myCalendar.find(eventSearchSuccessCallback, errorCallback);
removeBatch
void removeBatch(CalendarItemId[] ids, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
Since: 1.0
The ErrorCallback method is launched with these error types:
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.write
Remark : For (recurring) events: In the case of calendar events, if the recurrence id, rid, is set to null, this method will remove the event identified by uid, as well as all its possible detached instances.
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if the feature is not supported.
Code example:
var myCalendar; // Defines the error callback. function errorCallback(response) { console.log( 'The following error occurred: ' + response.name); } // Defines the removeBatch callback. function removeBatchCallback() { console.log("Requested events were successfully removed."); } // Defines the event search success callback. function eventSearchSuccessCallback(events) { // Deletes the first two existing events. myCalendar.removeBatch([events[0].id, events[1].id], removeBatchCallback, errorCallback); } // Gets the default calendar. myCalendar = tizen.calendar.getDefaultCalendar("EVENT"); // Retrieves all the events in Calendar. myCalendar.find(eventSearchSuccessCallback, errorCallback);
find
void find(CalendarItemArraySuccessCallback successCallback, optional ErrorCallback? errorCallback, optional AbstractFilter? filter, optional SortMode? sortMode);
Since: 1.0
If the filter is passed and contains valid values, only those values in the calendar that match the filter criteria as specified in the AbstractFilter interface will be returned in the successCallback(). If no filter is passed, or the filter contains any invalid value which is null or undefined, then the implementation must return the full list of items in the successCallback(). If no items are available in the calendar (it is empty) or no item matches the filter criteria, the successCallback() will be invoked with an empty array.
The ErrorCallback method is launched with these error types:
Filter specific remarks:
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.read
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if the feature is not supported.
Code example:
// Defines the error callback. function errorCallback(response) { console.log( 'The following error occurred: ' + response.name); } // Defines the event search success callback. function eventSearchSuccessCallback(events) { console.log(events.length + ' results found.'); } // Gets the default calendar. var calendar = tizen.calendar.getDefaultCalendar("EVENT"); // Finds all events the calendar that contain in the summary the string Tizen. var filter = new tizen.AttributeFilter('summary', 'CONTAINS', 'Tizen'); // The events returned by the find() query will be sorted by ascending summary. var sortingMode = new tizen.SortMode('summary', 'ASC'); calendar.find(eventSearchSuccessCallback, errorCallback, filter, sortingMode);
addChangeListener
long addChangeListener(CalendarChangeCallback successCallback);
Since: 1.0
When executed, the implementation must immediately return a subscription identifier that identifies the watch operation. After returning the identifier, the watcher methods are invoked asynchronously.
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.read
Parameters:
Return value:
long The identifier used to clear the watch subscriptionExceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type InvalidValuesError, if any of the input parameters contain an invalid value.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if the feature is not supported.
with error type UnknownError, if any other error occurs.
Code example:
var watcherId = 0; // watcher identifier var calendar; // This example assumes calendar is initialized var watcher = { onitemsadded: function(items) { console.log(items.length + ' items were added'); }, onitemsupdated: function(items) { console.log(items.length + ' items were updated'); }, onitemsremoved: function(ids) { console.log(ids.length + ' items were removed'); } }; // Registers to be notified when the calendar changes. watcherId = calendar.addChangeListener(watcher);
removeChangeListener
void removeChangeListener(long watchId);
Since: 1.0
If the watchId argument is valid and corresponds to a subscription already in place, the watch process must immediately stop and no further callbacks must be invoked. If the watchId argument is not valid or does not correspond to a valid subscription, the method should return without any further action.
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.read
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type InvalidValuesError, if any of the input parameters contain an invalid value.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if the feature is not supported.
with error type UnknownError if any other error occurs.
Code example:
var watcherId = 0; // watcher identifier var calendar; // This example assumes calendar is initialized. // Receives calendar changes. var watcher = { onitemsadded: function(items) { console.log(items.length + ' items were added'); }, onitemsupdated: function(items) { console.log(evitemsents.length + ' items were updated'); }, onitemsremoved: function(ids) { console.log(ids.length + ' items were removed'); } }; // Registers to be notified when the calendar changes. watcherId = calendar.addChangeListener(watcher); // Cancels the watch operation. calendar.removeChangeListener(watcherId);
dictionary CalendarItemInit { DOMString description; DOMString summary; boolean isAllDay; TZDate startDate; TimeDuration duration; DOMString location; SimpleCoordinates geolocation; DOMString organizer; CalendarItemVisibility visibility; CalendarItemStatus status; CalendarItemPriority priority; CalendarAlarm[] alarms; DOMString[] categories; CalendarAttendee[] attendees; };
Since: 1.0
These attributes are shared by both calendar events and tasks.
dictionary CalendarTaskInit: CalendarItemInit { TZDate dueDate; TZDate completedDate; short progress; };
Since: 1.0
It also provides an interface for specifying task attributes upon task creation (in the CalendarTask constructor).
All the attributes are optional and are undefined by default.
This dictionary inherits from: CalendarItemInit
dictionary CalendarEventInit: CalendarItemInit { TZDate endDate; EventAvailability availability; CalendarRecurrenceRule recurrenceRule; };
Since: 1.0
Provides an interface for specifying event attributes upon event creation (in the CalendarEvent constructor).
All the attributes are optional and are undefined by default.
This dictionary inherits from: CalendarItemInit
[NoInterfaceObject] interface CalendarItem { readonly attribute CalendarItemId? id; readonly attribute CalendarId? calendarId; readonly attribute TZDate? lastModificationDate; attribute DOMString? description setraises(WebAPIException); attribute DOMString? summary setraises(WebAPIException); attribute boolean isAllDay setraises(WebAPIException); attribute TZDate? startDate setraises(WebAPIException); attribute TimeDuration? duration setraises(WebAPIException); attribute DOMString? location setraises(WebAPIException); attribute SimpleCoordinates? geolocation setraises(WebAPIException); attribute DOMString? organizer setraises(WebAPIException); attribute CalendarItemVisibility visibility setraises(WebAPIException); attribute CalendarItemStatus status setraises(WebAPIException); attribute CalendarItemPriority priority setraises(WebAPIException); attribute CalendarAlarm[] alarms setraises(WebAPIException); attribute DOMString[] categories setraises(WebAPIException); attribute CalendarAttendee[] attendees setraises(WebAPIException); DOMString convertToString(CalendarTextFormat format) raises(WebAPIException); CalendarItem clone() raises(WebAPIException); };
Since: 1.0
Includes a UID and a possible recurrence ID that is needed to identify a particular instance of a recurring event.
By default, this attribute is set to null.
Since: 1.0
By default, this attribute is set to null.
Since: 2.1
This attribute is automatically populated and cannot be edited by the client. (See RFC 5545 - Section 3.8.7.3).
Since: 1.0
It is usually used to provide a more complete description of the item and any supporting information than what is provided in the summary attribute. (See RFC 5545 - Section 3.8.1.5).
The default value is an empty string.
Since: 1.0
Code example:
event.description = 'Tizen Codefest';
The default value is an empty string.
Since: 1.0
Code example:
event.summary = 'Launching the Tizen reference implementation';
If set to true, then the time and time zone of the startDate are to be ignored and are not guaranteed to be stored in the database. An all-day event always covers the whole day, regardless of which time zone it was defined in and what the current time zone is. The duration must be n*60*24 minutes for an event lasting n days.
The default value for this attribute is false.
Since: 1.0
Code example:
event.isAllDay = true; // All-Day event
The default value for this attribute is null.
startDate must be specified in the same time zone as endDate / dueDate if provided.
This attribute is precise to the second. Milliseconds are ignored.
Since: 1.0
Code example:
// 2010-04-30 09:00 event.startDate = new tizen.TZDate(2010, 3, 30, 9, 0);
By default, this attribute is set to null.
duration and endDate / dueDate are mutually exclusive, hence, only one of them can be non-null.
This attribute is precise to the second. Milliseconds are ignored.
Since: 1.0
Remark : Note that the implementation may not save the duration itself, rather convert it to the corresponding endDate/dueDate attribute and save it. For example, if you set the startDate and the duration attributes and save the item, you may see that the duration is null while endDate/dueDate is non-null after retrieving it because the implementation has calculated the endDate/dueDate based on the duration and the startDate then saved it, not the duration.
Code example:
// 1 hour meeting event.duration = new tizen.TimeDuration(1, "HOURS");
The default value for this attribute is an empty string.
Since: 1.0
Code example:
event.location = 'Huesca';
Since: 1.0
Code example:
event.geolocation = new tizen.SimpleCoordinates(60.175, 24.934);
By default, this attribute is initialized to an empty string.
Since: 1.0
Code example:
event.organizer = 'Mr. Jones';
The default value is PUBLIC.
Since: 1.0
For an event, the default value is CONFIRMED. For a task, the default value is NEEDS_ACTION.
Since: 1.0
Code example:
event.status = "TENTATIVE";
The default value for this attribute is LOW priority.
If the native item database supports another priority schema (such as a range from 1 to 9), the implementation must convert those values to the supported values. For instance, RFC 5545 suggests the following mapping for a range from 1 to 9:
Since: 1.0
Code example:
task.priority = "HIGH";
Since: 1.0
Code example:
ev.startDate = new tizen.TZDate(2011, 2, 11, 8, 0, 0); // Gives a sound notification 30 minutes before the item's start time. var alarm = new tizen.CalendarAlarm(new tizen.TimeDuration(30, "MINS"), "SOUND"); ev.alarms = [alarm];
Examples of categories are personal, work, vacation, travel, and so on.
By default, this attribute is set to an empty array.
Since: 1.0
Code example:
event.categories = ['Personal'];
By default, this attribute is set to an empty array.
Since: 1.0
Code example:
var attendee = new tizen.CalendarAttendee('mailto:bob@domain.com', {role: "CHAIR", RSVP: true}); event.attendees = [attendee];
convertToString
DOMString convertToString(CalendarTextFormat format);
Since: 1.0
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.read
Parameters:
Return value:
DOMString The representation of the Calendar itemExceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type InvalidValuesError, if any of the input parameters contain an invalid value.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if the feature is not supported.
with error type UnknownError, if any other error occurs.
Code example:
// Defines the event search success callback. function eventSearchSuccessCallback(events) { // Converts the first event to iCalendar 2.0 format (default). var vevent = events[0].convertToString("ICALENDAR_20"); console.log('iCalendar 2.0 representation of the event is: ' + vevent); } function errorCallback(response) { console.log( 'The following error occurred: ' + response.name); } // Gets the default calendar. var myCalendar = tizen.calendar.getDefaultCalendar("EVENT"); // Finds all events in the first calendar that contain in the summary the string Tizen. var filter = new tizen.AttributeFilter('summary', 'CONTAINS', 'Tizen'); myCalendar.find(eventSearchSuccessCallback, errorCallback, filter);
clone
CalendarItem clone();
Since: 1.0
The CalendarItem object returned by the clone() method will have its identifier set to null and will be detached from any calendar.
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.read
Return value:
CalendarItem New clone of the CalendarItem objectExceptions:
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if the feature is not supported.
with error type UnknownError if any other error occurs.
Code example:
// Gets the default calendar. var calendar = tizen.calendar.getDefaultCalendar(); var html5seminar = new tizen.CalendarEvent({startDate: new tizen.TZDate(2012, 3, 4), duration: new tizen.TimeDuration(3, "DAYS"), summary: "HTML5 Seminar"}); calendar.add(html5seminar); var tizenseminar = html5seminar.clone(); tizenseminar.summary = "Tizen Seminar"; calendar.add(tizenseminar);
[Constructor(optional CalendarTaskInit? taskInitDict), Constructor(DOMString stringRepresentation, CalendarTextFormat format)] interface CalendarTask : CalendarItem { attribute TZDate? dueDate setraises(WebAPIException); attribute TZDate? completedDate setraises(WebAPIException); attribute unsigned short progress setraises(WebAPIException); };
Since: 1.0
Code example:
var taskCalendar, task; try { var task = new tizen.CalendarTask("BEGIN:VCALENDAR\r\n" + "VERSION:2.0\r\n" + "BEGIN:VTODO\r\n" + "DTSTAMP:TZID=CET:20110902T110000Z\r\n" + "DTSTART;TZID=CET:20110906T140000Z\r\n" + "DUE;TZID=CET:20110906T150000Z\r\n" + "SUMMARY:Discuss the schedule\r\n" + "DESCRIPTION:Find the feasible schedule\r\n" + "CATEGORIES:HUMAN RESOURCES\r\n" + "END:VTODO\r\n" + "END:VCALENDAR", "ICALENDAR_20"); taskCalendar = tizen.calendar.getDefaultCalendar("TASK"); taskCalendar.add(task); console.log("Task added with ID " + task.id); } catch (err) { console.log("Failed to add VTODO to the calendar, error: " + err.name); }
CalendarTask(optional CalendarTaskInit? taskInitDict);
CalendarTask(DOMString stringRepresentation, CalendarTextFormat format);
This dueDate must be in the same time zone as the startDate. The duration and dueDate are mutually exclusive, so only one of them can be non-null.
This attribute is precise to the second. Milliseconds are ignored.
The default value is null. If no value is provided, the task does not have a due date.
Since: 1.0
Code example:
task.dueDate = new tizen.TZDate(2011, 2, 11);
This attribute is precise to the second. Milliseconds are ignored.
The default value is null. If no value is provided, the task is not completed yet.
Since: 1.0
Code example:
task.completedDate = new tizen.TZDate(2011, 2, 11);
The value is a positive integer between 0 and 100. A value of 0 indicates the task has not been started yet. A value of 100 indicates that the task has been completed.
Integer values in between indicate the percent partially complete. (See RFC 5545 - Section 3.8.1.8).
The default value is 0, implies that the task has not been started.
Since: 1.0
Code example:
task.progress = 50; // 50% done
[Constructor(optional CalendarEventInit? eventInitDict), Constructor(DOMString stringRepresentation, CalendarTextFormat format)] interface CalendarEvent : CalendarItem { readonly attribute boolean isDetached; attribute TZDate? endDate setraises(WebAPIException); attribute EventAvailability availability setraises(WebAPIException); attribute CalendarRecurrenceRule? recurrenceRule setraises(WebAPIException); void expandRecurrence(TZDate startDate, TZDate endDate, CalendarEventArraySuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); };
Since: 1.0
Code example:
// Gets the default calendar. var calendar = tizen.calendar.getDefaultCalendar("EVENT"); try { var ev = new tizen.CalendarEvent("BEGIN:VCALENDAR\r\n" + "BEGIN:VEVENT\r\n" + "DTSTAMP:19970901T1300Z\r\n" + "DTSTART:19970903T163000Z\r\n" + "DTEND:19970903T190000Z\r\n" + "SUMMARY:Annual Employee Review\r\n" + "CATEGORIES:BUSINESS,HUMAN RESOURCES\r\n" + "END:VEVENT\r\n" + "END:VCALENDAR", "ICALENDAR_20"); calendar.add(ev); console.log('Event added with UID ' + ev.id.uid); } catch (err) { console.log("Failed to add VEVENT to the calendar, error: " + err.name); }
CalendarEvent(optional CalendarEventInit? eventInitDict);
CalendarEvent(DOMString stringRepresentation, CalendarTextFormat format);
Since: 1.0
(see RFC 5545 - Section 3.8.2.2).
This endDate must be in the same time zone as the startDate. Note that duration and endDate are mutually exclusive, only one of them can be non-null.
This attribute is precise to the second. Milliseconds are ignored.
The default value for this attribute is null.
Since: 1.0
Code example:
// 2010-04-30 09:00 event.endDate = new tizen.TZDate(2010, 3, 30, 9, 0);
The default value is BUSY.
Since: 1.0
The generated instances of a recurring event will have the same recurrence rule as their parent. This is useful when editing a particular event instance and choosing to update all instances from it.
The detached instances (specific instances that have been modified as saved to the calendar) of a recurring event will not have any recurrence rule. No recurrence rule can be set on detached instances either. If one tries to set a recurrence rule on a detached event, a NotSupportedError should be thrown. Detached instances can be distinguished by checking their isDetached attribute. (See RFC 5545, Section 3.3.10.)
Since: 1.0
Code example:
// Repeats daily for 7 days. var rule = new tizen.CalendarRecurrenceRule("DAILY", {occurrenceCount: 7}); event.recurrenceRule = rule;
expandRecurrence
void expandRecurrence(TZDate startDate, TZDate endDate, CalendarEventArraySuccessCallback successCallback, optional ErrorCallback? errorCallback);
Since: 1.0
This method takes into consideration all the parameters of the event recurrence rule to generate the instances occurring in a given time interval.
The call involves retrieving from the database detached instances of an event to replace their corresponding virtual instances in the returned list. The client can then use CalendarEvent.isDetached attribute to identify detached instances. If the event is not saved to a calendar yet, only virtual instances will be returned.
The ErrorCallback method is launched with these error types:
Privilege level: public
Privilege: http://tizen.org/privilege/calendar.read
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if the feature is not supported.
Code example:
// eventId should be set to ID of event obtained with the find function. var eventId; // Defines the error callback. function errorCallback(response) { console.log( 'The following error occurred: ' + response.name); } // Defines the event expanding success callback. function eventExpandingSuccessCallback(events) { console.log(events.length + ' event instances were returned.'); } var calendar = tizen.calendar.getDefaultCalendar(); var event = calendar.get(eventId); if (event.recurrenceRule != null) { // This is a recurring event. Expands all the instances during August 2011. event.expandRecurrence(new tizen.TZDate(2011, 7, 1), new tizen.TZDate(2011, 7, 31), eventExpandingSuccessCallback, errorCallback); }
dictionary CalendarAttendeeInit { DOMString name; AttendeeRole role; AttendeeStatus status; boolean RSVP; AttendeeType type; DOMString? group; DOMString delegatorURI; DOMString delegateURI; ContactRef contactRef; };
Since: 1.0
See CalendarAttendee interface for more information about the members.
[Constructor(DOMString uri, optional CalendarAttendeeInit? attendeeInitDict)] interface CalendarAttendee { attribute DOMString uri; attribute DOMString? name; attribute AttendeeRole role; attribute AttendeeStatus status; attribute boolean RSVP; attribute AttendeeType type; attribute DOMString? group; attribute DOMString? delegatorURI; attribute DOMString? delegateURI; attribute ContactRef? contactRef; };
Since: 1.0
By default, each of the attributes of this interface are undefined.
(For more details, see RFC 5545, Section 3.8.4.1.)
Code example:
var attendee = new tizen.CalendarAttendee('mailto:bob@domain.com', {role: "CHAIR", RSVP: true}); event.attendees = [attendee];
CalendarAttendee(DOMString uri, optional CalendarAttendeeInit? attendeeInitDict);
This is often an email in the form 'mailto:name@domain.com'.
Since: 1.0
Since: 1.0
(See RFC 5545, Section 3.2.16.)
The default value is REQ_PARTICIPANT.
Since: 1.0
The default value is PENDING.
Since: 1.0
By default, this attribute is set to FALSE.
Since: 1.0
The default value is INDIVIDUAL.
Since: 1.0
Since: 1.0
Since: 1.0
Since: 1.0
If the contact is not resolved, this attribute will be set to null. For more information, see the Contact API.
Since: 1.0
dictionary CalendarRecurrenceRuleInit { short interval; TZDate untilDate; long occurrenceCount; ByDayValue[] daysOfTheWeek; short[] setPositions; TZDate[] exceptions; };
Since: 1.0
For more information about the members, see CalendarRecurrenceRule interface.
[Constructor(RecurrenceRuleFrequency frequency, optional CalendarRecurrenceRuleInit? ruleInitDict)] interface CalendarRecurrenceRule { attribute RecurrenceRuleFrequency frequency; attribute unsigned short interval; attribute TZDate? untilDate; attribute long occurrenceCount; attribute ByDayValue[] daysOfTheWeek; attribute short[] setPositions; attribute TZDate[] exceptions; };
Since: 1.0
Code example:
// Repeats daily for 7 days. var rule = new tizen.CalendarRecurrenceRule("DAILY", {occurrenceCount:7}); event.recurrenceRule = rule;
CalendarRecurrenceRule(RecurrenceRuleFrequency frequency, optional CalendarRecurrenceRuleInit? ruleInitDict);
This property corresponds to FREQ in RFC 5545.
Since: 1.0
This attribute is linked to the frequency attribute and for an interval of n, the event will recur every n of recurrence attribute.
For example, if the interval attribute is set to 2 and frequency attribute is set to WEEKLY, then the event will recur every 2 weeks.
The default interval value is 1, that is, every day if the CalendarRecurrenceRule frequency attribute is DAILY, every week if frequency is WEEKLY, every month if frequency is MONTHLY or every year if frequency is YEARLY.
This property corresponds to INTERVAL in RFC 5545.
Since: 1.0
By default, this attribute is set to null, meaning that the event recurs infinitely, unless occurrenceCount is set.
This attribute is precise to the second. Milliseconds are ignored.
This property corresponds to UNTIL in RFC 5545.
Since: 1.0
The recurrence duration of an event can be defined using either an end date (untilDate attribute) or a number of occurrences (occurrenceCount attribute).
By default, this attribute is set to -1, meaning that the event recurs infinitely, unless untilDate is set.
This property corresponds to COUNT in RFC 5545.
Since: 1.0
This property value is valid only for recurrence rules with a frequency type of WEEKLY, MONTHLY, and YEARLY.
This property corresponds to BYDAY in RFC 5545.
By default, this attribute is set to an empty array.
Since: 1.0
For example, a yearly recurrence rule that has a daysOfTheWeek value that specifies Monday through Friday, and a setPositions array containing 2 and -1, occurs only on the second weekday and last weekday of every year.
Values can be from 1 to 366 or -366 to -1. Negative values indicate counting backwards from the end of the recurrence rule's frequency (week, month, or year).
This attribute must only be used in conjunction with another BYxxx rule part (such as daysOfTheWeek).
This property corresponds to BYSETPOS in RFC 5545.
By default, this attribute is set to an empty array.
Since: 1.0
This attribute is precise to the second. Milliseconds are ignored.
This property corresponds to EXDATE in RFC 5545.
By default, this attribute is set to an empty array.
Since: 1.0
[Constructor(DOMString uid, optional DOMString? rid)] interface CalendarEventId { attribute DOMString uid; attribute DOMString? rid; };
Since: 1.0
The recurrence identifier (rid attribute) is used to identify a particular instance of a recurring event. All instances of the same recurring event have the same UID but different recurrence IDs.
CalendarEventId(DOMString uid, optional DOMString? rid);
This value is assigned by the platform when the event is added to the calendar, it is locally unique and persistent for the life time of the event and it cannot be modified by the developers.
See RFC 5545 (section 3.8.4.7) for more details about this parameter and algorithms to guarantee assignment of unique values. This value is assigned by the platform when the add() method is successfully invoked.
Since: 1.0
This attribute is used in conjunction with the uid property to identify a specific instance of a recurring event.
The parent of a recurrence instance has its rid set to null.
By default, this attribute is set to null. (See RFC 5545 (section 3.8.4.4) for more details about this parameter.)
Since: 1.0
[Constructor(TZDate absoluteDate, AlarmMethod method, optional DOMString? description), Constructor(TimeDuration before, AlarmMethod method, optional DOMString? description)] interface CalendarAlarm { attribute TZDate? absoluteDate setraises(WebAPIException); attribute TimeDuration? before setraises(WebAPIException); attribute AlarmMethod method setraises(WebAPIException); attribute DOMString? description; };
Since: 1.0
Code example:
// Creates a sound alarm 30 minutes before the event's start time. var alarm = new tizen.CalendarAlarm(new tizen.TimeDuration(30, "MINS"), "SOUND");
CalendarAlarm(TZDate absoluteDate, AlarmMethod method, optional DOMString? description);
CalendarAlarm(TimeDuration before, AlarmMethod method, optional DOMString? description);
absoluteDate and before are mutually exclusive.
This attribute is precise to the second. Milliseconds are ignored.
Since: 1.0
The duration should be positive.
absoluteDate and before are mutually exclusive.
This attribute is precise to the second. Milliseconds are ignored.
Since: 1.0
Since: 1.0
When the method is DISPLAY, the alarm must also include a description attribute, which contains the text to be displayed when the alarm is triggered.
The default value is an empty string.
Since: 1.0
[Callback=FunctionOnly, NoInterfaceObject] interface CalendarEventArraySuccessCallback { void onsuccess(CalendarEvent[] events); };
Since: 1.0
onsuccess
void onsuccess(CalendarEvent[] events);
Since: 1.0
Parameters:
[Callback=FunctionOnly, NoInterfaceObject] interface CalendarItemArraySuccessCallback { void onsuccess(CalendarItem[] items); };
Since: 1.0
onsuccess
void onsuccess(CalendarItem[] items);
Since: 1.0
Parameters:
[Callback=FunctionOnly, NoInterfaceObject] interface CalendarArraySuccessCallback { void onsuccess(Calendar[] calendars); };
Since: 1.0
onsuccess
void onsuccess(Calendar[] calendars);
Since: 1.0
Parameters:
[Callback, NoInterfaceObject] interface CalendarChangeCallback { void onitemsadded(CalendarItem[] items); void onitemsupdated(CalendarItem[] items); void onitemsremoved(CalendarItemId[] ids); };
Since: 1.0
onitemsadded
void onitemsadded(CalendarItem[] items);
Since: 1.0
Parameters:
onitemsupdated
void onitemsupdated(CalendarItem[] items);
Since: 1.0
Parameters:
onitemsremoved
void onitemsremoved(CalendarItemId[] ids);
Since: 1.0
Parameters:
module Calendar { typedef DOMString CalendarId; typedef DOMString CalendarTaskId; typedef (CalendarEventId or CalendarTaskId) CalendarItemId; enum CalendarType { "EVENT", "TASK" }; enum CalendarTextFormat { "ICALENDAR_20", "VCALENDAR_10" }; enum AlarmMethod { "SOUND", "DISPLAY" }; enum RecurrenceRuleFrequency { "DAILY", "WEEKLY", "MONTHLY", "YEARLY" }; enum ByDayValue { "MO", "TU", "WE", "TH", "FR", "SA", "SU" }; enum EventAvailability { "BUSY", "FREE" }; enum AttendeeType { "INDIVIDUAL", "GROUP", "RESOURCE", "ROOM", "UNKNOWN" }; enum AttendeeStatus { "PENDING", "ACCEPTED", "DECLINED", "TENTATIVE", "DELEGATED", "COMPLETED", "IN_PROCESS" }; enum AttendeeRole { "REQ_PARTICIPANT", "OPT_PARTICIPANT", "NON_PARTICIPANT", "CHAIR" }; enum CalendarItemPriority { "HIGH", "MEDIUM", "LOW" }; enum CalendarItemVisibility { "PUBLIC", "PRIVATE", "CONFIDENTIAL" }; enum CalendarItemStatus { "TENTATIVE", "CONFIRMED", "CANCELLED", "NEEDS_ACTION", "IN_PROCESS", "COMPLETED" }; [NoInterfaceObject] interface CalendarManagerObject{ readonly attribute CalendarManager calendar; }; Tizen implements CalendarManagerObject; [NoInterfaceObject] interface CalendarManager { void getCalendars(CalendarType type, CalendarArraySuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); Calendar getUnifiedCalendar(CalendarType type) raises(WebAPIException); Calendar getDefaultCalendar(CalendarType type) raises(WebAPIException); void addCalendar(Calendar calendar) raises(WebAPIException); void removeCalendar(CalendarType type, CalendarId id) raises(WebAPIException); Calendar getCalendar(CalendarType type, CalendarId id) raises(WebAPIException); }; [Constructor(AccountId accountId, DOMString name, CalendarType type)] interface Calendar { readonly attribute CalendarId id; readonly attribute DOMString name; readonly attribute AccountId? accountId; CalendarItem get(CalendarItemId id) raises(WebAPIException); void add(CalendarItem item) raises(WebAPIException); void addBatch(CalendarItem[] items, optional CalendarItemArraySuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); void update(CalendarItem item, optional boolean? updateAllInstances) raises(WebAPIException); void updateBatch(CalendarItem[] items, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback, optional boolean? updateAllInstances) raises(WebAPIException); void remove(CalendarItemId id) raises(WebAPIException); void removeBatch(CalendarItemId[] ids, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); void find(CalendarItemArraySuccessCallback successCallback, optional ErrorCallback? errorCallback, optional AbstractFilter? filter, optional SortMode? sortMode) raises(WebAPIException); long addChangeListener(CalendarChangeCallback successCallback) raises(WebAPIException); void removeChangeListener(long watchId) raises(WebAPIException); }; dictionary CalendarItemInit { DOMString description; DOMString summary; boolean isAllDay; TZDate startDate; TimeDuration duration; DOMString location; SimpleCoordinates geolocation; DOMString organizer; CalendarItemVisibility visibility; CalendarItemStatus status; CalendarItemPriority priority; CalendarAlarm[] alarms; DOMString[] categories; CalendarAttendee[] attendees; }; dictionary CalendarTaskInit: CalendarItemInit { TZDate dueDate; TZDate completedDate; short progress; }; dictionary CalendarEventInit: CalendarItemInit { TZDate endDate; EventAvailability availability; CalendarRecurrenceRule recurrenceRule; }; [NoInterfaceObject] interface CalendarItem { readonly attribute CalendarItemId? id; readonly attribute CalendarId? calendarId; readonly attribute TZDate? lastModificationDate; attribute DOMString? description setraises(WebAPIException); attribute DOMString? summary setraises(WebAPIException); attribute boolean isAllDay setraises(WebAPIException); attribute TZDate? startDate setraises(WebAPIException); attribute TimeDuration? duration setraises(WebAPIException); attribute DOMString? location setraises(WebAPIException); attribute SimpleCoordinates? geolocation setraises(WebAPIException); attribute DOMString? organizer setraises(WebAPIException); attribute CalendarItemVisibility visibility setraises(WebAPIException); attribute CalendarItemStatus status setraises(WebAPIException); attribute CalendarItemPriority priority setraises(WebAPIException); attribute CalendarAlarm[] alarms setraises(WebAPIException); attribute DOMString[] categories setraises(WebAPIException); attribute CalendarAttendee[] attendees setraises(WebAPIException); DOMString convertToString(CalendarTextFormat format) raises(WebAPIException); CalendarItem clone() raises(WebAPIException); }; [Constructor(optional CalendarTaskInit? taskInitDict), Constructor(DOMString stringRepresentation, CalendarTextFormat format)] interface CalendarTask : CalendarItem { attribute TZDate? dueDate setraises(WebAPIException); attribute TZDate? completedDate setraises(WebAPIException); attribute unsigned short progress setraises(WebAPIException); }; [Constructor(optional CalendarEventInit? eventInitDict), Constructor(DOMString stringRepresentation, CalendarTextFormat format)] interface CalendarEvent : CalendarItem { readonly attribute boolean isDetached; attribute TZDate? endDate setraises(WebAPIException); attribute EventAvailability availability setraises(WebAPIException); attribute CalendarRecurrenceRule? recurrenceRule setraises(WebAPIException); void expandRecurrence(TZDate startDate, TZDate endDate, CalendarEventArraySuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); }; dictionary CalendarAttendeeInit { DOMString name; AttendeeRole role; AttendeeStatus status; boolean RSVP; AttendeeType type; DOMString? group; DOMString delegatorURI; DOMString delegateURI; ContactRef contactRef; }; [Constructor(DOMString uri, optional CalendarAttendeeInit? attendeeInitDict)] interface CalendarAttendee { attribute DOMString uri; attribute DOMString? name; attribute AttendeeRole role; attribute AttendeeStatus status; attribute boolean RSVP; attribute AttendeeType type; attribute DOMString? group; attribute DOMString? delegatorURI; attribute DOMString? delegateURI; attribute ContactRef? contactRef; }; dictionary CalendarRecurrenceRuleInit { short interval; TZDate untilDate; long occurrenceCount; ByDayValue[] daysOfTheWeek; short[] setPositions; TZDate[] exceptions; }; [Constructor(RecurrenceRuleFrequency frequency, optional CalendarRecurrenceRuleInit? ruleInitDict)] interface CalendarRecurrenceRule { attribute RecurrenceRuleFrequency frequency; attribute unsigned short interval; attribute TZDate? untilDate; attribute long occurrenceCount; attribute ByDayValue[] daysOfTheWeek; attribute short[] setPositions; attribute TZDate[] exceptions; }; [Constructor(DOMString uid, optional DOMString? rid)] interface CalendarEventId { attribute DOMString uid; attribute DOMString? rid; }; [Constructor(TZDate absoluteDate, AlarmMethod method, optional DOMString? description), Constructor(TimeDuration before, AlarmMethod method, optional DOMString? description)] interface CalendarAlarm { attribute TZDate? absoluteDate setraises(WebAPIException); attribute TimeDuration? before setraises(WebAPIException); attribute AlarmMethod method setraises(WebAPIException); attribute DOMString? description; }; [Callback=FunctionOnly, NoInterfaceObject] interface CalendarEventArraySuccessCallback { void onsuccess(CalendarEvent[] events); }; [Callback=FunctionOnly, NoInterfaceObject] interface CalendarItemArraySuccessCallback { void onsuccess(CalendarItem[] items); }; [Callback=FunctionOnly, NoInterfaceObject] interface CalendarArraySuccessCallback { void onsuccess(Calendar[] calendars); }; [Callback, NoInterfaceObject] interface CalendarChangeCallback { void onitemsadded(CalendarItem[] items); void onitemsupdated(CalendarItem[] items); void onitemsremoved(CalendarItemId[] ids); }; };