NAME
Net::Jabber::X::Form - Jabber X Form Module
SYNOPSIS
Net::Jabber::X::Form is a companion to the Net::Jabber::X module.
It provides the user a simple interface to set and retrieve all parts
of a Jabber X Form.
DESCRIPTION
To initialize the X with a Jabber <x/> and then access the form
query you must pass it the XML::Parser Tree array from the
Net::Jabber::Client module. In the callback function for the x:
use Net::Jabber;
sub foo {
my $foo = new Net::Jabber::Foo(@_);
my $form = $foo->GetX();
.
.
.
}
You now have access to all of the retrieval functions available.
To create a new X form to send to the server:
use Net::Jabber;
$client = new Net::Jabber::Client();
...
$foo = new Net::Jabber::Foo();
$form = $foo->NewX("jabber:x:form");
...
$client->Send($foo);
Using $form you can call the creation functions below to populate the
tag before sending it.
For more information about the array format being passed to the CallBack
please read the Net::Jabber::Client documentation.
Retrieval functions
@fields = $form->GetFields();
@fieldTrees = $form->GetFieldTrees();
Creation functions
$field = $form->AddField();
$field = $form->AddField(jid=>"bob\@jabber.org",
name=>"Bob",
groups=>["school","friends"]);
METHODS
Retrieval functions
GetFields() - returns an array of Net::Jabber::X::Form::Field objects.
These can be modified or accessed with the functions
available to them.
GetFieldTrees() - returns an array of XML::Parser objects that contain
the data for each field.
Creation functions
AddField(hash) - creates and returns a new Net::Jabbber::X::Form::Field
object. The argument hash is passed to the SetField
function. Check the Net::Jabber::X::Form::Field
for valid values.
AUTHOR
By Ryan Eatmon in February of 2001 for http://jabber.org..
COPYRIGHT
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.