The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Jabber::X::SXPM::Map - Jabber X SXPM Map Module

SYNOPSIS

  Net::Jabber::X::SXPM::Map is a companion to the 
  Net::Jabber::X::SXPM module.  It provides the user a simple 
  interface to set and retrieve all parts of a Jabber SXPM Map.

DESCRIPTION

  To initialize the Map with a Jabber <x/> and then access the </x>
  you must pass it the XML::Parser Tree array from the 
  Net::Jabber::Client module.  In the callback function for the object
  type foo:

    use Net::Jabber;

    sub foo {
      my $foo = new Net::Jabber::Foo(@_);

      my @xTags = $foo->GetX("jabber:x:sxpm");

      my $xTag;
      foreach $xTag (@xTags) {
        my @maps = $xTag->GetMaps();
        my $map;
        foreach $map (@maps) {
          $map->GetXXXX();
          .
          .
          .
        }
      }
      .
      .
      .
    }

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

  To create a new IQ SXPM Map to send to the server:

    use Net::Jabber;

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

    $foo = new Net::Jabber::Foo();
    $sxpm = $foo->NewX("jabber:x:sxpm");
    $foo = $sxpm->AddMap();
    ...

    $client->Send($foo);

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

    $char  = $map->GetChar();
    $color = $map->GetColor();

    @map   = $map->GetTree();
    $str   = $map->GetXML();

Creation functions

    $map->SetMap(char=>"@");     # for erasing a pixel
    $map->SetMap(char=>"a",
                 color=>"#FFFFFF");
  
    $map->SetChar('b');
    $map->SetColor('#FF0000');

METHODS

Retrieval functions

  GetChar() - returns a string with the character of the <map/>.

  GetColor() - returns a string with the RGB color of the <map/>.

  GetXML() - returns the XML string that represents the <presence/>.
             This is used by the Send() function in Client.pm to send
             this object as a Jabber Presence.

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

Creation functions

  SetMap(char=>string,  - set multiple fields in the <map/>
         color=>string)   at one time.  This is a cumulative
                          and overwriting action.  If you
                          set the "char" twice, the second
                          setting is what is used.  If you set
                          the char, and then set the color
                          then both will be in the <map/>
                          tag.  For valid settings read the 
                          specific Set functions below.

  SetChar(string) - sets the character that is associated with this
                    color map entry.

  SetColor(string) - sets the color that is associated with this
                     color map entry.  Must be in RGB #xxxxxx format.

AUTHOR

By Ryan Eatmon in January 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.