/*
 * bonobo-listener.idl: Generic listener handling interfaces
 *
 * Copyright (C) 2000,  Helix Code, Inc.
 *
 * Authors:
 *      Alex Graveley (alex@helixcode.com)
 *	Michael Meeks (michael@helixcode.com)
 */

#ifndef BONOBO_LISTENER_IDL
#define BONOBO_LISTENER_IDL

#include "Bonobo_Unknown.idl"

module Bonobo {
  
	interface Listener : Bonobo::Unknown {
  		/**
  		 * event:   Invokes a named event on this listener object,
  		 * thus a single Bonobo / CORBA object can multiplex
  		 * many event requests without the overhead of an
  		 * object per type of event we want to listen to.
  		 * @event_name: the name of the event
 		 * @args: A CORBA Any argument.
  		 */
 		oneway void event (in string event_name, in any args);

		void unImplemented  ();
		void unImplemented2 ();
  	};
  
  	interface EventSource : Bonobo::Unknown {
		exception UnknownListener {};
  
  		/**
 		 * addListener: Adds a listener to all events being
 		 * emitted by this object.
  		 * @l: the listener implementation.
		 *
		 * Adds a listener to this event source.
  		 */
 		void addListener (in Listener l);
  		
  		/**
 		 * addListenerWithMask: Adds a listener to certain events
 		 * emitted by this object.
 		 * @l: the listener implementation.
 		 * @event_mask: a comma-separated list of event names this listener 
		 * is interested in recieving. If this listener is already 
 		 * receiving events from this EventSource, only the 
 		 * events listed here will be delivered.
		 *
		 * Adds a listener to this event source with the given mask.
 		 */
 		void addListenerWithMask (in Listener l,
					  in string   event_mask);
 
 		/**
  		 * removeListener: Removes a listener
  		 * @l: the listener implementation
		 *
		 * Removes the listener from the notification list.
  		 */
 		void removeListener (in Listener l)
  			raises (UnknownListener);

		void unImplemented  ();
		void unImplemented2 ();
  	};
};

#endif /* BONOBO_LISTENER_IDL */

