diff options
Diffstat (limited to 'comm/calendar/base/public/calIOperation.idl')
-rw-r--r-- | comm/calendar/base/public/calIOperation.idl | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/comm/calendar/base/public/calIOperation.idl b/comm/calendar/base/public/calIOperation.idl new file mode 100644 index 0000000000..92f3e8bb8d --- /dev/null +++ b/comm/calendar/base/public/calIOperation.idl @@ -0,0 +1,46 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsIVariant.idl" + +[scriptable, uuid(B96C2997-7AAA-4619-AD48-B7EBD9236C93)] +interface calIOperation : nsISupports +{ + /** + * Id for easy management of pending requests. + */ + readonly attribute AUTF8String id; + + /** + * Determines whether the request is pending, i.e. has not been completed. + */ + readonly attribute boolean isPending; + + /** + * Status of the request, e.g. NS_OK while pending or after successful + * completion, or NS_ERROR_FAILED when failed. + */ + readonly attribute nsIVariant status; + + /** + * Cancels a pending request and changes status. + * @param aStatus operation status to be set; + * defaults to calIErrors.OPERATION_CANCELLED if null + */ + void cancel([optional] in nsIVariant aStatus); +}; + +[scriptable, uuid(1FA39726-63D2-440c-A464-296D2822B9DA)] +interface calIGenericOperationListener : nsISupports +{ + /** + * Generic callback receiving result. + * Results may appear in multiple calls, i.e. callees have to collect + * until isPending is false. + * + * @param aOperation operation object + * @param aResult result or null in case of an error + */ + void onResult(in calIOperation aOperation, in nsIVariant aResult); +}; |