4.  Events

No extensibility framework would be complete without an event system. Events are used to reflect changes in internal state of the application, and track actions by the user. They can contain any information and additionally can be filtered based on the information itself. Special targets are used, as in the other plugin hooks, to hold this information.

Event managers are defined to contain the different event types that a given component can export. Only one event manager object is instantiated for each component, and each plugin listening to events from that component are registered on that event manager directly.

Events handlers have priorities, and can swallow events, allowing some level of complexity of event routing. This feature might not prove useful and may be removed in the future if it isn't.

4.1. Defining an event hook

Not sure if this fits here as such. Probably temporary placeholder.

	    
<hook class="com.ximian.evolution.mail.events:1.0">
 <event
   target="target name"
   id="event name"
   type="pass | sink" ?
   priority="signed integer" ?
   enable="target mask" ?
   handle="function spec"/> *
</hook>
target
The target type of the event listener. This will normally match in a 1:1 relationship to the event id itself.
id
The name of the event to listen to. By convention the names will be of the form target.event. e.g. folder.changed, or message.read, etc. Although they are just simple case-sensitive strings.
type
The event listener type. The type maps directly to the corresponding corresponding EEventItem types.
priority
A signed integer specifying the priority of this event listener. 0 (zero) should be used normally, although positive and negative integers in the range -128 to 127 may aslo be used.
enable
A comma separated list of mask enumeration values used to qualify when this event listener is invoked. What values are valid depend on the event hook class.
handle
A plugin-type specific function specification. This function will be resolved and called when an event is routed to this listener.