| 1 | package Jabber::NS; | ||
| 2 | |||
| 3 | # $Id: NS.pm,v 1.1.1.1 2001/09/21 17:20:54 dj Exp $ | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | Jabber::NS - Jabber namespaces | ||
| 8 | |||
| 9 | =head1 SYNOPSIS | ||
| 10 | |||
| 11 | use Jabber::NS qw(<some tag>); | ||
| 12 | print NS_AUTH; | ||
| 13 | |||
| 14 | =head1 DESCRIPTION | ||
| 15 | |||
| 16 | Jabber::NS is simply a load of constants that reflect Jabber | ||
| 17 | namespace constants (and other things). These can be imported | ||
| 18 | into your program with the C<use> statement. These namespace | ||
| 19 | constants are based on those specified in the lib/lib.h file | ||
| 20 | in the Jabber server source. | ||
| 21 | |||
| 22 | By default, nothing is imported - specify one or more tags or | ||
| 23 | individual constants in the C<use> statement as shown in the | ||
| 24 | SYNOPSIS. | ||
| 25 | |||
| 26 | =head1 TAGs | ||
| 27 | |||
| 28 | The tags are: | ||
| 29 | |||
| 30 | =over 4 | ||
| 31 | |||
| 32 | =item stream | ||
| 33 | |||
| 34 | Stream namespaces, such as B<jabber:client>. | ||
| 35 | |||
| 36 | =item iq | ||
| 37 | |||
| 38 | IQ namespaces, such as B<jabber:iq:auth>. | ||
| 39 | |||
| 40 | =item x | ||
| 41 | |||
| 42 | X namespaces, such as B<jabber:x:oob>. | ||
| 43 | |||
| 44 | =item misc | ||
| 45 | |||
| 46 | Miscellaneous namespaces, such as the w3c one for XHTML. | ||
| 47 | |||
| 48 | =item flags | ||
| 49 | |||
| 50 | Various flags, such as r_HANDLED, used by Jabber::Connection. | ||
| 51 | |||
| 52 | =item all | ||
| 53 | |||
| 54 | You can use this to bring in all the namespaces that | ||
| 55 | this module offers. | ||
| 56 | |||
| 57 | =back | ||
| 58 | |||
| 59 | Don't forget to prefix these tag names with a colon, e.g.: | ||
| 60 | |||
| 61 | use Jabber::NS qw(:iq :x); | ||
| 62 | |||
| 63 | =cut | ||
| 64 | |||
| 65 | use strict; | ||
| 66 | |||
| 67 | # stream | ||
| 68 | use constant NS_CLIENT => 'jabber:client'; | ||
| 69 | use constant NS_SERVER => 'jabber:server'; | ||
| 70 | use constant NS_ACCEPT => 'jabber:component:accept'; | ||
| 71 | |||
| 72 | # iq | ||
| 73 | use constant NS_AUTH => 'jabber:iq:auth'; | ||
| 74 | use constant NS_REGISTER => 'jabber:iq:register'; | ||
| 75 | use constant NS_ROSTER => 'jabber:iq:roster'; | ||
| 76 | use constant NS_AGENT => 'jabber:iq:agent'; | ||
| 77 | use constant NS_AGENTS => 'jabber:iq:agents'; | ||
| 78 | use constant NS_VERSION => 'jabber:iq:version'; | ||
| 79 | use constant NS_TIME => 'jabber:iq:time'; | ||
| 80 | use constant NS_PRIVATE => 'jabber:iq:private'; | ||
| 81 | use constant NS_SEARCH => 'jabber:iq:search'; | ||
| 82 | use constant NS_OOB => 'jabber:iq:oob'; | ||
| 83 | use constant NS_ADMIN => 'jabber:iq:admin'; | ||
| 84 | use constant NS_FILTER => 'jabber:iq:filter'; | ||
| 85 | use constant NS_AUTH_0K => 'jabber:iq:auth:0k'; | ||
| 86 | use constant NS_BROWSE => 'jabber:iq:browse'; | ||
| 87 | use constant NS_CONFERENCE => 'jabber:iq:conference'; | ||
| 88 | use constant NS_GATEWAY => 'jabber:iq:gateway'; | ||
| 89 | use constant NS_LAST => 'jabber:iq:last'; | ||
| 90 | use constant NS_RPC => 'jabber:iq:rpc'; | ||
| 91 | |||
| 92 | # x | ||
| 93 | use constant NS_OFFLINE => 'jabber:x:offline'; | ||
| 94 | use constant NS_DELAY => 'jabber:x:delay'; | ||
| 95 | use constant NS_XOOB => 'jabber:x:oob'; | ||
| 96 | use constant NS_EVENT => 'jabber:x:event'; | ||
| 97 | use constant NS_SIGNED => 'jabber:x:signed'; | ||
| 98 | use constant NS_ENCRYPTED => 'jabber:x:encrypted'; | ||
| 99 | use constant NS_ENVELOPE => 'jabber:x:envelope'; | ||
| 100 | use constant NS_EXPIRE => 'jabber:x:expire'; | ||
| 101 | |||
| 102 | # misc | ||
| 103 | use constant NS_VCARD => 'vcard-temp'; | ||
| 104 | use constant NS_XHTML => 'http://www.w3.org/1999/xhtml'; | ||
| 105 | |||
| 106 | use constant IQ_GET => 'get'; | ||
| 107 | use constant IQ_SET => 'set'; | ||
| 108 | use constant IQ_ERROR => 'error'; | ||
| 109 | use constant IQ_RESULT => 'result'; | ||
| 110 | |||
| 111 | # flags | ||
| 112 | use constant r_HANDLED => '!jabber-connection-handled!'; | ||
| 113 | |||
| 114 | |||
| 115 | use Exporter; | ||
| 116 | use vars qw/@ISA @EXPORT_OK %EXPORT_TAGS/; | ||
| 117 | @ISA=qw(Exporter); | ||
| 118 | |||
| 119 | %EXPORT_TAGS = ( | ||
| 120 | 'stream' => [qw(NS_CLIENT NS_SERVER NS_ACCEPT)], | ||
| 121 | 'iq' => [qw(NS_AUTH NS_REGISTER NS_ROSTER NS_AGENT | ||
| 122 | NS_AGENTS NS_VERSION NS_TIME NS_PRIVATE | ||
| 123 | NS_SEARCH NS_OOB NS_ADMIN NS_FILTER NS_AUTH_0K | ||
| 124 | NS_BROWSE NS_CONFERENCE NS_GATEWAY NS_LAST NS_RPC)], | ||
| 125 | 'x' => [qw(NS_OFFLINE NS_DELAY NS_XOOB NS_EVENT | ||
| 126 | NS_SIGNED NS_ENCRYPTED NS_ENVELOPE NS_EXPIRE)], | ||
| 127 | 'misc' => [qw(NS_VCARD NS_XHTML IQ_GET IQ_SET IQ_ERROR IQ_RESULT)], | ||
| 128 | 'flags' => [qw(r_HANDLED)], | ||
| 129 | ); | ||
| 130 | |||
| 131 | my $con; | ||
| 132 | push @EXPORT_OK, @$con while (undef, $con) = each %EXPORT_TAGS; | ||
| 133 | |||
| 134 | |||
| 135 | $EXPORT_TAGS{'all'} = \@EXPORT_OK; | ||
| 136 | |||
| 137 | =head1 SEE ALSO | ||
| 138 | |||
| 139 | Jabber::NodeFactory, Jabber::Connection | ||
| 140 | |||
| 141 | =head1 AUTHOR | ||
| 142 | |||
| 143 | DJ Adams | ||
| 144 | |||
| 145 | =head1 VERSION | ||
| 146 | |||
| 147 | early | ||
| 148 | |||
| 149 | =head1 COPYRIGHT | ||
| 150 | |||
| 151 | This module is free software; you can redistribute it and/or modify | ||
| 152 | it under the same terms as Perl itself. | ||
| 153 | |||
| 154 | =cut | ||
| 155 | |||
| 156 | 1; |