releases-comm-central/calendar/base/public/calITransactionManager.idl

86 строки
3.1 KiB
Plaintext

/* 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 "nsISupports.idl"
interface nsITransactionManager;
interface calICalendar;
interface calIItemBase;
interface calIOperationListener;
/**
* calITransactionManager is a service designed to handle nsITransactions
* regarding the calendar. It is here as a service so that we can keep the
* transactions around without holding onto the whole global js scope+window.
*/
[scriptable, uuid(1d529847-d292-4222-b066-b8b17a794d62)]
interface calITransactionManager : nsISupports
{
/**
* @param aAction The Action to execute. This can be one of:
* * add Adds an item
* * modify Modfifies an item
* * delete Deletes an item
* * move Move an item from one calendar to the
* next. With this operation, aCalendar is
* the calendar that the event should be
* moved to.
* @param aCalendar The Calendar to execute the transaction on
* @param aItem The changed item for this transaction. This item
* should be immutable
* @param aOldItem The Item in its original form. Only needed for
* modify.
* @param aListener The listener to call when the transaction has
* completed. This parameter can be null.
* @param aExtResponse JS object to provide additional parameters to prepare an itip message.
Valid attributes are:
* * responseMode A value as defined for calIItipItem.autoResponse
*/
void createAndCommitTxn(in AUTF8String aAction,
in calIItemBase aItem,
in calICalendar aCalendar,
in calIItemBase aOldItem,
in calIOperationListener aListener,
in jsval aExtResponse);
/**
* Signals the transaction manager that a series of transactions are going
* to be performed, but that, for the purposes of undo and redo, they should
* all be regarded as a single transaction. See also
* nsITransactionManager::beginBatch
*/
void beginBatch();
/**
* Ends the batch transaction in process. See also
* nsITransactionManager::endBatch
*/
void endBatch();
/**
* Undo the last transaction in the transaction manager's stack
*/
void undo();
/**
* Returns true if it is possible to undo a transaction at this time
*/
boolean canUndo();
/**
* Redo the last transaction
*/
void redo();
/**
* Returns true if it is possible to redo a transaction at this time
*/
boolean canRedo();
/**
* A reference to the transaction manager for calendar operations
*/
readonly attribute nsITransactionManager transactionManager;
};