Back to index

lightning-sunbird  0.9+nobinonly
calICalendarManager.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 Oracle Corporation
00017  * Portions created by the Initial Developer are Copyright (C) 2005
00018  * the Initial Developer. All Rights Reserved.
00019  *
00020  * Contributor(s):
00021  *   Stuart Parmenter <stuart.parmenter@oracle.com>
00022  *   Philipp Kewisch <mozilla@kewis.ch>
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #include "nsISupports.idl"
00039 
00040 interface calICalendar;
00041 interface nsIURI;
00042 interface nsIVariant;
00043 
00044 interface calICalendarManagerObserver;
00045 
00046 [scriptable, uuid(43a71d40-7807-4e2f-b741-2926ee73f89a)]
00047 interface calICalendarManager : nsISupports
00048 {
00052   readonly attribute PRUint32 networkCalendarCount;
00053 
00054   /***
00055    * Gives the number of registered readonly calendars.
00056    */
00057   readonly attribute PRUint32 readOnlyCalendarCount;
00058 
00062   readonly attribute PRUint32 calendarCount;
00063   /* 
00064    * create a new calendar
00065    * aType is the type ("caldav", "storage", etc)
00066    */
00067   calICalendar createCalendar(in AUTF8String aType, in nsIURI aURL);
00068 
00069   /* register a newly created calendar with the calendar service */
00070   void registerCalendar(in calICalendar aCalendar);
00071 
00072   /* unregister a calendar */
00073   void unregisterCalendar(in calICalendar aCalendar);
00074 
00075   /* delete a calendar for good */
00076   void deleteCalendar(in calICalendar aCalendar);
00077 
00078   /* return a list of all calendars currently registered */
00079   void getCalendars(out PRUint32 count,
00080                     [array, size_is(count), retval] out calICalendar aCalendars);
00081 
00082 
00083   /* XXX private, don't use:
00084          will vanish as soon as providers will directly read/write from moz prefs
00085   */
00086   nsIVariant getCalendarPref_(in calICalendar aCalendar,
00087                               in AUTF8String aName);
00088   void setCalendarPref_(in calICalendar aCalendar,
00089                         in nsIVariant aName,
00090                         in nsIVariant aValue);
00091   void deleteCalendarPref_(in calICalendar aCalendar,
00092                            in AUTF8String aName);
00093   
00094   void addObserver(in calICalendarManagerObserver aObserver);
00095   void removeObserver(in calICalendarManagerObserver aObserver);
00096 };
00097 
00098 [scriptable, uuid(383f36f1-e669-4ca4-be7f-06b43910f44a)]
00099 interface calICalendarManagerObserver : nsISupports
00100 {
00101   // called after the calendar is registered
00102   void onCalendarRegistered(in calICalendar aCalendar);
00103 
00104   // called before the unregister actually takes place
00105   void onCalendarUnregistering(in calICalendar aCalendar);
00106 
00107   // called before the delete actually takes place
00108   void onCalendarDeleting(in calICalendar aCalendar);
00109 };