Home | History | Annotate | Download | only in xmpp
      1 /*
      2  * libjingle
      3  * Copyright 2004--2005, Google Inc.
      4  *
      5  * Redistribution and use in source and binary forms, with or without
      6  * modification, are permitted provided that the following conditions are met:
      7  *
      8  *  1. Redistributions of source code must retain the above copyright notice,
      9  *     this list of conditions and the following disclaimer.
     10  *  2. Redistributions in binary form must reproduce the above copyright notice,
     11  *     this list of conditions and the following disclaimer in the documentation
     12  *     and/or other materials provided with the distribution.
     13  *  3. The name of the author may not be used to endorse or promote products
     14  *     derived from this software without specific prior written permission.
     15  *
     16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
     17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     18  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
     19  * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     21  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     22  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     23  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     24  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
     25  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     26  */
     27 
     28 #ifndef TALK_XMPP_CONSTANTS_H_
     29 #define TALK_XMPP_CONSTANTS_H_
     30 
     31 #include <string>
     32 #include "talk/xmllite/qname.h"
     33 #include "talk/xmpp/jid.h"
     34 
     35 
     36 #define NS_CLIENT Constants::ns_client()
     37 #define NS_SERVER Constants::ns_server()
     38 #define NS_STREAM Constants::ns_stream()
     39 #define NS_XSTREAM Constants::ns_xstream()
     40 #define NS_TLS Constants::ns_tls()
     41 #define NS_SASL Constants::ns_sasl()
     42 #define NS_BIND Constants::ns_bind()
     43 #define NS_DIALBACK Constants::ns_dialback()
     44 #define NS_SESSION Constants::ns_session()
     45 #define NS_STANZA Constants::ns_stanza()
     46 #define NS_PRIVACY Constants::ns_privacy()
     47 #define NS_ROSTER Constants::ns_roster()
     48 #define NS_VCARD Constants::ns_vcard()
     49 #define NS_AVATAR_HASH Constants::ns_avatar_hash()
     50 #define NS_VCARD_UPDATE Constants::ns_vcard_update()
     51 #define STR_CLIENT Constants::str_client()
     52 #define STR_SERVER Constants::str_server()
     53 #define STR_STREAM Constants::str_stream()
     54 
     55 
     56 namespace buzz {
     57 
     58 extern const Jid JID_EMPTY;
     59 
     60 class Constants {
     61  public:
     62   static const std::string & ns_client();
     63   static const std::string & ns_server();
     64   static const std::string & ns_stream();
     65   static const std::string & ns_xstream();
     66   static const std::string & ns_tls();
     67   static const std::string & ns_sasl();
     68   static const std::string & ns_bind();
     69   static const std::string & ns_dialback();
     70   static const std::string & ns_session();
     71   static const std::string & ns_stanza();
     72   static const std::string & ns_privacy();
     73   static const std::string & ns_roster();
     74   static const std::string & ns_vcard();
     75   static const std::string & ns_avatar_hash();
     76   static const std::string & ns_vcard_update();
     77 
     78   static const std::string & str_client();
     79   static const std::string & str_server();
     80   static const std::string & str_stream();
     81 };
     82 
     83 extern const std::string STR_GET;
     84 extern const std::string STR_SET;
     85 extern const std::string STR_RESULT;
     86 extern const std::string STR_ERROR;
     87 
     88 
     89 extern const std::string STR_FROM;
     90 extern const std::string STR_TO;
     91 extern const std::string STR_BOTH;
     92 extern const std::string STR_REMOVE;
     93 
     94 extern const std::string STR_MESSAGE;
     95 extern const std::string STR_BODY;
     96 extern const std::string STR_PRESENCE;
     97 extern const std::string STR_STATUS;
     98 extern const std::string STR_SHOW;
     99 extern const std::string STR_PRIOIRTY;
    100 extern const std::string STR_IQ;
    101 
    102 extern const std::string STR_TYPE;
    103 extern const std::string STR_NAME;
    104 extern const std::string STR_ID;
    105 extern const std::string STR_JID;
    106 extern const std::string STR_SUBSCRIPTION;
    107 extern const std::string STR_ASK;
    108 extern const std::string STR_X;
    109 extern const std::string STR_GOOGLE_COM;
    110 extern const std::string STR_GMAIL_COM;
    111 extern const std::string STR_GOOGLEMAIL_COM;
    112 extern const std::string STR_DEFAULT_DOMAIN;
    113 extern const std::string STR_TALK_GOOGLE_COM;
    114 extern const std::string STR_TALKX_L_GOOGLE_COM;
    115 
    116 #ifdef FEATURE_ENABLE_VOICEMAIL
    117 extern const std::string STR_VOICEMAIL;
    118 extern const std::string STR_OUTGOINGVOICEMAIL;
    119 #endif
    120 
    121 extern const std::string STR_UNAVAILABLE;
    122 
    123 extern const QName QN_STREAM_STREAM;
    124 extern const QName QN_STREAM_FEATURES;
    125 extern const QName QN_STREAM_ERROR;
    126 
    127 extern const QName QN_XSTREAM_BAD_FORMAT;
    128 extern const QName QN_XSTREAM_BAD_NAMESPACE_PREFIX;
    129 extern const QName QN_XSTREAM_CONFLICT;
    130 extern const QName QN_XSTREAM_CONNECTION_TIMEOUT;
    131 extern const QName QN_XSTREAM_HOST_GONE;
    132 extern const QName QN_XSTREAM_HOST_UNKNOWN;
    133 extern const QName QN_XSTREAM_IMPROPER_ADDRESSIING;
    134 extern const QName QN_XSTREAM_INTERNAL_SERVER_ERROR;
    135 extern const QName QN_XSTREAM_INVALID_FROM;
    136 extern const QName QN_XSTREAM_INVALID_ID;
    137 extern const QName QN_XSTREAM_INVALID_NAMESPACE;
    138 extern const QName QN_XSTREAM_INVALID_XML;
    139 extern const QName QN_XSTREAM_NOT_AUTHORIZED;
    140 extern const QName QN_XSTREAM_POLICY_VIOLATION;
    141 extern const QName QN_XSTREAM_REMOTE_CONNECTION_FAILED;
    142 extern const QName QN_XSTREAM_RESOURCE_CONSTRAINT;
    143 extern const QName QN_XSTREAM_RESTRICTED_XML;
    144 extern const QName QN_XSTREAM_SEE_OTHER_HOST;
    145 extern const QName QN_XSTREAM_SYSTEM_SHUTDOWN;
    146 extern const QName QN_XSTREAM_UNDEFINED_CONDITION;
    147 extern const QName QN_XSTREAM_UNSUPPORTED_ENCODING;
    148 extern const QName QN_XSTREAM_UNSUPPORTED_STANZA_TYPE;
    149 extern const QName QN_XSTREAM_UNSUPPORTED_VERSION;
    150 extern const QName QN_XSTREAM_XML_NOT_WELL_FORMED;
    151 extern const QName QN_XSTREAM_TEXT;
    152 
    153 extern const QName QN_TLS_STARTTLS;
    154 extern const QName QN_TLS_REQUIRED;
    155 extern const QName QN_TLS_PROCEED;
    156 extern const QName QN_TLS_FAILURE;
    157 
    158 extern const QName QN_SASL_MECHANISMS;
    159 extern const QName QN_SASL_MECHANISM;
    160 extern const QName QN_SASL_AUTH;
    161 extern const QName QN_SASL_CHALLENGE;
    162 extern const QName QN_SASL_RESPONSE;
    163 extern const QName QN_SASL_ABORT;
    164 extern const QName QN_SASL_SUCCESS;
    165 extern const QName QN_SASL_FAILURE;
    166 extern const QName QN_SASL_ABORTED;
    167 extern const QName QN_SASL_INCORRECT_ENCODING;
    168 extern const QName QN_SASL_INVALID_AUTHZID;
    169 extern const QName QN_SASL_INVALID_MECHANISM;
    170 extern const QName QN_SASL_MECHANISM_TOO_WEAK;
    171 extern const QName QN_SASL_NOT_AUTHORIZED;
    172 extern const QName QN_SASL_TEMPORARY_AUTH_FAILURE;
    173 
    174 extern const QName QN_DIALBACK_RESULT;
    175 extern const QName QN_DIALBACK_VERIFY;
    176 
    177 extern const QName QN_STANZA_BAD_REQUEST;
    178 extern const QName QN_STANZA_CONFLICT;
    179 extern const QName QN_STANZA_FEATURE_NOT_IMPLEMENTED;
    180 extern const QName QN_STANZA_FORBIDDEN;
    181 extern const QName QN_STANZA_GONE;
    182 extern const QName QN_STANZA_INTERNAL_SERVER_ERROR;
    183 extern const QName QN_STANZA_ITEM_NOT_FOUND;
    184 extern const QName QN_STANZA_JID_MALFORMED;
    185 extern const QName QN_STANZA_NOT_ACCEPTABLE;
    186 extern const QName QN_STANZA_NOT_ALLOWED;
    187 extern const QName QN_STANZA_PAYMENT_REQUIRED;
    188 extern const QName QN_STANZA_RECIPIENT_UNAVAILABLE;
    189 extern const QName QN_STANZA_REDIRECT;
    190 extern const QName QN_STANZA_REGISTRATION_REQUIRED;
    191 extern const QName QN_STANZA_REMOTE_SERVER_NOT_FOUND;
    192 extern const QName QN_STANZA_REMOTE_SERVER_TIMEOUT;
    193 extern const QName QN_STANZA_RESOURCE_CONSTRAINT;
    194 extern const QName QN_STANZA_SERVICE_UNAVAILABLE;
    195 extern const QName QN_STANZA_SUBSCRIPTION_REQUIRED;
    196 extern const QName QN_STANZA_UNDEFINED_CONDITION;
    197 extern const QName QN_STANZA_UNEXPECTED_REQUEST;
    198 extern const QName QN_STANZA_TEXT;
    199 
    200 extern const QName QN_BIND_BIND;
    201 extern const QName QN_BIND_RESOURCE;
    202 extern const QName QN_BIND_JID;
    203 
    204 extern const QName QN_MESSAGE;
    205 extern const QName QN_BODY;
    206 extern const QName QN_SUBJECT;
    207 extern const QName QN_THREAD;
    208 extern const QName QN_PRESENCE;
    209 extern const QName QN_SHOW;
    210 extern const QName QN_STATUS;
    211 extern const QName QN_LANG;
    212 extern const QName QN_PRIORITY;
    213 extern const QName QN_IQ;
    214 extern const QName QN_ERROR;
    215 
    216 extern const QName QN_SERVER_MESSAGE;
    217 extern const QName QN_SERVER_BODY;
    218 extern const QName QN_SERVER_SUBJECT;
    219 extern const QName QN_SERVER_THREAD;
    220 extern const QName QN_SERVER_PRESENCE;
    221 extern const QName QN_SERVER_SHOW;
    222 extern const QName QN_SERVER_STATUS;
    223 extern const QName QN_SERVER_LANG;
    224 extern const QName QN_SERVER_PRIORITY;
    225 extern const QName QN_SERVER_IQ;
    226 extern const QName QN_SERVER_ERROR;
    227 
    228 extern const QName QN_SESSION_SESSION;
    229 
    230 extern const QName QN_PRIVACY_QUERY;
    231 extern const QName QN_PRIVACY_ACTIVE;
    232 extern const QName QN_PRIVACY_DEFAULT;
    233 extern const QName QN_PRIVACY_LIST;
    234 extern const QName QN_PRIVACY_ITEM;
    235 extern const QName QN_PRIVACY_IQ;
    236 extern const QName QN_PRIVACY_MESSAGE;
    237 extern const QName QN_PRIVACY_PRESENCE_IN;
    238 extern const QName QN_PRIVACY_PRESENCE_OUT;
    239 
    240 extern const QName QN_ROSTER_QUERY;
    241 extern const QName QN_ROSTER_ITEM;
    242 extern const QName QN_ROSTER_GROUP;
    243 
    244 extern const QName QN_VCARD;
    245 extern const QName QN_VCARD_FN;
    246 extern const QName QN_VCARD_PHOTO;
    247 extern const QName QN_VCARD_PHOTO_BINVAL;
    248 extern const QName QN_VCARD_AVATAR_HASH;
    249 extern const QName QN_VCARD_AVATAR_HASH_MODIFIED;
    250 
    251 #if defined(FEATURE_ENABLE_PSTN)
    252 extern const QName QN_VCARD_TEL;
    253 extern const QName QN_VCARD_VOICE;
    254 extern const QName QN_VCARD_HOME;
    255 extern const QName QN_VCARD_WORK;
    256 extern const QName QN_VCARD_CELL;
    257 extern const QName QN_VCARD_NUMBER;
    258 #endif
    259 
    260 #if defined(FEATURE_ENABLE_RICHPROFILES)
    261 extern const QName QN_USER_PROFILE_QUERY;
    262 extern const QName QN_USER_PROFILE_URL;
    263 
    264 extern const QName QN_ATOM_FEED;
    265 extern const QName QN_ATOM_ENTRY;
    266 extern const QName QN_ATOM_TITLE;
    267 extern const QName QN_ATOM_ID;
    268 extern const QName QN_ATOM_MODIFIED;
    269 extern const QName QN_ATOM_IMAGE;
    270 extern const QName QN_ATOM_LINK;
    271 extern const QName QN_ATOM_HREF;
    272 #endif
    273 
    274 extern const QName QN_XML_LANG;
    275 
    276 extern const QName QN_ENCODING;
    277 extern const QName QN_VERSION;
    278 extern const QName QN_TO;
    279 extern const QName QN_FROM;
    280 extern const QName QN_TYPE;
    281 extern const QName QN_ID;
    282 extern const QName QN_CODE;
    283 extern const QName QN_NAME;
    284 extern const QName QN_VALUE;
    285 extern const QName QN_ACTION;
    286 extern const QName QN_ORDER;
    287 extern const QName QN_MECHANISM;
    288 extern const QName QN_ASK;
    289 extern const QName QN_JID;
    290 extern const QName QN_SUBSCRIPTION;
    291 extern const QName QN_TITLE1;
    292 extern const QName QN_TITLE2;
    293 extern const QName QN_AFFILIATION;
    294 extern const QName QN_ROLE;
    295 
    296 
    297 extern const QName QN_XMLNS_CLIENT;
    298 extern const QName QN_XMLNS_SERVER;
    299 extern const QName QN_XMLNS_STREAM;
    300 
    301 // Presence
    302 extern const std::string STR_SHOW_AWAY;
    303 extern const std::string STR_SHOW_CHAT;
    304 extern const std::string STR_SHOW_DND;
    305 extern const std::string STR_SHOW_XA;
    306 extern const std::string STR_SHOW_OFFLINE;
    307 
    308 // Subscription
    309 extern const std::string STR_SUBSCRIBE;
    310 extern const std::string STR_SUBSCRIBED;
    311 extern const std::string STR_UNSUBSCRIBE;
    312 extern const std::string STR_UNSUBSCRIBED;
    313 
    314 // Google Invite
    315 extern const std::string NS_GOOGLE_SUBSCRIBE;
    316 extern const QName QN_INVITATION;
    317 extern const QName QN_INVITE_NAME;
    318 extern const QName QN_INVITE_SUBJECT;
    319 extern const QName QN_INVITE_MESSAGE;
    320 
    321 
    322 // JEP 0030
    323 extern const QName QN_NODE;
    324 extern const QName QN_CATEGORY;
    325 extern const QName QN_VAR;
    326 extern const std::string NS_DISCO_INFO;
    327 extern const std::string NS_DISCO_ITEMS;
    328 
    329 extern const QName QN_DISCO_INFO_QUERY;
    330 extern const QName QN_DISCO_IDENTITY;
    331 extern const QName QN_DISCO_FEATURE;
    332 
    333 extern const QName QN_DISCO_ITEMS_QUERY;
    334 extern const QName QN_DISCO_ITEM;
    335 
    336 
    337 // JEP 0045
    338 extern const std::string NS_MUC;
    339 extern const QName QN_MUC_X;
    340 extern const QName QN_MUC_ITEM;
    341 extern const QName QN_MUC_AFFILIATION;
    342 extern const QName QN_MUC_ROLE;
    343 extern const std::string STR_AFFILIATION_NONE;
    344 extern const std::string STR_ROLE_PARTICIPANT;
    345 extern const std::string NS_MUC_USER;
    346 extern const QName QN_MUC_USER_CONTINUE;
    347 extern const QName QN_MUC_USER_X;
    348 extern const QName QN_MUC_USER_ITEM;
    349 extern const QName QN_MUC_USER_STATUS;
    350 
    351 
    352 // JEP 0115
    353 extern const std::string NS_CAPS;
    354 extern const QName QN_CAPS_C;
    355 extern const QName QN_VER;
    356 extern const QName QN_EXT;
    357 
    358 
    359 // Avatar - JEP 0153
    360 extern const std::string kNSVCard;
    361 extern const QName kQnVCardX;
    362 extern const QName kQnVCardPhoto;
    363 
    364 // JEP 0172 User Nickname
    365 extern const std::string kNSNickname;
    366 extern const QName kQnNickname;
    367 
    368 
    369 // JEP 0085 chat state
    370 extern const std::string NS_CHATSTATE;
    371 extern const QName QN_CS_ACTIVE;
    372 extern const QName QN_CS_COMPOSING;
    373 extern const QName QN_CS_PAUSED;
    374 extern const QName QN_CS_INACTIVE;
    375 extern const QName QN_CS_GONE;
    376 
    377 // JEP 0091 Delayed Delivery
    378 extern const std::string kNSDelay;
    379 extern const QName kQnDelayX;
    380 extern const QName kQnStamp;
    381 
    382 // Google time stamping (higher resolution)
    383 extern const std::string kNSTimestamp;
    384 extern const QName kQnTime;
    385 extern const QName kQnMilliseconds;
    386 
    387 
    388 extern const std::string NS_JINGLE_INFO;
    389 extern const QName QN_JINGLE_INFO_QUERY;
    390 extern const QName QN_JINGLE_INFO_STUN;
    391 extern const QName QN_JINGLE_INFO_RELAY;
    392 extern const QName QN_JINGLE_INFO_SERVER;
    393 extern const QName QN_JINGLE_INFO_TOKEN;
    394 extern const QName QN_JINGLE_INFO_HOST;
    395 extern const QName QN_JINGLE_INFO_TCP;
    396 extern const QName QN_JINGLE_INFO_UDP;
    397 extern const QName QN_JINGLE_INFO_TCPSSL;
    398 
    399 extern const std::string NS_GOOGLE_CALLPERF_STATS;
    400 extern const QName QN_CALLPERF_STATS;
    401 extern const QName QN_CALLPERF_SESSIONID;
    402 extern const QName QN_CALLPERF_LOCALUSER;
    403 extern const QName QN_CALLPERF_REMOTEUSER;
    404 extern const QName QN_CALLPERF_STARTTIME;
    405 extern const QName QN_CALLPERF_CALL_LENGTH;
    406 extern const QName QN_CALLPERF_DATAPOINT;
    407 extern const QName QN_CALLPERF_DATAPOINT_TIME;
    408 extern const QName QN_CALLPERF_DATAPOINT_FRACTION_LOST;
    409 extern const QName QN_CALLPERF_DATAPOINT_CUM_LOST;
    410 extern const QName QN_CALLPERF_DATAPOINT_EXT_MAX;
    411 extern const QName QN_CALLPERF_DATAPOINT_JITTER;
    412 extern const QName QN_CALLPERF_DATAPOINT_RTT;
    413 extern const QName QN_CALLPERF_DATAPOINT_BYTES_R;
    414 extern const QName QN_CALLPERF_DATAPOINT_PACKETS_R;
    415 extern const QName QN_CALLPERF_DATAPOINT_BYTES_S;
    416 extern const QName QN_CALLPERF_DATAPOINT_PACKETS_S;
    417 extern const QName QN_CALLPERF_CONNECTION;
    418 extern const QName QN_CALLPERF_CONNECTION_LOCAL_ADDRESS;
    419 extern const QName QN_CALLPERF_CONNECTION_REMOTE_ADDRESS;
    420 
    421 // Muc invites.
    422 extern const QName QN_MUC_USER_INVITE;
    423 
    424 // Multiway audio/video.
    425 extern const std::string NS_GOOGLE_MUC_USER;
    426 extern const QName QN_GOOGLE_MUC_USER_AVAILABLE_MEDIA;
    427 extern const QName QN_GOOGLE_MUC_USER_ENTRY;
    428 extern const QName QN_GOOGLE_MUC_USER_MEDIA;
    429 extern const QName QN_GOOGLE_MUC_USER_TYPE;
    430 extern const QName QN_GOOGLE_MUC_USER_SRC_ID;
    431 extern const QName QN_GOOGLE_MUC_USER_STATUS;
    432 extern const QName QN_LABEL;
    433 
    434 }  // namespace buzz
    435 
    436 #endif  // TALK_XMPP_CONSTANTS_H_
    437