tizen 2.3.1 release
[external/gupnp.git] / libgupnp / gupnp-error.h
1 /*
2  * Copyright (C) 2006, 2007 OpenedHand Ltd.
3  *
4  * Author: Jorn Baayen <jorn@openedhand.com>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21
22 #ifndef __GUPNP_ERROR_H__
23 #define __GUPNP_ERROR_H__
24
25 #include <glib.h>
26
27 G_BEGIN_DECLS
28
29 GQuark
30 gupnp_server_error_quark (void) G_GNUC_CONST;
31
32 #define GUPNP_SERVER_ERROR (gupnp_server_error_quark ())
33
34 /**
35  * GUPnPServerError:
36  * @GUPNP_SERVER_ERROR_INTERNAL_SERVER_ERROR: Internal server error.
37  * @GUPNP_SERVER_ERROR_NOT_FOUND: The resource was not found.
38  * @GUPNP_SERVER_ERROR_NOT_IMPLEMENTED: This method is not implemented.
39  * @GUPNP_SERVER_ERROR_INVALID_RESPONSE: Invalid response.
40  * @GUPNP_SERVER_ERROR_INVALID_URL: Invalid URL.
41  * @GUPNP_SERVER_ERROR_OTHER: Unknown/unhandled error.
42  *
43  * #GError codes used for errors in the #GUPNP_SERVER_ERROR domain, when there
44  * is communication with another server.
45  */
46 typedef enum {
47         GUPNP_SERVER_ERROR_INTERNAL_SERVER_ERROR,
48         GUPNP_SERVER_ERROR_NOT_FOUND,
49         GUPNP_SERVER_ERROR_NOT_IMPLEMENTED,
50         GUPNP_SERVER_ERROR_INVALID_RESPONSE,
51         GUPNP_SERVER_ERROR_INVALID_URL,
52         GUPNP_SERVER_ERROR_OTHER
53 } GUPnPServerError;
54
55 GQuark
56 gupnp_eventing_error_quark (void) G_GNUC_CONST;
57
58 #define GUPNP_EVENTING_ERROR (gupnp_eventing_error_quark ())
59
60 /**
61  * GUPnPEventingError:
62  * @GUPNP_EVENTING_ERROR_SUBSCRIPTION_FAILED: The subscription attempt failed.
63  * @GUPNP_EVENTING_ERROR_SUBSCRIPTION_LOST: The subscription was lost.
64  * @GUPNP_EVENTING_ERROR_NOTIFY_FAILED: The notification failed.
65  *
66  * #GError codes used for errors in the #GUPNP_EVENTING_ERROR domain, during
67  * eventing of state variables.
68  */
69 typedef enum {
70         GUPNP_EVENTING_ERROR_SUBSCRIPTION_FAILED,
71         GUPNP_EVENTING_ERROR_SUBSCRIPTION_LOST,
72         GUPNP_EVENTING_ERROR_NOTIFY_FAILED
73 } GUPnPEventingError;
74
75 GQuark
76 gupnp_control_error_quark (void) G_GNUC_CONST;
77
78 #define GUPNP_CONTROL_ERROR (gupnp_control_error_quark ())
79
80 /**
81  * GUPnPControlError:
82  * @GUPNP_CONTROL_ERROR_INVALID_ACTION: The action name was invalid.
83  * @GUPNP_CONTROL_ERROR_INVALID_ARGS: The action arguments were invalid.
84  * @GUPNP_CONTROL_ERROR_OUT_OF_SYNC: Out of sync (deprecated).
85  * @GUPNP_CONTROL_ERROR_ACTION_FAILED: The action failed.
86  *
87  * #GError codes used for errors in the #GUPNP_CONTROL_ERROR domain, during
88  * invocation of service actions.
89  */
90 typedef enum {
91         GUPNP_CONTROL_ERROR_INVALID_ACTION = 401,
92         GUPNP_CONTROL_ERROR_INVALID_ARGS   = 402,
93         GUPNP_CONTROL_ERROR_OUT_OF_SYNC    = 403,
94         GUPNP_CONTROL_ERROR_ACTION_FAILED  = 501
95 } GUPnPControlError;
96
97 GQuark
98 gupnp_xml_error_quark (void) G_GNUC_CONST;
99
100 #define GUPNP_XML_ERROR (gupnp_xml_error_quark ())
101
102 /**
103  * GUPnPXMLError:
104  * @GUPNP_XML_ERROR_PARSE: Generic XML parsing error.
105  * @GUPNP_XML_ERROR_NO_NODE: A required XML node was not found.
106  * @GUPNP_XML_ERROR_EMPTY_NODE: An XML node is unexpectedly empty.
107  * @GUPNP_XML_ERROR_OTHER: Unknown/unhandled XML related errors.
108  *
109  * #GError codes used for errors in the #GUPNP_XML_ERROR domain, during
110  * processing of XML data.
111  */
112 typedef enum {
113         GUPNP_XML_ERROR_PARSE,
114         GUPNP_XML_ERROR_NO_NODE,
115         GUPNP_XML_ERROR_EMPTY_NODE,
116         GUPNP_XML_ERROR_OTHER
117 } GUPnPXMLError;
118
119 G_END_DECLS
120
121 #endif /* __GUPNP_ERROR_H__ */