2004-11-11 00:25:38 +03:00
|
|
|
/* -*- Mode: idl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2004-10-27 01:27:59 +04:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is Oracle Corporation code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Oracle Corporation
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2004
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Vladimir Vukicevic <vladimir.vukicevic@oracle.com>
|
2004-12-10 03:15:22 +03:00
|
|
|
* Mike Shaver <shaver@mozilla.org>
|
2004-10-27 01:27:59 +04:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
2004-11-02 22:26:42 +03:00
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2004-11-11 00:25:38 +03:00
|
|
|
interface nsIArray;
|
2004-11-04 00:48:23 +03:00
|
|
|
interface nsIMutableArray;
|
2004-11-30 03:23:37 +03:00
|
|
|
interface nsISimpleEnumerator;
|
|
|
|
interface nsIVariant;
|
2004-11-11 00:25:38 +03:00
|
|
|
|
|
|
|
interface nsIPropertyBag;
|
2004-10-27 01:27:59 +04:00
|
|
|
|
|
|
|
interface calICalendar;
|
2004-11-11 00:25:38 +03:00
|
|
|
|
|
|
|
interface calIDateTime;
|
|
|
|
|
2006-02-24 02:14:14 +03:00
|
|
|
interface calIDuration;
|
|
|
|
|
2004-11-11 00:25:38 +03:00
|
|
|
interface calIRecurrenceInfo;
|
2004-10-27 01:27:59 +04:00
|
|
|
|
2004-12-01 23:52:31 +03:00
|
|
|
interface calIAttendee;
|
|
|
|
|
2004-12-10 03:15:22 +03:00
|
|
|
interface calIIcalComponent;
|
|
|
|
|
2004-10-27 01:27:59 +04:00
|
|
|
//
|
|
|
|
// calIItemBase
|
|
|
|
//
|
|
|
|
// Base for Events, Todos, Journals, etc.
|
|
|
|
//
|
|
|
|
|
2005-06-10 05:31:48 +04:00
|
|
|
[scriptable, uuid(18521d75-346d-4616-8778-de2c4a9a676e)]
|
2004-11-04 00:48:23 +03:00
|
|
|
interface calIItemBase : nsISupports
|
2004-10-27 01:27:59 +04:00
|
|
|
{
|
2004-11-16 03:24:17 +03:00
|
|
|
// returns true if this thing is able to be modified;
|
|
|
|
// if the item is not mutable, attempts to modify
|
|
|
|
// any data will throw CAL_ERROR_ITEM_IS_IMMUTABLE
|
|
|
|
readonly attribute boolean isMutable;
|
|
|
|
|
|
|
|
// makes this item immutable
|
|
|
|
void makeImmutable();
|
|
|
|
|
|
|
|
// clone always returns a mutable event
|
|
|
|
calIItemBase clone();
|
2004-11-11 00:25:38 +03:00
|
|
|
|
|
|
|
//
|
|
|
|
// the generation number of this item; 0 means
|
|
|
|
// that it's never been stored in a store
|
|
|
|
//
|
2004-12-12 00:17:36 +03:00
|
|
|
readonly attribute PRUint32 generation;
|
2004-10-27 01:27:59 +04:00
|
|
|
|
|
|
|
// the time when this item was created
|
2004-11-11 00:25:38 +03:00
|
|
|
readonly attribute calIDateTime creationDate;
|
|
|
|
|
|
|
|
// last time any attribute was modified on this item, in UTC
|
2004-12-10 14:22:48 +03:00
|
|
|
readonly attribute calIDateTime lastModifiedTime;
|
2004-10-27 01:27:59 +04:00
|
|
|
|
2004-12-19 01:59:51 +03:00
|
|
|
// last time a "significant change" was made to this item
|
|
|
|
readonly attribute calIDateTime stampTime;
|
|
|
|
|
|
|
|
// indicate such a "significant change"
|
|
|
|
void updateStampTime();
|
|
|
|
|
2004-10-27 01:27:59 +04:00
|
|
|
// the calICalendar to which this event belongs
|
2005-06-04 00:46:36 +04:00
|
|
|
attribute calICalendar calendar;
|
2004-10-27 01:27:59 +04:00
|
|
|
|
|
|
|
// the ID of this event
|
|
|
|
attribute AUTF8String id;
|
|
|
|
|
|
|
|
// event title
|
|
|
|
attribute AUTF8String title;
|
|
|
|
|
|
|
|
// event priority
|
|
|
|
attribute short priority;
|
2004-12-13 12:50:30 +03:00
|
|
|
attribute AUTF8String privacy;
|
2004-10-27 01:27:59 +04:00
|
|
|
|
2004-12-13 12:50:30 +03:00
|
|
|
// status of the event
|
|
|
|
attribute AUTF8String status;
|
2004-10-27 01:27:59 +04:00
|
|
|
|
|
|
|
// ical interop; writing this means parsing
|
|
|
|
// the ical string into this event
|
|
|
|
attribute AUTF8String icalString;
|
|
|
|
|
2004-12-10 03:15:22 +03:00
|
|
|
// an icalComponent for this item, suitable for serialization.
|
|
|
|
// the icalComponent returned is not live: changes in it or this
|
|
|
|
// item will not be reflected in the other.
|
2004-12-15 19:22:01 +03:00
|
|
|
attribute calIIcalComponent icalComponent;
|
2004-12-10 03:15:22 +03:00
|
|
|
|
2004-10-27 01:27:59 +04:00
|
|
|
//
|
2006-02-24 02:14:14 +03:00
|
|
|
// alarms
|
2004-10-27 01:27:59 +04:00
|
|
|
//
|
2006-02-24 02:14:14 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The amount of time from the date (specified by alarmRelated) to offset
|
|
|
|
* the alarm's firing time by
|
|
|
|
*/
|
|
|
|
attribute calIDuration alarmOffset;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* One of the ALARM_RELATED constants below.
|
|
|
|
*/
|
|
|
|
attribute unsigned long alarmRelated;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Corresponds to an alarmOffset that should be based off of the startDate or
|
|
|
|
* entryDate (for events and tasks, respectively)
|
|
|
|
*/
|
|
|
|
const unsigned long ALARM_RELATED_START = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Corresponds to an alarmOffset that should be based off of the endDate or
|
|
|
|
* dueDate (for events and tasks, respectively)
|
|
|
|
*/
|
|
|
|
const unsigned long ALARM_RELATED_END = 1;
|
|
|
|
|
|
|
|
// The last time this alarm was fired and acknowledged by the user
|
|
|
|
attribute calIDateTime alarmLastAck;
|
2004-10-27 01:27:59 +04:00
|
|
|
|
|
|
|
//
|
|
|
|
// recurrence
|
|
|
|
//
|
2004-12-14 06:27:32 +03:00
|
|
|
attribute calIRecurrenceInfo recurrenceInfo;
|
2006-02-26 04:54:49 +03:00
|
|
|
readonly attribute calIDateTime recurrenceStartDate;
|
2004-10-27 01:27:59 +04:00
|
|
|
|
|
|
|
// attachments
|
|
|
|
// array of nsIMsgAttachment
|
2004-11-16 03:24:17 +03:00
|
|
|
// if this item is mutable, the returned array will be a nsIMutableArray
|
|
|
|
readonly attribute nsIArray attachments;
|
2004-10-27 01:27:59 +04:00
|
|
|
|
2005-06-10 05:31:48 +04:00
|
|
|
//
|
|
|
|
// All event properties are stored in a property bag;
|
|
|
|
// some number of these are "promoted" to top-level
|
|
|
|
// accessor attributes. For example, "SUMMARY" is
|
|
|
|
// promoted to the top-level "title" attribute.
|
2004-10-27 01:27:59 +04:00
|
|
|
//
|
2005-06-10 05:31:48 +04:00
|
|
|
// The isPropertyPromoted() attribute can will indicate
|
|
|
|
// if a particular property is promoted or not, for
|
|
|
|
// serialization purposes.
|
2004-10-27 01:27:59 +04:00
|
|
|
//
|
|
|
|
|
2005-06-10 05:31:48 +04:00
|
|
|
// Note that if this item is a proxy, then any requests for
|
|
|
|
// non-existant properties will be forward to the parent item.
|
|
|
|
|
|
|
|
// some other properties that may exist:
|
|
|
|
//
|
2004-10-27 01:27:59 +04:00
|
|
|
// 'description' - description (string)
|
|
|
|
// 'location' - location (string)
|
|
|
|
// 'categories' - categories (string)
|
|
|
|
// 'syncId' - sync id (string)
|
|
|
|
// 'inviteEmailAddress' - string
|
|
|
|
// alarmLength/alarmUnits/alarmEmailAddress/lastAlarmAck
|
|
|
|
// recurInterval/recurCount/recurWeekdays/recurWeeknumber
|
|
|
|
|
2004-11-30 03:23:37 +03:00
|
|
|
// these forward to an internal property bag; implemented here, so we can
|
2005-06-10 05:31:48 +04:00
|
|
|
// do access control on set/delete to have control over mutability.
|
2004-11-30 03:23:37 +03:00
|
|
|
readonly attribute nsISimpleEnumerator propertyEnumerator;
|
2005-06-10 05:31:48 +04:00
|
|
|
boolean hasProperty(in AString name);
|
2004-11-30 03:23:37 +03:00
|
|
|
nsIVariant getProperty(in AString name);
|
|
|
|
void setProperty(in AString name, in nsIVariant value);
|
2004-12-02 20:41:13 +03:00
|
|
|
// will not throw an error if you delete a property that doesn't exist
|
2004-11-30 03:23:37 +03:00
|
|
|
void deleteProperty(in AString name);
|
2004-12-01 23:52:31 +03:00
|
|
|
|
2005-06-10 05:31:48 +04:00
|
|
|
// returns true if the given property is promoted to some
|
|
|
|
// top-level attribute (e.g. id or title)
|
|
|
|
boolean isPropertyPromoted(in AString name);
|
|
|
|
|
2005-04-16 02:11:05 +04:00
|
|
|
/**
|
|
|
|
* The organizer (originator) of the item. We will likely not
|
|
|
|
* honour or preserve all fields in the calIAttendee passed around here.
|
|
|
|
* A base class like calIPerson might be more appropriate here, if we ever
|
|
|
|
* grow one.
|
|
|
|
*/
|
|
|
|
attribute calIAttendee organizer;
|
|
|
|
|
2005-06-10 05:31:48 +04:00
|
|
|
//
|
|
|
|
// Attendees
|
|
|
|
//
|
|
|
|
|
2004-12-01 23:52:31 +03:00
|
|
|
// The array returned here is not live; it will not reflect calls to
|
|
|
|
// removeAttendee/addAttendee that follow the call to getAttendees.
|
|
|
|
void getAttendees(out PRUint32 count,
|
|
|
|
[array,size_is(count),retval] out calIAttendee attendees);
|
|
|
|
calIAttendee getAttendeeById(in AUTF8String id);
|
|
|
|
void removeAttendee(in calIAttendee attendee);
|
|
|
|
void addAttendee(in calIAttendee attendee);
|
2004-12-14 03:44:21 +03:00
|
|
|
void removeAllAttendees();
|
2005-04-15 22:51:47 +04:00
|
|
|
|
2005-06-10 05:31:48 +04:00
|
|
|
//
|
|
|
|
// Occurrence querying
|
|
|
|
//
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a list of occurrences of this item between the given dates. The items
|
|
|
|
* returned are the same type as this one, as proxies.
|
|
|
|
*/
|
2005-04-15 22:51:47 +04:00
|
|
|
void getOccurrencesBetween (in calIDateTime aStartDate, in calIDateTime aEndDate,
|
|
|
|
out PRUint32 aCount,
|
2005-06-10 05:31:48 +04:00
|
|
|
[array,size_is(aCount),retval] out calIItemBase aOccurrences);
|
2004-10-27 01:27:59 +04:00
|
|
|
|
2005-06-10 05:31:48 +04:00
|
|
|
/**
|
|
|
|
* The next occurrence after this one, if any.
|
|
|
|
*/
|
|
|
|
readonly attribute calIItemBase nextOccurrence;
|
2004-10-27 01:27:59 +04:00
|
|
|
|
2005-06-10 05:31:48 +04:00
|
|
|
/**
|
|
|
|
* The previous occurrence before this one, if any.
|
|
|
|
*/
|
|
|
|
readonly attribute calIItemBase previousOccurrence;
|
2004-10-27 01:27:59 +04:00
|
|
|
|
|
|
|
//
|
2005-06-10 05:31:48 +04:00
|
|
|
// proxy support
|
2004-10-27 01:27:59 +04:00
|
|
|
//
|
|
|
|
|
2005-06-10 05:31:48 +04:00
|
|
|
/**
|
|
|
|
* create a proxy for this item; the returned item
|
|
|
|
* proxy will have parentItem set to this instance.
|
|
|
|
*/
|
|
|
|
calIItemBase createProxy();
|
2005-04-24 14:52:27 +04:00
|
|
|
|
2005-06-10 05:31:48 +04:00
|
|
|
/**
|
|
|
|
* If this item is a proxy, parentItem will point upwards
|
|
|
|
* to our parent. Otherwise, it will point to this.
|
|
|
|
* parentItem can thus always be used for modifyItem() calls
|
|
|
|
* to providers.
|
|
|
|
*/
|
|
|
|
attribute calIItemBase parentItem;
|
2004-10-27 01:27:59 +04:00
|
|
|
|
2005-06-10 05:31:48 +04:00
|
|
|
/**
|
|
|
|
* The recurrence ID, a.k.a. DTSTART-of-calculated-occurrence,
|
|
|
|
* or null if this isn't an occurrence.
|
2006-02-24 23:42:56 +03:00
|
|
|
* Be conservative about setting this. It isn't marked as such, but
|
|
|
|
* consider it as readonly.
|
2005-06-10 05:31:48 +04:00
|
|
|
*/
|
|
|
|
attribute calIDateTime recurrenceId;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the given property value if it is natively set on the item,
|
|
|
|
* otherwise returns null.
|
|
|
|
*/
|
|
|
|
nsIVariant getUnproxiedProperty(in AString name);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* An enumerator that lets us walk down the list of properties
|
|
|
|
* that are actually changed by this proxy from the base. If this
|
|
|
|
* item is not a proxy, then this list will be equivalent to the one
|
|
|
|
* returned from propertyEnumerator.
|
|
|
|
*
|
|
|
|
* The elements returned by the enumerator will be of type nsIProperty,
|
|
|
|
* as with a normal nsIPropertyBag enumerator.
|
|
|
|
*/
|
|
|
|
readonly attribute nsISimpleEnumerator unproxiedPropertyEnumerator;
|
|
|
|
};
|