Back to index

lightning-sunbird  0.9+nobinonly
calICalendar.idl
Go to the documentation of this file.
00001 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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 OEone Calendar Code, released October 31st, 2001.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * OEone Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 2001
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s): Mostafa Hosseini <mostafah@oeone.com>
00023  *                 Chris Charabaruk <ccharabaruk@meldstar.com>
00024  *                 ArentJan Banck <ajbanck@planet.nl>
00025  *                 Dan Mosedale <dan.mosedale@oracle.com>
00026  *                 Vladimir Vukicevic <vladimir.vukicevic@oracle.com>
00027  *                 Mike Shaver <shaver@off.net>
00028  *                 Philipp Kewisch <mozilla@kewis.ch>
00029  *
00030  * Alternatively, the contents of this file may be used under the terms of
00031  * either the GNU General Public License Version 2 or later (the "GPL"), or
00032  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00033  * in which case the provisions of the GPL or the LGPL are applicable instead
00034  * of those above. If you wish to allow use of your version of this file only
00035  * under the terms of either the GPL or the LGPL, and not to allow others to
00036  * use your version of this file under the terms of the MPL, indicate your
00037  * decision by deleting the provisions above and replace them with the notice
00038  * and other provisions required by the GPL or the LGPL. If you do not delete
00039  * the provisions above, a recipient may use your version of this file under
00040  * the terms of any one of the MPL, the GPL or the LGPL.
00041  *
00042  * ***** END LICENSE BLOCK ***** */
00043 
00044 #include "nsISupports.idl"
00045 
00046 // decls for stuff from other files
00047 interface nsIURI;
00048 interface calIItemBase;
00049 interface nsIVariant;
00050 interface nsISimpleEnumerator;
00051 
00052 // forward decls for this file
00053 interface calIObserver;
00054 interface calIOperationListener;
00055 interface calIRange;
00056 interface calIDateTime;
00057 interface calIOperation;
00058 interface calIStatusObserver;
00059 interface nsIDOMChromeWindow;
00060 
00061 [scriptable, uuid(74e685e4-d863-11d9-88f2-000b7d081f44)]
00062 interface calICalendar : nsISupports
00063 {
00070   attribute AUTF8String id;
00071 
00076   attribute AUTF8String name;
00077 
00082   readonly attribute AUTF8String type;
00083   
00093   attribute calICalendar superCalendar;
00094 
00100   attribute nsIURI uri;
00101 
00106   attribute boolean readOnly;
00107 
00111   readonly attribute boolean canRefresh;
00112 
00118   attribute boolean transientProperties;
00119 
00195   nsIVariant getProperty(in AUTF8String aName);
00196 
00209   void setProperty(in AUTF8String aName, in nsIVariant aValue);
00210 
00219   void deleteProperty(in AUTF8String aName);
00220 
00237   const unsigned long ITEM_FILTER_COMPLETED_YES = 1 << 0; 
00238   const unsigned long ITEM_FILTER_COMPLETED_NO = 1 << 1; 
00239   const unsigned long ITEM_FILTER_COMPLETED_ALL = (ITEM_FILTER_COMPLETED_YES |
00240                                                    ITEM_FILTER_COMPLETED_NO);
00241 
00242   const unsigned long ITEM_FILTER_TYPE_TODO = 1 << 2;
00243   const unsigned long ITEM_FILTER_TYPE_EVENT = 1 << 3;
00244   const unsigned long ITEM_FILTER_TYPE_JOURNAL = 1 << 4;
00245   const unsigned long ITEM_FILTER_TYPE_ALL = (ITEM_FILTER_TYPE_TODO |
00246                                               ITEM_FILTER_TYPE_EVENT |
00247                                               ITEM_FILTER_TYPE_JOURNAL);
00248 
00249   const unsigned long ITEM_FILTER_ALL_ITEMS = 0xFFFF;
00250 
00257   const unsigned long ITEM_FILTER_CLASS_OCCURRENCES = 1 << 16;
00258 
00264   const unsigned long ITEM_FILTER_REQUEST_NEEDS_ACTION = 1 << 17;
00265 
00266   void addObserver( in calIObserver observer );
00267   void removeObserver( in calIObserver observer );
00268 
00301   calIOperation addItem(in calIItemBase aItem,
00302                         in calIOperationListener aListener);
00303 
00312   calIOperation adoptItem(in calIItemBase aItem,
00313                           in calIOperationListener aListener);
00314 
00342   calIOperation modifyItem(in calIItemBase aNewItem,
00343                            in calIItemBase aOldItem,
00344                            in calIOperationListener aListener);
00345 
00365   calIOperation deleteItem(in calIItemBase aItem,
00366                            in calIOperationListener aListener);
00367 
00386   calIOperation getItem(in string aId, in calIOperationListener aListener);
00387 
00436   calIOperation getItems(in unsigned long aItemFilter,
00437                          in unsigned long aCount,
00438                          in calIDateTime aRangeStart,
00439                          in calIDateTime aRangeEndEx,
00440                          in calIOperationListener aListener);
00441 
00449   calIOperation refresh();
00450   
00460   void startBatch();
00461 
00465   void endBatch();
00466 };
00467 
00472 [scriptable, uuid(8285aa0b-594c-4f93-abe3-523df947e0ad)]
00473 interface calICompositeCalendar : calICalendar
00474 {
00480   void addCalendar( in calICalendar aCalendar );
00486   void removeCalendar( in nsIURI aServer );
00494   calICalendar getCalendar( in nsIURI aServer );
00495 
00496   /* return a list of all calendars currently registered */
00497   void getCalendars(out PRUint32 count,
00498                     [array, size_is(count), retval] out calICalendar aCalendars);
00499 
00505   attribute calICalendar defaultCalendar;
00506   
00512   attribute ACString prefPrefix;
00513 
00518   readonly attribute boolean statusDisplayed;
00519   
00523    void setStatusObserver( in calIStatusObserver aStatusObserver, in nsIDOMChromeWindow aWindow );
00524 };
00525 
00530 [scriptable, uuid(2953c9b2-2c73-11d9-80b6-00045ace3b8d)]
00531 interface calIObserver : nsISupports
00532 {
00533   void onStartBatch();
00534   void onEndBatch();
00535   void onLoad( in calICalendar aCalendar );
00536   void onAddItem( in calIItemBase aItem );
00537   void onModifyItem( in calIItemBase aNewItem, in calIItemBase aOldItem );
00538   void onDeleteItem( in calIItemBase aDeletedItem );
00539   void onError( in calICalendar aCalendar, in nsresult aErrNo, in AUTF8String aMessage );
00540 
00542   void onPropertyChanged(in calICalendar aCalendar,
00543                          in AUTF8String aName,
00544                          in nsIVariant aValue,
00545                          in nsIVariant aOldValue);
00546 
00548   void onPropertyDeleting(in calICalendar aCalendar,
00549                           in AUTF8String aName);
00550 };
00551 
00556 [scriptable, uuid(a3584c92-b8eb-4aa8-a638-e46a2e11d6a9)]
00557 interface calICompositeObserver : calIObserver
00558 {
00559   void onCalendarAdded( in calICalendar aCalendar );
00560   void onCalendarRemoved( in calICalendar aCalendar );
00561   void onDefaultCalendarChanged( in calICalendar aNewDefaultCalendar );
00562 };
00563 
00569 [scriptable, uuid(ed3d87d8-2c77-11d9-8f5f-00045ace3b8d)]
00570 interface calIOperationListener : nsISupports
00571 {
00583   void onOperationComplete(in calICalendar aCalendar,
00584                            in nsresult aStatus,
00585                            in unsigned long aOperationType,
00586                            in string aId,
00587                            in nsIVariant aDetail);
00588   const unsigned long ADD = 1;
00589   const unsigned long MODIFY = 2;
00590   const unsigned long DELETE = 3;
00591   const unsigned long GET = 4;
00592 
00607   void onGetResult (in calICalendar aCalendar,
00608                     in nsresult aStatus,
00609                     in nsIIDRef aItemType, 
00610                     in nsIVariant aDetail,
00611                     in PRUint32 aCount, 
00612                     [array, size_is(aCount), iid_is(aItemType)] 
00613                     in nsQIResult aItems ); 
00614 };