Back to index

lightning-sunbird  0.9+nobinonly
calIICSService.idl
Go to the documentation of this file.
00001 /* -*- Mode: idl; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is Oracle Corporation code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  *  Oracle Corporation
00019  * Portions created by the Initial Developer are Copyright (C) 2004
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Mike Shaver <shaver@off.net>
00024  *   Daniel Boelzle <daniel.boelzle@sun.com>
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 // XXX use strings for kind values instead of enumerated constants?
00041 
00042 
00043 #include "nsISupports.idl"
00044 
00045 interface calIItemBase;
00046 interface calIDateTime;
00047 interface calIDuration;
00048 interface calITimezone;
00049 interface calITimezoneProvider;
00050 
00051 interface calIIcalProperty;
00052 interface nsIUTF8StringEnumerator;
00053 interface nsIInputStream;
00054 
00055 [ptr] native icalpropertyptr(struct icalproperty_impl);
00056 [ptr] native icalcomponentptr(struct icalcomponent_impl);
00057 [ptr] native icaltimezoneptr(struct _icaltimezone);
00058 
00067 [scriptable,uuid(c4637c40-3c4c-4ecd-b802-8b5b46bdf5a4)]
00068 interface calIIcalComponent : nsISupports
00069 {
00074     const PRInt32 INVALID_VALUE = -1;
00075 
00079     calIIcalComponent getFirstSubcomponent(in AUTF8String componentType);
00080     calIIcalComponent getNextSubcomponent(in AUTF8String componentType);
00081 
00082     readonly attribute AUTF8String componentType;
00083 
00084     attribute AUTF8String uid;
00085     attribute AUTF8String prodid;
00086     attribute AUTF8String version;
00087 
00091     attribute AUTF8String method;
00092 
00096     attribute AUTF8String status;
00097 
00101     attribute AUTF8String transp;
00102 
00103     attribute AUTF8String summary;
00104     attribute AUTF8String description;
00105     attribute AUTF8String location;
00106     attribute AUTF8String categories;
00107     attribute AUTF8String URL;
00108 
00109     attribute PRInt32 priority;
00110 
00114     attribute AUTF8String icalClass;
00115 
00116     attribute calIDateTime startTime;
00117     attribute calIDateTime endTime;
00118     readonly attribute calIDuration duration;
00119     attribute calIDateTime dueTime;
00120     attribute calIDateTime stampTime;
00121 
00122     attribute calIDateTime createdTime;
00123     attribute calIDateTime completedTime;
00124     attribute calIDateTime lastModified;
00125 
00130     attribute calIDateTime recurrenceId;
00131     
00132     AUTF8String serializeToICS();
00133 
00137     AUTF8String toString();
00138 
00149     nsIInputStream serializeToICSStream();
00150 
00151     void addSubcomponent(in calIIcalComponent comp);
00152 // If you add then remove a property/component, the referenced
00153 // timezones won't get purged out. There's currently no client code.
00154 //     void removeSubcomponent(in calIIcalComponent comp);
00155 
00159     calIIcalProperty getFirstProperty(in AUTF8String kind);
00160     calIIcalProperty getNextProperty(in AUTF8String kind);
00161     void addProperty(in calIIcalProperty prop);
00162 // If you add then remove a property/component, the referenced
00163 // timezones won't get purged out. There's currently no client code.
00164 //     void removeProperty(in calIIcalProperty prop);
00165 
00173     void addTimezoneReference(in calITimezone aTimezone);
00174 
00180     void getReferencedTimezones(out PRUint32 aCount,
00181                                 [array,size_is(aCount),retval] out calITimezone aTimezones);
00182 
00187     calIIcalComponent clone();
00188 
00189     [noscript,notxpcom] icalcomponentptr getIcalComponent();
00190     [noscript,notxpcom] icaltimezoneptr getIcalTimezone();
00191 };
00192 
00193 [scriptable,uuid(17349a10-5d80-47fa-9bea-f22957357675)]
00194 interface calIIcalProperty : nsISupports
00195 {
00200     readonly attribute AUTF8String icalString;
00201 
00205     AUTF8String toString();
00206     
00213     attribute AUTF8String value;
00214 
00218     attribute AUTF8String valueAsIcalString;
00219 
00224     attribute calIDateTime valueAsDatetime;
00225 
00226     // XXX attribute AUTF8String stringValueWithParams; ?
00227     readonly attribute AUTF8String propertyName;
00228 
00229     AUTF8String getParameter(in AUTF8String paramname);
00230     void setParameter(in AUTF8String paramname, in AUTF8String paramval);
00231 
00232     AUTF8String getFirstParameterName();
00233     AUTF8String getNextParameterName();
00239     void removeParameter(in AUTF8String paramname);
00240     void clearXParameters();
00241 
00242     [noscript,notxpcom] icalpropertyptr getIcalProperty();
00248     [noscript,notxpcom] icalcomponentptr getIcalComponent();
00249 };
00250 
00251 [scriptable,uuid(ae4ca6c3-981b-4f66-a0ce-2f2c218ad9e3)]
00252 interface calIICSService : nsISupports
00253 {
00264     calIIcalComponent parseICS(in AUTF8String serialized,
00265                                in calITimezoneProvider tzProvider);
00266 
00267     calIIcalComponent createIcalComponent(in AUTF8String kind);
00268     calIIcalProperty createIcalProperty(in AUTF8String kind);
00269     /* I wish I could write this function atop libical!
00270     boolean isLegalParameterValue(in AUTF8String paramKind,
00271                                   in AUTF8String paramValue);
00272     */
00273 };