Jabber::NS - Jabber namespaces


Jabber-Connection documentation Contained in the Jabber-Connection distribution.

Index


Code Index:

NAME

Top

Jabber::NS - Jabber namespaces

SYNOPSIS

Top

  use Jabber::NS qw(<some tag>);
  print NS_AUTH;  

DESCRIPTION

Top

Jabber::NS is simply a load of constants that reflect Jabber namespace constants (and other things). These can be imported into your program with the use statement. These namespace constants are based on those specified in the lib/lib.h file in the Jabber server source.

By default, nothing is imported - specify one or more tags or individual constants in the use statement as shown in the SYNOPSIS.

TAGs

Top

The tags are:

stream

Stream namespaces, such as jabber:client.

iq

IQ namespaces, such as jabber:iq:auth.

x

X namespaces, such as jabber:x:oob.

misc

Miscellaneous namespaces, such as the w3c one for XHTML.

flags

Various flags, such as r_HANDLED, used by Jabber::Connection.

all

You can use this to bring in all the namespaces that this module offers.

Don't forget to prefix these tag names with a colon, e.g.:

  use Jabber::NS qw(:iq :x);

SEE ALSO

Top

Jabber::NodeFactory, Jabber::Connection

AUTHOR

Top

DJ Adams

VERSION

Top

early

COPYRIGHT

Top


Jabber-Connection documentation Contained in the Jabber-Connection distribution.
package Jabber::NS;

# $Id: NS.pm,v 1.1.1.1 2001/09/21 17:20:54 dj Exp $

use strict;

# stream
use constant NS_CLIENT     => 'jabber:client';
use constant NS_SERVER     => 'jabber:server';
use constant NS_ACCEPT     => 'jabber:component:accept';

# iq
use constant NS_AUTH       => 'jabber:iq:auth';
use constant NS_REGISTER   => 'jabber:iq:register';
use constant NS_ROSTER     => 'jabber:iq:roster';
use constant NS_AGENT      => 'jabber:iq:agent';
use constant NS_AGENTS     => 'jabber:iq:agents';
use constant NS_VERSION    => 'jabber:iq:version';
use constant NS_TIME       => 'jabber:iq:time';
use constant NS_PRIVATE    => 'jabber:iq:private';
use constant NS_SEARCH     => 'jabber:iq:search';
use constant NS_OOB        => 'jabber:iq:oob';
use constant NS_ADMIN      => 'jabber:iq:admin';
use constant NS_FILTER     => 'jabber:iq:filter';
use constant NS_AUTH_0K    => 'jabber:iq:auth:0k';
use constant NS_BROWSE     => 'jabber:iq:browse';
use constant NS_CONFERENCE => 'jabber:iq:conference';
use constant NS_GATEWAY    => 'jabber:iq:gateway';
use constant NS_LAST       => 'jabber:iq:last';
use constant NS_RPC        => 'jabber:iq:rpc';

# x
use constant NS_OFFLINE    => 'jabber:x:offline';
use constant NS_DELAY      => 'jabber:x:delay';
use constant NS_XOOB       => 'jabber:x:oob';
use constant NS_EVENT      => 'jabber:x:event';
use constant NS_SIGNED     => 'jabber:x:signed';
use constant NS_ENCRYPTED  => 'jabber:x:encrypted';
use constant NS_ENVELOPE   => 'jabber:x:envelope';
use constant NS_EXPIRE     => 'jabber:x:expire';

# misc
use constant NS_VCARD      => 'vcard-temp';
use constant NS_XHTML      => 'http://www.w3.org/1999/xhtml';

use constant IQ_GET        => 'get';
use constant IQ_SET        => 'set';
use constant IQ_ERROR      => 'error';
use constant IQ_RESULT     => 'result';

# flags
use constant r_HANDLED     => '!jabber-connection-handled!';


use Exporter;
use vars qw/@ISA @EXPORT_OK %EXPORT_TAGS/;
@ISA=qw(Exporter);

%EXPORT_TAGS = (
  'stream' => [qw(NS_CLIENT NS_SERVER NS_ACCEPT)],
  'iq'     => [qw(NS_AUTH NS_REGISTER NS_ROSTER NS_AGENT
                  NS_AGENTS NS_VERSION NS_TIME NS_PRIVATE
                  NS_SEARCH NS_OOB NS_ADMIN NS_FILTER NS_AUTH_0K 
                  NS_BROWSE NS_CONFERENCE NS_GATEWAY NS_LAST NS_RPC)],
  'x'      => [qw(NS_OFFLINE NS_DELAY NS_XOOB NS_EVENT
                  NS_SIGNED NS_ENCRYPTED NS_ENVELOPE NS_EXPIRE)],
  'misc'   => [qw(NS_VCARD NS_XHTML IQ_GET IQ_SET IQ_ERROR IQ_RESULT)],
  'flags'  => [qw(r_HANDLED)],
);

my $con;
push @EXPORT_OK, @$con while (undef, $con) = each %EXPORT_TAGS;


$EXPORT_TAGS{'all'} = \@EXPORT_OK;

1;