telepathygabble/inc/gabble-error.h
changeset 10 59927b2d3b75
parent 0 d0f3a028347a
equal deleted inserted replaced
0:d0f3a028347a 10:59927b2d3b75
     1 /*
       
     2  * gabble-error.h - Header for Gabble's error handling API
       
     3  * Copyright (C) 2006 Collabora Ltd.
       
     4  * 
       
     5  *   @author Ole Andre Vadla Ravnaas <ole.andre.ravnaas@collabora.co.uk>
       
     6  *
       
     7  * This library is free software; you can redistribute it and/or
       
     8  * modify it under the terms of the GNU Lesser General Public
       
     9  * License as published by the Free Software Foundation; either
       
    10  * version 2.1 of the License, or (at your option) any later version.
       
    11  *
       
    12  * This library is distributed in the hope that it will be useful,
       
    13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    15  * Lesser General Public License for more details.
       
    16  *
       
    17  * You should have received a copy of the GNU Lesser General Public
       
    18  * License along with this library; if not, write to the Free Software
       
    19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
       
    20  */
       
    21 
       
    22 #ifndef __GABBLE_ERROR_H__
       
    23 #define __GABBLE_ERROR_H__
       
    24 
       
    25 #include <glib.h>
       
    26 #include "loudmouth/loudmouth.h"
       
    27 
       
    28 typedef enum {
       
    29     XMPP_ERROR_REDIRECT = 0,            /* 302 */
       
    30     XMPP_ERROR_GONE,                    /* 302 */
       
    31 
       
    32     XMPP_ERROR_BAD_REQUEST,             /* 400 */
       
    33     XMPP_ERROR_UNEXPECTED_REQUEST,      /* 400 */
       
    34     XMPP_ERROR_JID_MALFORMED,           /* 400 */
       
    35 
       
    36     XMPP_ERROR_NOT_AUTHORIZED,          /* 401 */
       
    37 
       
    38     XMPP_ERROR_PAYMENT_REQUIRED,        /* 402 */
       
    39 
       
    40     XMPP_ERROR_FORBIDDEN,               /* 403 */
       
    41 
       
    42     XMPP_ERROR_ITEM_NOT_FOUND,          /* 404 */
       
    43     XMPP_ERROR_RECIPIENT_UNAVAILABLE,   /* 404 */
       
    44     XMPP_ERROR_REMOTE_SERVER_NOT_FOUND, /* 404 */
       
    45 
       
    46     XMPP_ERROR_NOT_ALLOWED,             /* 405 */
       
    47 
       
    48     XMPP_ERROR_NOT_ACCEPTABLE,          /* 406 */
       
    49 
       
    50     XMPP_ERROR_REGISTRATION_REQUIRED,   /* 407 */
       
    51     XMPP_ERROR_SUBSCRIPTION_REQUIRED,   /* 407 */
       
    52 
       
    53     XMPP_ERROR_REMOTE_SERVER_TIMEOUT,   /* 408, 504 */
       
    54 
       
    55     XMPP_ERROR_CONFLICT,                /* 409 */
       
    56 
       
    57     XMPP_ERROR_INTERNAL_SERVER_ERROR,   /* 500 */
       
    58     XMPP_ERROR_UNDEFINED_CONDITION,     /* 500 */
       
    59     XMPP_ERROR_RESOURCE_CONSTRAINT,     /* 500 */
       
    60 
       
    61     XMPP_ERROR_FEATURE_NOT_IMPLEMENTED, /* 501 */
       
    62 
       
    63     XMPP_ERROR_SERVICE_UNAVAILABLE,     /* 502, 503, 510 */
       
    64 
       
    65     XMPP_ERROR_JINGLE_OUT_OF_ORDER,
       
    66     XMPP_ERROR_JINGLE_UNKOWN_SESSION,
       
    67     XMPP_ERROR_JINGLE_UNSUPPORTED_CONTENT,
       
    68     XMPP_ERROR_JINGLE_UNSUPPORTED_TRANSPORT,
       
    69 
       
    70     NUM_XMPP_ERRORS,
       
    71 
       
    72     INVALID_XMPP_ERROR,
       
    73 } GabbleXmppError;
       
    74 
       
    75 GQuark gabble_xmpp_error_quark (void);
       
    76 #define GABBLE_XMPP_ERROR gabble_xmpp_error_quark ()
       
    77 
       
    78 GabbleXmppError gabble_xmpp_error_from_node (LmMessageNode *error_node);
       
    79 GError *gabble_xmpp_error_to_g_error (GabbleXmppError error);
       
    80 LmMessageNode *gabble_xmpp_error_to_node (GabbleXmppError error, LmMessageNode *parent_node, const gchar *errmsg);
       
    81 const gchar *gabble_xmpp_error_string (GabbleXmppError error);
       
    82 const gchar *gabble_xmpp_error_description (GabbleXmppError error);
       
    83 
       
    84 #endif /* __GABBLE_ERROR_H__ */