gecko-dev/calendar/base/public/calIItemBase.idl

204 lines
6.5 KiB
Plaintext
Raw Normal View History

/* -*- Mode: idl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2004-10-26 21:27:59 +00: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>
* Mike Shaver <shaver@mozilla.org>
2004-10-26 21:27:59 +00: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 ***** */
#include "nsISupports.idl"
interface nsIArray;
2004-11-03 21:48:23 +00:00
interface nsIMutableArray;
interface nsISimpleEnumerator;
interface nsIVariant;
interface nsIPropertyBag;
interface nsIWritablePropertyBag;
2004-10-26 21:27:59 +00:00
interface calICalendar;
2004-11-03 21:48:23 +00:00
interface calIItemOccurrence;
interface calIMutableItemBase;
interface calIDateTime;
interface calIMutableDateTime;
interface calIRecurrenceInfo;
interface calIMutableRecurrenceInfo;
2004-10-26 21:27:59 +00:00
interface calIAttendee;
interface calIIcalComponent;
2004-10-26 21:27:59 +00:00
//
// calIItemBase
//
// Base for Events, Todos, Journals, etc.
//
[scriptable, uuid(096b8cc5-113c-40fb-bc52-d64e3992980c)]
2004-11-03 21:48:23 +00:00
interface calIItemBase : nsISupports
2004-10-26 21:27:59 +00: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();
//
// the generation number of this item; 0 means
// that it's never been stored in a store
//
readonly attribute PRUint32 generation;
2004-10-26 21:27:59 +00:00
// the time when this item was created
readonly attribute calIDateTime creationDate;
// last time any attribute was modified on this item, in UTC
readonly attribute calIDateTime lastModifiedTime;
2004-10-26 21:27:59 +00:00
// the calICalendar to which this event belongs
attribute calICalendar parent;
// the ID of this event
attribute AUTF8String id;
// event title
attribute AUTF8String title;
// event priority
attribute short priority;
attribute AUTF8String privacy;
2004-10-26 21:27:59 +00:00
// status of the event
attribute AUTF8String status;
2004-10-26 21:27:59 +00:00
// ical interop; writing this means parsing
// the ical string into this event
attribute AUTF8String icalString;
// 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.
readonly attribute calIIcalComponent icalComponent;
2004-10-26 21:27:59 +00:00
//
// alarms
//
attribute boolean hasAlarm;
attribute calIDateTime alarmTime;
2004-10-26 21:27:59 +00:00
//
// recurrence
//
readonly attribute calIRecurrenceInfo recurrenceInfo;
2004-10-26 21:27:59 +00:00
// attachments
// array of nsIMsgAttachment
// if this item is mutable, the returned array will be a nsIMutableArray
readonly attribute nsIArray attachments;
2004-10-26 21:27:59 +00:00
//
// other properties come in through a property bag
//
// 'description' - description (string)
// 'location' - location (string)
// 'categories' - categories (string)
// 'syncId' - sync id (string)
// 'inviteEmailAddress' - string
// alarmLength/alarmUnits/alarmEmailAddress/lastAlarmAck
// recurInterval/recurCount/recurWeekdays/recurWeeknumber
// Ideally, /all/ of the properties on the event should
// be available via the property bag. (And maybe the
// nsIItemBase impl should be QI'able to
// nsIWritablePropertyBag also)
// if this item is mutable, the returned bag will be a nsIWritablePropertyBag
//readonly attribute nsIPropertyBag properties;
// these forward to an internal property bag; implemented here, so we can
// do access control on set/delete.
readonly attribute nsISimpleEnumerator propertyEnumerator;
nsIVariant getProperty(in AString name);
void setProperty(in AString name, in nsIVariant value);
// will not throw an error if you delete a property that doesn't exist
void deleteProperty(in AString name);
// 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-10-26 21:27:59 +00:00
};
//
// calIItemOccurrence
//
// An item representing a specific instance of a possibly recurring item.
// XXX unclear how recurrence (& this) works for todo events with due dates.
//
[scriptable, uuid(b19f3d7e-e848-4139-af3e-505a8023568d)]
2004-11-03 21:48:23 +00:00
interface calIItemOccurrence : nsISupports
2004-10-26 21:27:59 +00:00
{
// Initialize this Occurrence
void initialize (in calIItemBase aItem,
in calIDateTime aStartDate,
in calIDateTime aEndDate);
2004-10-26 21:27:59 +00:00
//
// The parent item for which this is the occurrence item for
//
readonly attribute calIItemBase item;
//
// The start and end times to display for this event instance
//
readonly attribute calIDateTime occurrenceStartDate;
readonly attribute calIDateTime occurrenceEndDate;
// same as item.getNextOccurrence(occurrenceEndDate)
2004-11-03 21:48:23 +00:00
readonly attribute calIItemOccurrence next;
// same as item.getPreviousOccurrence(occurrenceStartDate)
readonly attribute calIItemOccurrence previous;
2004-10-26 21:27:59 +00:00
};