1package Net::XMPP2::Extendable; 2use warnings; 3use strict; 4 5=head1 NAME 6 7Net::XMPP2::Extendable - Extendable baseclass 8 9=head1 DESCRIPTION 10 11This class provides a mechanism to add extensions. 12Please note that the class that derives from this must also 13derive from L<Net::XMPP2::Event>! 14 15Please see L<Net::XMPP2::Ext> for more information about this mechanism. 16 17=over 4 18 19=item B<add_extension ($ext)> 20 21This method extends the current object with a L<Net::XMPP2::Ext> object. 22C<$ext> must be an instance of L<Net::XMPP2::Ext>. 23 24=cut 25 26sub add_extension { 27 my ($self, $ext) = @_; 28 $self->add_forward ($ext, sub { 29 my ($self, $ext, $ev, @args) = @_; 30 $ext->_event ($ev, $self, @args); 31 }); 32} 33 34=item B<remove_extension ($ext)> 35 36This method removes the extension C<$ext>. 37 38=cut 39 40sub remove_extension { 41 my ($self, $ext) = @_; 42 $self->remove_forward ($ext); 43} 44 45=item B<disco_feature> 46 47This method can be overwritten by the extension and should return 48a list of namespace URIs of the features that the extension enables. 49 50=cut 51 52sub disco_feature { } 53 54=back 55 56=head1 AUTHOR 57 58Robin Redeker, C<< <elmex at ta-sa.org> >>, JID: C<< <elmex at jabber.org> >> 59 60=head1 COPYRIGHT & LICENSE 61 62Copyright 2007 Robin Redeker, all rights reserved. 63 64This program is free software; you can redistribute it and/or modify it 65under the same terms as Perl itself. 66 67=cut 68 691; # End of Net::XMPP2 70