generic
type Target (<>) is tagged limited private;
package Widgets.Buttons.Simple_Listeners is
type A_Handler1 is access
procedure( object : not null access Target'Class );
type A_Handler2 is access
procedure( object : not null access Target'Class;
action : A_Button_Action );
function Listener( id : Action_Id;
obj : access Target'Class;
handler : not null A_Handler1 ) return A_Button_Listener;
pragma Postcondition( Listener'Result /= null );
function Listener( id : Action_Id;
obj : access Target'Class;
handler : not null A_Handler2 ) return A_Button_Listener;
pragma Postcondition( Listener'Result /= null );
function Listener( obj : access Target'Class;
handler : not null A_Handler1 ) return A_Button_Listener;
pragma Postcondition( Listener'Result /= null );
function Listener( obj : access Target'Class;
handler : not null A_Handler2 ) return A_Button_Listener;
pragma Postcondition( Listener'Result /= null );
private
type Simple_Button_Listener is new Simple_Action_Listener and
Button_Listener with
record
id : Action_Id;
object : access Target'Class := null;
handler1 : A_Handler1 := null;
handler2 : A_Handler2 := null;
end record;
procedure Handle_Action( this : access Simple_Button_Listener;
action : A_Button_Action );
end Widgets.Buttons.Simple_Listeners;