Back to index

lightning-sunbird  0.9+nobinonly
calIRecurrenceInfo.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  *   Philipp Kewisch <mozilla@kewis.ch>
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either the GNU General Public License Version 2 or later (the "GPL"), or
00027  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 #include "nsISupports.idl"
00040 
00041 interface calIItemBase;
00042 interface calIDateTime;
00043 
00044 interface calIRecurrenceItem;
00045 
00046 interface calIIcalProperty;
00047 
00048 [scriptable, uuid(8ca5db89-2583-4f0c-b845-4a6d2f229efd)]
00049 interface calIRecurrenceInfo : nsISupports
00050 {
00051   // returns true if this thing is able to be modified;
00052   // if the item is not mutable, attempts to modify
00053   // any data will throw CAL_ERROR_ITEM_IS_IMMUTABLE
00054   readonly attribute boolean isMutable;
00055 
00056   // makes this item immutable
00057   void makeImmutable();
00058 
00059   // clone always returns a mutable event
00060   calIRecurrenceInfo clone();
00061 
00062   // initialize this with the item for which this recurrence
00063   // applies, so that the start date can be tracked
00064   attribute calIItemBase item;
00065 
00073   void onStartDateChange(in calIDateTime aNewStartTime, in calIDateTime aOldStartTime);
00074 
00075   /*
00076    * Set of recurrence items; the order of these matters.
00077    */
00078 
00079   void getRecurrenceItems(out unsigned long aCount, [array,size_is(aCount),retval] out calIRecurrenceItem aItems);
00080   void setRecurrenceItems(in unsigned long aCount, [array,size_is(aCount)] in calIRecurrenceItem aItems);
00081 
00082   unsigned long countRecurrenceItems();
00083   void clearRecurrenceItems();
00084   void appendRecurrenceItem(in calIRecurrenceItem aItem);
00085 
00086   calIRecurrenceItem getRecurrenceItemAt(in unsigned long aIndex);
00087   void deleteRecurrenceItemAt(in unsigned long aIndex);
00088   void deleteRecurrenceItem(in calIRecurrenceItem aItem);
00089   // inserts the item at the given index, pushing the item that was previously there forward
00090   void insertRecurrenceItemAt(in calIRecurrenceItem aItem, in unsigned long aIndex);
00091 
00096   readonly attribute boolean isFinite;
00097 
00103   void removeOccurrenceAt(in calIDateTime aRecurrenceId);
00104   void restoreOccurrenceAt(in calIDateTime aRecurrenceId);
00105 
00106   /*
00107    * exceptions
00108    */
00109 
00123   void modifyException(in calIItemBase anItem, in boolean aTakeOverOwnership);
00124 
00130   calIItemBase getExceptionFor(in calIDateTime aRecurrenceId, in boolean aCreate);
00131 
00136   void removeExceptionFor(in calIDateTime aRecurrenceId);
00137 
00141   void getExceptionIds(out unsigned long aCount, [array,size_is(aCount),retval] out calIDateTime aIds);
00142 
00143   /*
00144    * Recurrence calculation
00145    */
00146 
00147   /*
00148    * Get the occurrence at the given recurrence ID; if there is no
00149    * exception, then create a new proxy object with the normal occurrence.
00150    * Otherwise, return the exception.
00151    *
00152    * @param aRecurrenceId   The recurrence ID to get the occurrence for.
00153    * @return                The occurrence or exception corresponding to the id
00154    */
00155   calIItemBase getOccurrenceFor(in calIDateTime aRecurrenceId);
00156 
00164   calIItemBase getNextOccurrence(in calIDateTime aTime);
00165 
00173   calIItemBase getPreviousOccurrence(in calIDateTime aTime);
00174 
00187   void getOccurrenceDates(in calIDateTime aRangeStart,
00188                           in calIDateTime aRangeEnd,
00189                           in unsigned long aMaxCount,
00190                           out unsigned long aCount, [array,size_is(aCount),retval] out calIDateTime aDates);
00191 
00204   void getOccurrences(in calIDateTime aRangeStart,
00205                        in calIDateTime aRangeEnd,
00206                        in unsigned long aMaxCount,
00207                        out unsigned long aCount, [array,size_is(aCount),retval] out calIItemBase aItems);
00208 };