NAME

Net::Jabber::IQ::Roster - Jabber IQ Roster Module

SYNOPSIS

Net::Jabber::IQ::Roster is a companion to the Net::Jabber::IQ module.
It provides the user a simple interface to set and retrieve all parts 
of a Jabber IQ Roster query.

DESCRIPTION

To initialize the IQ with a Jabber <iq/> and then access the roster
query you must pass it the XML::Parser Tree array from the 
Net::Jabber::Client module.  In the callback function for the iq:

  use Net::Jabber;

  sub iq {
    my $iq = new Net::Jabber::IQ(@_);
    my $roster = $iq->GetQuery();
    .
    .
    .
  }

You now have access to all of the retrieval functions available.

To create a new IQ roster to send to the server:

  use Net::Jabber;

  $Client = new Net::Jabber::Client();
  ...

  $IQ = new Net::Jabber::IQ();
  $Roster = $IQ->NewQuery("roster");
  ...

  $Client->Send($IQ);

Using $Roster 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

@items  = $Roster->GetItems();

@roster = $Roster->GetTree();
$str    = $Roster->GetXML();

Creation functions

$item   = $Roster->AddItem();

METHODS

Retrieval functions

GetItems() - returns an array of Net::Jabber::IQ::Roster::Item objects.
             These can be modified or accessed with the functions
             available to them.

GetXML() - returns the XML string that represents the <query/>.
           This is used by the GetXML() function in IQ.pm to build
           the XML string for the <iq/> that contains this <query/>.

GetTree() - returns an array that contains the <query/> tag
            in XML::Parser Tree format.

Creation functions

AddItem(XML::Parser tree) - creates a new Net::Jabbber::IQ::Roster::Item
                            object and populates it with the tree if one
                            was passed in.  This returns the pointer to
                            the <item/> so you can modify it with the
                            creation functions from that module.

AUTHOR

By Ryan Eatmon in December of 1999 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.