Back to index

lightning-sunbird  0.9+nobinonly
calIWcapCalendar.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 Sun Microsystems code.
00015  *
00016  * The Initial Developer of the Original Code is
00017  *   Sun Microsystems, Inc.
00018  * Portions created by the Initial Developer are Copyright (C) 2007
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *   Daniel Boelzle <daniel.boelzle@sun.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 "calICalendar.idl"
00040 #include "calIDateTime.idl"
00041 interface calISyncCalendar;
00042 interface calIWcapSession;
00043 interface calIAttendee;
00044 
00047 [scriptable, uuid(21A189DF-6C92-41f6-9E2B-1929EF25CAEE)]
00048 interface calIWcapCalendar : calICalendar
00049 {
00053     readonly attribute calIWcapSession session;
00054 
00059     readonly attribute string calId;
00060 
00065     readonly attribute string ownerId;
00066 
00071     readonly attribute boolean isDefaultCalendar;
00072 
00077     readonly attribute boolean isOwnedCalendar;
00078 
00083     readonly attribute string description;
00084 
00089     readonly attribute string displayName;
00090 
00095     readonly attribute string defaultTimezone;
00096 
00105     void getCalendarProperties(in string propName,
00106                                out unsigned long count,
00107                                [array, size_is(count), retval] out string props);
00108 
00109     /* xxx todo: additional filters sensible for calICalendar, too?
00110                  claiming bits 24-30 for now.
00111                  
00112                  Those bits are somehow handled special now:
00113                  If at least one of the below is set, then
00114                  that filter bit(s) are active.
00115                  If none of the below is set, then those compstate
00116                  filters are not taken into account at all.
00117                  So there is no need to OR all of the below together
00118                  (ITEM_FILTER_ALL_ITEMS does not cover these bits) if you
00119                  don't care about the REQUEST/REPLY states.
00120 
00121        xxx todo: ITEM_FILTER_CLASS_OCCURRENCES is not filter, rename?
00122     */
00123 
00124     /* xxx todo: limit to currently needed ones: NEEDS-ACTION */
00125 
00126 //     /**
00127 //      * Scope: getItems only
00128 //      * Whether getItems should only return items that have alarms set for the
00129 //      * specified range.
00130 //      */
00131 //     const unsigned long ITEM_FILTER_BY_ALARM_RANGE = 1 << 23;
00132 
00133 //     /**
00134 //      * Scope: Attendee
00135 //      * The event or todo is an invitation from another
00136 //      * user and the current user has declined the invitation.
00137 //      */
00138 //     const unsigned long ITEM_FILTER_REPLY_DECLINED = 1 << 24;
00139 
00140 //     /**
00141 //      * Scope: Attendee
00142 //      * The event or todo is an invitation from another
00143 //      * user and the current user has accepted the invitation.
00144 //      */
00145 //     const unsigned long ITEM_FILTER_REPLY_ACCEPTED = 1 << 25;
00146 
00147 //     /**
00148 //      * Scope: Organizer
00149 //      * The event or todo is an invitation from the current
00150 //      * user to other invitees, and all invitees have replied.
00151 //      */
00152 //     const unsigned long ITEM_FILTER_REQUEST_COMPLETED = 1 << 26;
00153 
00154 //     /**
00155 //      * Scope: Attendee
00156 //      * The event or todo is an invitation from another
00157 //      * user and the current user has not replied to it yet.
00158 //      */
00159 //     const unsigned long ITEM_FILTER_REQUEST_NEEDS_ACTION = 1 << 27;
00160 
00161 //     /**
00162 //      * Scope: Attendee
00163 //      * The event or todo is an invitation from another
00164 //      * user and the current user is not required to reply.
00165 //      */
00166 //     const unsigned long ITEM_FILTER_REQUEST_NEEDSNOACTION  = 1 << 28;
00167 
00168 //     /**
00169 //      * Scope: Organizer
00170 //      * The event or todo is an invitation from the current
00171 //      * user to other invitees, and is currently in the
00172 //      * process of sending out invitations.
00173 //      */
00174 //     const unsigned long ITEM_FILTER_REQUEST_PENDING = 1 << 29;
00175 
00176 //     /**
00177 //      * Scope: Organizer
00178 //      * The event or todo is an invitation from the current
00179 //      * user to other invitees, and is currently awaiting.
00180 //      */
00181 //     const unsigned long ITEM_FILTER_REQUEST_WAITFORREPLY = 1 << 30;
00182 
00183     /* xxx todo:
00184        separate out into another interface and leave only an attribute
00185        
00186        readonly attribute calIWcapAccessControl accessControl;
00187 
00188        here?
00189        This would bloat client code somehow like
00190 
00191        if (cal.accessControl &&
00192            cal.accessControl.check(calIAccessControl.AC_COMP_WRITE))
00193            cal.deleteItem(item, listener);
00194 
00195        but makes it easier for provider implementors not implementing the
00196        whole stuff...
00197 
00198        Right now, the below are similar to *nix fs rights, i.e. "write" includes
00199        "add", "delete" and "modify".
00200        Does it make sense to separate "add" and "delete" out of "write"?
00201     */
00202 
00207     const unsigned long AC_FREEBUSY = 1 << 0;
00208 
00213     const unsigned long AC_SCHEDULE = 1 << 1;
00214 
00218     const unsigned long AC_COMP_READ = 1 << 2;
00219 
00223     const unsigned long AC_COMP_WRITE = 1 << 3;
00224 
00228     const unsigned long AC_PROP_READ = 1 << 4;
00229 
00233     const unsigned long AC_PROP_WRITE = 1 << 5;
00234 
00238     const unsigned long AC_FULL = (AC_FREEBUSY    |
00239                                    AC_SCHEDULE    |
00240                                    AC_COMP_READ   |
00241                                    AC_COMP_WRITE  |
00242                                    AC_PROP_READ   |
00243                                    AC_PROP_WRITE);
00244 
00262     boolean checkAccess(in unsigned long accessControlBits);
00263 
00264 //     /**
00265 //      * Defines granted and denied permissions for a specific user or
00266 //      * user domain. Specific user entries precede over domain entries.
00267 //      *
00268 //      * Examples:
00269 //      * a) Allow all users availability and read access,
00270 //      *    but jdoe only availability access:
00271 //      *    defineAccessControl("@", AC_FREEBUSY | AC_COMP_READ);
00272 //      *    defineAccessControl("jdoe", AC_FREEBUSY);
00273 //      *
00274 //      * b) Restrict jdoe to have no access:
00275 //      *    defineAccessControl("jdoe", 0);
00276 //      *
00277 //      * Follow-up definition calls for the same user will overwrite previous
00278 //      * definitions.
00279 //      * 
00280 //      * @param userId user that is affected by the access control bits
00281 //      *               WCAP specific:
00282 //      *                    - @ stands in for everybody
00283 //      *                    xxx todo: change the above
00284 //      * @param accessControlBits access control bits (above AC_ definitions)
00285 //      * @param listener called when access control bits have been updated
00286 //      * @return optional object to track operation
00287 //      */
00288 //     calIOperation defineAccessControl(
00289 //         in string userId, in unsigned long accessControlBits,
00290 //         in calIGenericOperationListener listener);
00291     
00292 //     /**
00293 //      * To reset a user's access control definition to the default ones
00294 //      * that everybody is granted.
00295 //      * In case the user has no specific access control definition,
00296 //      * Components.results.NS_ERROR_INVALID_ARG is thrown.
00297 //      *
00298 //      * @param userId user id
00299 //      * @param listener called when access control bits have been updated
00300 //      * @return optional object to track operation
00301 //      */
00302 //     calIOperation resetAccessControl(
00303 //         in string userId,
00304 //         in calIGenericOperationListener listener);
00305     
00306 //     /**
00307 //      * Gets the set of access control definitions (including "everybody").
00308 //      * Both out arrays have the same length.
00309 //      *
00310 //      * @param count length of returned arrays
00311 //      * @param users users ids
00312 //      * @param accessControlBits access control bits
00313 //      * @param listener called with xxx todo
00314 //      * @return optional object to track operation
00315 //      */
00316 //     calIOperation getAccessControlDefinitions(
00317 //         out unsigned long count,
00318 //         [array, size_is(count)] out string users,
00319 //         [array, size_is(count)] out unsigned long accessControlBits );
00320 };
00321