diff options
Diffstat (limited to 'comm/calendar/base/public/calICalendarProvider.idl')
-rw-r--r-- | comm/calendar/base/public/calICalendarProvider.idl | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/comm/calendar/base/public/calICalendarProvider.idl b/comm/calendar/base/public/calICalendarProvider.idl new file mode 100644 index 0000000000..e6adf7a060 --- /dev/null +++ b/comm/calendar/base/public/calICalendarProvider.idl @@ -0,0 +1,89 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIURI; +interface calICalendar; +interface nsIVariant; +interface calIProviderListener; + +/** + * High-level interface to allow providers to be pluggable. + */ +[scriptable, uuid(30e22db4-9f13-11d9-80d6-000b7d081f44)] +interface calICalendarProvider : nsISupports +{ + /** + * The type of provider, this may be used as a key to uniquely identify a + * provider and should match the type= part of the contract id of both the + * provider and the matching calICalendar implementation. + */ + readonly attribute AUTF8String type; + + /** + * The way to refer to this provider in UI for the end-user + * (eg "Shared ICS File"). + */ + readonly attribute AUTF8String displayName; + + /** + * The way to refer to this provider in the UI when needing to display a short + * label to describe the type (eg "CalDAV", "ICS", etc.). This is different + * from the type attribute as it's not meant to be used as unique identifier + * but only as a shorter non-localized label. + */ + readonly attribute AUTF8String shortName; + + /** + * Delete a calendar. Deletes the actual underlying calendar, which + * could be (for example) a file or a calendar on a server + * + * @param aCalendar the calendar to delete + * @param aListener where to call the results back to + */ + void deleteCalendar(in calICalendar aCalendar, + in calIProviderListener aListener); + + /** + * Detect calendars using the given parameters (location, username, etc.). + * + * @param username The username to use. + * @param password The password to use. + * @param location The location to use. It could be a hostname, a + * specific URL, the origin URL, etc. + * @param savePassword Whether to save the password or not. + * @param extraProperties Any additional properties needed. + * @return Promise resolved with an array of found calendars. + * (Array<calICalendar>). If no calendars were + * found, resolved with an empty array. If an + * error occurs, rejected with the error. + */ + Promise detectCalendars(in AUTF8String username, in AUTF8String password, + in AUTF8String location, in boolean savePassword, + [optional] in jsval extraProperties); +}; + +[scriptable, uuid(0eebe99e-a22d-11d9-87a6-000b7d081f44)] +interface calIProviderListener : nsISupports +{ + /** + * @param aStatus status code summarizing what happened + * @param aDetail not yet fully specified. If aStatus is an error + * result, this will probably be an extended error + * string (eg one returned by a server). + */ + void onCreateCalendar(in calICalendar aCalendar, in nsresult aStatus, + in nsIVariant aDetail); + + /** + * @param aStatus status code summarizing what happened + * @param aDetail not yet fully specified. If aStatus is an error + * result, this will probably be an extended error + * string (eg one returned by a server). + */ + void onDeleteCalendar(in calICalendar aCalendar, in nsresult aStatus, + in nsIVariant aDetail); +}; |