NAME

Decl::EventContext - base class implementing an event context in a declarative structure.

VERSION

Version 0.01

SYNOPSIS

Each node in a Decl structure that can respond to events can inherit from this class to get the proper machinery in place.

event_context_init()

Called during object creation to set up fields and such.

event_context()

Returns $self.

register_event($event, $closure), do ($event)

Registers and fires closures by name. This is the mechanism used by the 'on' tag in the core semantics. This is actually a command-line interface; fire runs the Text::ParseWords parse_line function on its input, and gives the event closure any list elements that come after the first word.

make_event

Given the name of a Decl event, finds the code referred to in its callable closure.

TODO: this is not covered by unit testing!

semantics()

Each event context can return a semantic handler. For example, a form knows that its core semantics are "wx"; a Word document knows that its core semantics are "ms-word", and so on. The semantic handlers are a good place to put common functionality for a given semantic domain, so they're useful in code snippets in a given context.

The default is to return the core semantics.

AUTHOR

Michael Roberts, <michael at vivtek.com>

BUGS

Please report any bugs or feature requests to bug-decl at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Decl. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

LICENSE AND COPYRIGHT

Copyright 2010 Michael Roberts.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.