Back to index

lightning-sunbird  0.9+nobinonly
calIItemBase.idl
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is Oracle Corporation code.
00015  *
00016  * The Initial Developer of the Original Code is
00017  *  Oracle Corporation
00018  * Portions created by the Initial Developer are Copyright (C) 2004
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *   Vladimir Vukicevic <vladimir.vukicevic@oracle.com>
00023  *   Mike Shaver <shaver@mozilla.org>
00024  *   Philipp Kewisch <mozilla@kewis.ch>
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 #include "nsISupports.idl"
00041 
00042 interface nsISimpleEnumerator;
00043 interface nsIVariant;
00044 
00045 interface nsIPropertyBag;
00046 
00047 interface calICalendar;
00048 
00049 interface calIDateTime;
00050 
00051 interface calIDuration;
00052 
00053 interface calIRecurrenceInfo;
00054 
00055 interface calIAttendee;
00056 
00057 interface calIAttachment;
00058 
00059 interface calIIcalComponent;
00060 
00061 interface calIRelation;
00062 //
00063 // calIItemBase
00064 //
00065 // Base for Events, Todos, Journals, etc.
00066 //
00067 
00068 [scriptable, uuid(c2a21f8c-9de6-47d5-912b-d1c423ea5f2e)]
00069 interface calIItemBase : nsISupports
00070 {
00071   // returns true if this thing is able to be modified;
00072   // if the item is not mutable, attempts to modify
00073   // any data will throw CAL_ERROR_ITEM_IS_IMMUTABLE
00074   readonly attribute boolean isMutable;
00075 
00076   // makes this item immutable
00077   void makeImmutable();
00078 
00079   // clone always returns a mutable event
00080   calIItemBase clone();
00081 
00091   readonly attribute AUTF8String hashId;
00092 
00101   boolean hasSameIds(in calIItemBase aItem);
00102   
00103   //
00104   // the generation number of this item
00105   //
00106   attribute PRUint32 generation;
00107 
00108   // the time when this item was created
00109   readonly attribute calIDateTime creationDate;
00110 
00111   // last time any attribute was modified on this item, in UTC
00112   readonly attribute calIDateTime lastModifiedTime;
00113 
00114   // last time a "significant change" was made to this item
00115   readonly attribute calIDateTime stampTime;
00116 
00117   // indicate such a "significant change"
00118   void updateStampTime();
00119 
00120   // the calICalendar to which this event belongs
00121   attribute calICalendar calendar;
00122 
00123   // the ID of this event
00124   attribute AUTF8String id;
00125 
00126   // event title
00127   attribute AUTF8String title;
00128 
00129   // event priority
00130   attribute short priority;
00131   attribute AUTF8String privacy;
00132 
00133   // status of the event
00134   attribute AUTF8String status;
00135 
00136   // ical interop; writing this means parsing
00137   // the ical string into this event
00138   attribute AUTF8String icalString;
00139 
00140   // an icalComponent for this item, suitable for serialization.
00141   // the icalComponent returned is not live: changes in it or this
00142   // item will not be reflected in the other.
00143   attribute calIIcalComponent icalComponent;
00144 
00145   //
00146   // alarms
00147   //
00148 
00153   attribute calIDuration alarmOffset;
00154 
00158   attribute unsigned long alarmRelated;
00159 
00164   const unsigned long ALARM_RELATED_START = 0;
00165 
00170   const unsigned long ALARM_RELATED_END = 1;
00171 
00172   // The last time this alarm was fired and acknowledged by the user; coerced to UTC.
00173   attribute calIDateTime alarmLastAck;
00174 
00175   //
00176   // recurrence
00177   //
00178   attribute calIRecurrenceInfo recurrenceInfo;
00179   readonly attribute calIDateTime recurrenceStartDate;
00180 
00181   // 
00182   // All event properties are stored in a property bag;
00183   // some number of these are "promoted" to top-level
00184   // accessor attributes.  For example, "SUMMARY" is
00185   // promoted to the top-level "title" attribute.
00186   //
00187   // If you use the has/get/set/deleteProperty
00188   // methods, property names are case-insensitive.
00189   // 
00190   // For purposes of ICS serialization, all property names in
00191   // the hashbag are in uppercase.
00192   //
00193   // The isPropertyPromoted() attribute can will indicate
00194   // if a particular property is promoted or not, for
00195   // serialization purposes.
00196   //
00197 
00198   // Note that if this item is a proxy, then any requests for
00199   // non-existant properties will be forward to the parent item.
00200 
00201   // some other properties that may exist:
00202   //
00203   // 'description' - description (string)
00204   // 'location' - location (string)
00205   // 'categories' - categories (string)
00206   // 'syncId' - sync id (string)
00207   // 'inviteEmailAddress' - string
00208   // alarmLength/alarmUnits/alarmEmailAddress/lastAlarmAck
00209   // recurInterval/recurCount/recurWeekdays/recurWeeknumber
00210 
00211   // these forward to an internal property bag; implemented here, so we can
00212   // do access control on set/delete to have control over mutability.
00213   readonly attribute nsISimpleEnumerator propertyEnumerator;
00214   boolean hasProperty(in AString name);
00215   nsIVariant getProperty(in AString name);
00216   void setProperty(in AString name, in nsIVariant value);
00217   // will not throw an error if you delete a property that doesn't exist
00218   void deleteProperty(in AString name);
00219 
00220   // returns true if the given property is promoted to some
00221   // top-level attribute (e.g. id or title)
00222   boolean isPropertyPromoted(in AString name);
00223 
00231    AString getPropertyParameter(in AString aPropertyName, 
00232                                 in AString aParameterName);
00233 
00240   attribute calIAttendee organizer;
00241 
00242   //
00243   // Attendees
00244   //
00245 
00246   // The array returned here is not live; it will not reflect calls to
00247   // removeAttendee/addAttendee that follow the call to getAttendees.
00248   void getAttendees(out PRUint32 count,
00249                     [array,size_is(count),retval] out calIAttendee attendees);
00250 
00256   calIAttendee getAttendeeById(in AUTF8String id);
00257   void removeAttendee(in calIAttendee attendee);
00258   void addAttendee(in calIAttendee attendee);
00259   void removeAllAttendees();
00260 
00261   //
00262   // Attachments
00263   //
00264   void getAttachments(out PRUint32 count,
00265                       [array,size_is(count),retval] out calIAttachment attachments);
00266   void removeAttachment(in calIAttachment attachment);
00267   void addAttachment(in calIAttachment attachment);
00268   void removeAllAttachments();
00269 
00270   //
00271   // Categories
00272   //
00273 
00277   void getCategories(out PRUint32 aCount,
00278                      [array, size_is(aCount), retval] out wstring aCategories);
00279 
00283   void setCategories(in PRUint32 aCount,
00284                      [array, size_is(aCount)] in wstring aCategories);
00285 
00286   //
00287   // Relations
00288   //
00289 
00294   void getRelations(out PRUint32 count,
00295                       [array,size_is(count),retval] out calIRelation relations);
00296 
00300   void removeRelation(in calIRelation relation);
00301   
00305   void removeAllRelations();
00306 
00310   void addRelation(in calIRelation relation);
00311 
00312   // Occurrence querying
00313   //
00314 
00319   void getOccurrencesBetween (in calIDateTime aStartDate, in calIDateTime aEndDate,
00320                               out PRUint32 aCount,
00321                               [array,size_is(aCount),retval] out calIItemBase aOccurrences);
00322 
00329   attribute calIItemBase parentItem;
00330 
00337   attribute calIDateTime recurrenceId;
00338 };