270
edits
| Line 52: | Line 52: | ||
** Progress bar: <i>Self explanatory</i> | ** Progress bar: <i>Self explanatory</i> | ||
== | == Interfaces == | ||
* | * <b>nsIActivityMgrListener</b>: The implementor of this interface gets notified when an activity is added/removed to/from the activities list managed by Activity Manager. | ||
* <b>nsIActivityManager</b>: Keeps the list of the recent Processes and Events. It is also responsible of serialization/deserialization of the Events. Activity Manager doesn't add/remove activities but might change the state of the activities. | |||
is | * <b>nsIActivity</b>: Base interface for both nsIActivityProcess and nsIActivityEvent. Exposes common properties and methods. | ||
* <b>nsIActivityProcess</b>: [https://wiki.mozilla.org/Thunderbird:Activity_Manager#Processes Processes] activity types should implement this interface. Possible states are: | |||
** ACTIVITY_NOTSTARTED: State of an uninitialized activity. Represents an invalid activity. | |||
** ACTIVITY_INPROGESS: Initial state for a successfully initialized process activity. The progress of the activity can only be set in this state. | |||
** ACTIVITY_COMPLETED: Activity is successfully completed ([https://wiki.mozilla.org/Thunderbird:Activity_Manager#Processes Finished]). The activity should be removed from the activity list by the initiator. | |||
** ACTIVITY_FAILED: Activity failed due to an error. At this point, the initiator can set the state to ACTIVITY_WAITINGFORRETRY, if nsIActivityRetryable is supported. | |||
** ACTIVITY_CANCELED: Activity is canceled by the user. This is possible if the activity supports nsIActivityCancelable interface. | |||
** ACTIVITY_PAUSED: Activity is paused by the user. This is possible if the activity supports nsIActivityPausable interface. | |||
** ACTIVITY_WAITINGFORINPUT: A failure has been occurred, and the user needs to provides data to recover from the problem, such as account credentials, password etc.. | |||
** ACTIVITY_WAITINGFORRETRY: A failure has been occurred and the activity is waiting to be retried by the user, or by the Activity Manager. | |||
* <b>nsIActivityEvent</b>:[https://wiki.mozilla.org/Thunderbird:Activity_Manager#Events Event] activity types should implement this interface. ACTIVITY_COMPLETED is the only valid state for this type. | |||
* <b>nsIActivityListener</b>: The implementor of this interface gets notified when the activity in question changes state or changes progress. | |||
* <b> | * <b>nsIActivityPausable</b>: If provided with the activity, it allows the user to pause/resume the activity during its progress. Processes only. | ||
* | * <b>nsIActivityRetryable</b>: If provided with the activity, it allows the user to retry the failed activity. Processes only. | ||
* <b>nsIActivityCancelable</b>: If provided with the activity, it allows the user to cancel the activity. Processes only. | |||
* <b> | * <b>nsIActivityUndoable</b>: If provided with the activity, it allows the user to undo the operation subject of the event. Persisted Events cannot be undo.<i> This feature will be supported in the future when we have a better undo mechanism in place.</i> | ||
== Extending the Activity System == | == Extending the Activity System == | ||
edits