1. -- 
  2. -- Copyright (c) 2012 Kevin Wellwood 
  3. -- All rights reserved. 
  4. -- 
  5. -- This source code is distributed under the Modified BSD License. For terms and 
  6. -- conditions, see license.txt. 
  7. -- 
  8.  
  9. package Events.Listeners is 
  10.  
  11.     -- Any class can implement the Event_Listener interface so it can register 
  12.     -- with an event corral to receive events. Handle_Event will be called on 
  13.     -- the listener when an event that the listener was registered for, fires. 
  14.     type Event_Listener is limited interface; 
  15.     type A_Event_Listener is access all Event_Listener'Class; 
  16.  
  17.     -- Handles an event the Event_Listener registered for. If 'evt' is returned 
  18.     -- null then the event was consumed and will not be passed on to other 
  19.     -- listeners. 'resp' is the handler's response to synchronous events that 
  20.     -- will be returned to a caller that triggered a synchronous event. 
  21.     procedure Handle_Event( this : access Event_Listener; 
  22.                             evt  : in out A_Event; 
  23.                             resp : out Response_Type ) is abstract; 
  24.  
  25.     -- Returns a string that identifies the Event_Listener object. 
  26.     function To_String( this : access Event_Listener ) return String is abstract; 
  27.  
  28. end Events.Listeners;