This content covers features introduced in Thunderbird 3
This page describes the programmatic interfaces behind the Activity Manager component. The functionality of the component is described on the Activity Manager page, and the Activity Manager examples page has code snippets. See nsIActivityManager.idl and nsIActivity.idl files for source documentation.
Interface summary
- nsIActivityMgrListener: The implementer of this interface gets notified when an activity is added or removed to or from the activity list managed by Activity Manager. Activity developers do not need to implement this interface in order to introduce new activities to the system.
- nsIActivityManager: This is implemented by the default Activity Manager component, used by the Activity Manager consumers. Activity developers do not need to implement this interface in order to introduce new activities to the system.
- nsIActivity: This is the base interface for both
nsIActivityProcess
,nsIActivityWarning
andnsIActivityEvent
. It exposes common attributes and methods. Activity developers can should not implement this type, but implement one of the derived interfaces.
- nsIActivityProcess: Process activity types should implement this interface. The default process component (
"@mozilla.org/activity-process;1
") will usually suffice. When additional functionality is needed by the process, activity developers can implement their own version of the process activity and extend the system.
- nsIActivityEvent: Event activity types should implement this interface. The default event component (
"@mozilla.org/activity-event;1"
) will usually suffice. When additional functionality is needed by the event, activity developers can implement their own version of the event activity and extend the system.
- nsIActivityWarning: Warning activity types should implement this interface. The default warning component (
"@mozilla.org/activity-warning;1"
) will usually suffice. When additional functionality is needed by the warning, activity developers can implement their own version of the warning activity and extend the system.
- nsIActivityListener: The implementer of this interface gets notified when the subscribed activity changes state, progress, etc.
- nsIActivityPauseHandler: If provided with the activity, this allows the user to pause / resume the activity during its progress. Process types only. Activity developers might implement a component using this interface and associate it with the activity in question. When done, the default binding (XBL) representing the activity in the Activity Manager window will automatically show a pause / resume button attached to the activity.
- nsIActivityRetryHandler: If provided with the activity, this allows the user to retry the failed activity. Process types only. Activity developers might implement a component using this interface and associate it with the activity in question. When done, the default binding (XBL) representing the activity in the Activity Manager window will automatically show a retry button attached to the activity.
- nsIActivityCancelHandler: If provided with the activity, this allows the user to cancel the activity. Process types only. Activity developers might implement a component using this interface and associate it with the activity in question. When done, the default binding (XBL) representing the activity in the Activity Manager window will automatically show a cancel button attached to the activity.
- nsIActivityUndoHandler: If provided with the activity, this allows the user to undo the operation subject of the event. Persisted events might not be undone. This feature hopefully will be supported in the future when we have a better undo mechanism in place. Obviously event types only. Activity developers might implement a component using this interface and associate it with the activity in question. When done, default binding (XBL) representing the activity in the Activity Manager window will automatically show a undo button attached to the activity.
- nsIActivityRecoveryHandler: If provided with the activity, this allows the user to activate the operation to recover from the sitation causing the warning. Warning types only. Activity developers might implement a component using this interface and associate it with the activity in question. When done, the default binding (XBL) representing the activity in the Activity Manager window will automatically show a pause / resume button attached to the activity.
Default components
- @mozilla.org/activity-manager;1: Implements the
nsIActivityManager
. Provides the facilities to manage activities introduced by the backend, extensions and the user.
- @mozilla.org/activity-process;1: The default implementation of a process activity. It knows how to deal with different process states. In the majority of cases it is enough to instantiate this component to add a new process activity to the Activity Management system.
- @mozilla.org/activity-event;1: The default implementation of an event activity. In the majority of cases it is enough to instantiate this component to add a new event activity to the Activity Management system.
- @mozilla.org/activity-warning;1: The default implementation of a warning activity. In the majority of cases it is enough to instantiate this component to add a new Warning activity to the Activity Management system.