SourceForge Logo

NAME

Boucherot::Handler - A class for storing Boucherot's ``handlers''

SYNOPSIS

DESCRIPTION

This is class provide an encapsulation for ``handlers'' used in boucherot.

An handler is a function/method that is called in a certain context.

Handlers are message_handler, print_handler, timeout_handler, command_handler. They're the one used in XChat-perl.

A message_handler is an handler called each time a message is received. For exemple, a message_hanlder on a ``JOIN'' event is called each time someone join a channel.

A print_handler is an handler called each time a message is to be print on a channel. This may look like message_handler, but it's not exactly the same.

A timeout_handler is an handler called a certain instant.

A command_handler is an handler called each time someone send a ``/'' command from the ``console''.

GISSUML MODEL

class Boucherot::Handler

Attributs :

 -  message_handled : { event : SCALAR => : handler, ... }
 -  cleaner : [ mid1 : SCALAR, ... ]

Methods :

 +$ new () : Boucherot::Handler
 +  add_message_handler ( event : SCALAR, subroutine_name [, ... ] )
 +  return_message_handler ( event : SCALAR ) : [ ... ]
 +  execute_message_handler ( infoline : B::Infoline )
 +  remove_message_handlers_from_class ( class : SCALAR )
 +  add_print_handler ( event : SCALAR, subroutine_name [, ... ] )
 +  return_print_handler ( event : SCALAR ) : [ ... ]
 +  return_print_handler_xchat ( event : SCALAR ) : [ ... ]
 +  execute_print_handler ( infoline : B::Infoline )
 +  remove_print_handlers_from_class ( class : SCALAR )
 +  add_command_handler ( command : SCALAR, subroutine_name [, ... ] )
 +  return_command_handler ( command : SCALAR ) : [ ... ]
 +  execute_command_handler ( line : SCALAR )
 +  remove_command_handlers_from_class ( class : SCALAR )
 +  add_ctcp_handler ( event : SCALAR, subroutine_name [, ... ] )
 +  return_ctcp_handler ( event : SCALAR ) : [ ... ]
 +  execute_ctcp_handler ( infoline : B::Infoline )
 +  remove_ctcp_handlers_from_class ( class : SCALAR )
 -  format_handler ( variant [, ... ]  ) : handler
 -  execute_handler ( func : handler, infoline : B::Infoline ) : SCALAR (Error command)
 -  add_handler ( kind : SCALAR, key : SCALAR, handler : handler ) :
 -  return_handler ( kind : SCALAR, key : SCALAR ) : [ handler1, handler2, ... ]
 -  remove_handlers_from_class ( class : SCALAR, kind : SCALAR ) :
 +  clean () :
 -  clean ( kind : SCALAR ) :

METHODS

new

 +$ new () : Boucherot::Handler

Create a new Boucherot::Handler.

add_message_handler

 +  add_message_handler ( event : SCALAR, subroutine_name [, ... ] )

Add a new ``message handler''.

subroutine_name is executed each time the IRC server send a line which event's type is event.

subroutine_name may be a name, but may also be what ever the privat method format_message_handler may take. See format_message_handler subsection for more informations.

return_message_handler

 +  return_message_handler ( event : SCALAR ) : [ ... ]

execute_message_handler

 +  execute_message_handler ( infoline : B::Infoline )

remove_message_handlers_from_class

 +  remove_message_handlers_from_class ( class : SCALAR )

add_print_handler

 +  add_print_handler ( event : SCALAR, subroutine_name [, ... ] )

Add a new ``print handler''.

subroutine_name is executed each time the IRC server send a line which event's type is event.

subroutine_name may be a name, but may also be what ever the privat method format_print_handler may take. See format_print_handler subsection for more informations.

return_print_handler

 +  return_print_handler ( event : SCALAR ) : [ ... ]

return_print_handler_xchat

 +  return_print_handler_xchat ( event : SCALAR ) : [ ... ]

execute_print_handler

 +  execute_print_handler ( infoline : B::Infoline )

remove_print_handlers_from_class

 +  remove_print_handlers_from_class ( class : SCALAR )

add_command_handler

 +  add_command_handler ( command : SCALAR, subroutine_name [, ... ] )

Add a new ``command handler''.

... need comment here ...

return_command_handler

 +  return_command_handler ( command : SCALAR ) : [ ... ]

execute_command_handler

 +  execute_command_handler ( line : SCALAR )

remove_command_handlers_from_class

 +  remove_command_handlers_from_class ( class : SCALAR )

add_ctcp_handler

 +  add_ctcp_handler ( ctcp : SCALAR, subroutine_name [, ... ] )

Add a new ``message handler''.

subroutine_name is executed each time the IRC server send a line which ctcp's type is ctcp.

subroutine_name may be a name, but may also be what ever the privat method format_ctcp_handler may take. See format_ctcp_handler subsection for more informations.

return_ctcp_handler

 +  return_ctcp_handler ( ctcp : SCALAR ) : [ ... ]

execute_ctcp_handler

 +  execute_ctcp_handler ( infoline : B::Infoline )

remove_ctcp_handlers_from_class

 +  remove_ctcp_handlers_from_class ( class : SCALAR )

format_handler

 -  format_handler ( variant [, ... ]  ) : handler

Create an ``handler'' data structure. To be execute by the private method ``execute_handler''

execute_handler

 -  execute_handler ( func : handler, infoline : B::Infoline ) : SCALAR (Error command)

Execute a handler, created by format_handler.

add_handler

 -  add_handler ( kind : SCALAR, key : SCALAR, handler : handler ) :

Add an handler into internal attributs

return_handler

 -  return_handler ( kind : SCALAR, key : SCALAR ) : [ handler1, handler2, ... ]

Add an handler into internal attributs

remove_handlers_from_class

 -  remove_handlers_from_class ( class : SCALAR, kind : SCALAR ) :

Remove all handlers from a given class.

clean

 +  clean () :

clean

 -  clean ( kind : SCALAR ) :

AUTHORS

This class was written by Arthibus Gissehel <gissehel@vachefolle.com> in 2001.

see AUTHORS file from Boucherot's root project.

NOTES

This class is part of the Boucherot project.