| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: (C) 1999-2008 Novell, Inc. (www.novell.com) |
| 3 |
* SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 |
*/ |
| 5 |
|
| 6 |
#ifndef E_SOAP_RESPONSE_H |
| 7 |
#define E_SOAP_RESPONSE_H |
| 8 |
|
| 9 |
#include <glib-object.h> |
| 10 |
#include <libsoup/soup-message.h> |
| 11 |
#include <libxml/tree.h> |
| 12 |
|
| 13 |
/* Standard GObject macros */ |
| 14 |
#define E_TYPE_SOAP_RESPONSE \ |
| 15 |
(e_soap_response_get_type ()) |
| 16 |
#define E_SOAP_RESPONSE(obj) \ |
| 17 |
(G_TYPE_CHECK_INSTANCE_CAST \ |
| 18 |
((obj), E_TYPE_SOAP_RESPONSE, ESoapResponse)) |
| 19 |
#define E_SOAP_RESPONSE_CLASS(cls) \ |
| 20 |
(G_TYPE_CHECK_CLASS_CAST \ |
| 21 |
((cls), E_TYPE_SOAP_RESPONSE, ESoapResponseClass)) |
| 22 |
#define E_IS_SOAP_RESPONSE(obj) \ |
| 23 |
(G_TYPE_CHECK_INSTANCE_TYPE \ |
| 24 |
((obj), E_TYPE_SOAP_RESPONSE)) |
| 25 |
#define E_IS_SOAP_RESPONSE_CLASS(cls) \ |
| 26 |
(G_TYPE_CHECK_CLASS_TYPE \ |
| 27 |
((cls), E_TYPE_SOAP_RESPONSE)) |
| 28 |
#define E_SOAP_RESPONSE_GET_CLASS(obj) \ |
| 29 |
(G_TYPE_INSTANCE_GET_CLASS \ |
| 30 |
((obj), E_TYPE_SOAP_RESPONSE, ESoapResponseClass)) |
| 31 |
|
| 32 |
G_BEGIN_DECLS |
| 33 |
|
| 34 |
/* By an amazing coincidence, this looks a lot like camel_progress() */ |
| 35 |
typedef void (* ESoapResponseProgressFn) (gpointer object, gint percent); |
| 36 |
|
| 37 |
typedef struct _ESoapResponse ESoapResponse; |
| 38 |
typedef struct _ESoapResponseClass ESoapResponseClass; |
| 39 |
typedef struct _ESoapResponsePrivate ESoapResponsePrivate; |
| 40 |
|
| 41 |
struct _ESoapResponse { |
| 42 |
GObject parent; |
| 43 |
ESoapResponsePrivate *priv; |
| 44 |
}; |
| 45 |
|
| 46 |
struct _ESoapResponseClass { |
| 47 |
GObjectClass parent_class; |
| 48 |
}; |
| 49 |
|
| 50 |
GType e_soap_response_get_type (void) G_GNUC_CONST; |
| 51 |
ESoapResponse * e_soap_response_new (void); |
| 52 |
ESoapResponse * e_soap_response_new_from_string (const gchar *xmlstr, |
| 53 |
gint xmlstr_length); |
| 54 |
ESoapResponse * e_soap_response_new_from_xmldoc (xmlDoc *xmldoc); |
| 55 |
gboolean e_soap_response_from_string (ESoapResponse *response, |
| 56 |
const gchar *xmlstr, |
| 57 |
gint xmlstr_length); |
| 58 |
gboolean e_soap_response_from_xmldoc (ESoapResponse *response, |
| 59 |
xmlDoc *xmldoc); |
| 60 |
gboolean e_soap_response_from_message_sync |
| 61 |
(ESoapResponse *response, |
| 62 |
SoupMessage *msg, |
| 63 |
GInputStream *response_data, |
| 64 |
GCancellable *cancellable, |
| 65 |
GError **error); |
| 66 |
xmlDoc * e_soap_response_xmldoc_from_message_sync |
| 67 |
(ESoapResponse *response, |
| 68 |
SoupMessage *msg, |
| 69 |
GInputStream *response_data, |
| 70 |
GCancellable *cancellable, |
| 71 |
GError **error); |
| 72 |
/* used only with e_soap_response_from_message_sync() */ |
| 73 |
void e_soap_response_set_store_node_data |
| 74 |
(ESoapResponse *response, |
| 75 |
const gchar *nodename, |
| 76 |
const gchar *directory, |
| 77 |
gboolean base64); |
| 78 |
/* used only with e_soap_response_from_message_sync() */ |
| 79 |
void e_soap_response_set_progress_fn (ESoapResponse *response, |
| 80 |
ESoapResponseProgressFn fn, |
| 81 |
gpointer object); |
| 82 |
const gchar * e_soap_response_get_method_name (ESoapResponse *response); |
| 83 |
void e_soap_response_set_method_name (ESoapResponse *response, |
| 84 |
const gchar *method_name); |
| 85 |
|
| 86 |
typedef xmlNode ESoapParameter; |
| 87 |
|
| 88 |
const gchar * e_soap_parameter_get_name (ESoapParameter *param); |
| 89 |
gint e_soap_parameter_get_int_value (ESoapParameter *param); |
| 90 |
guint64 e_soap_parameter_get_uint64_value |
| 91 |
(ESoapParameter *param); |
| 92 |
gchar * e_soap_parameter_get_string_value |
| 93 |
(ESoapParameter *param); |
| 94 |
ESoapParameter * |
| 95 |
e_soap_parameter_get_first_child |
| 96 |
(ESoapParameter *param); |
| 97 |
ESoapParameter * |
| 98 |
e_soap_parameter_get_first_child_by_name |
| 99 |
(ESoapParameter *param, |
| 100 |
const gchar *name); |
| 101 |
ESoapParameter * |
| 102 |
e_soap_parameter_get_next_child (ESoapParameter *param); |
| 103 |
ESoapParameter * |
| 104 |
e_soap_parameter_get_next_child_by_name |
| 105 |
(ESoapParameter *param, |
| 106 |
const gchar *name); |
| 107 |
gchar * e_soap_parameter_get_property (ESoapParameter *param, |
| 108 |
const gchar *prop_name); |
| 109 |
|
| 110 |
const GList * e_soap_response_get_parameters (ESoapResponse *response); |
| 111 |
ESoapParameter * |
| 112 |
e_soap_response_get_parameter (ESoapResponse *response); |
| 113 |
ESoapParameter * |
| 114 |
e_soap_response_get_first_parameter |
| 115 |
(ESoapResponse *response); |
| 116 |
ESoapParameter * |
| 117 |
e_soap_response_get_first_parameter_by_name |
| 118 |
(ESoapResponse *response, |
| 119 |
const gchar *name, |
| 120 |
GError **error); |
| 121 |
ESoapParameter * |
| 122 |
e_soap_response_get_next_parameter |
| 123 |
(ESoapResponse *response, |
| 124 |
ESoapParameter *from); |
| 125 |
ESoapParameter * |
| 126 |
e_soap_response_get_next_parameter_by_name |
| 127 |
(ESoapResponse *response, |
| 128 |
ESoapParameter *from, |
| 129 |
const gchar *name); |
| 130 |
gint e_soap_response_dump_response (ESoapResponse *response, |
| 131 |
FILE *buffer); |
| 132 |
gchar * e_soap_response_dump_parameter (ESoapResponse *response, |
| 133 |
ESoapParameter *param); |
| 134 |
|
| 135 |
G_END_DECLS |
| 136 |
|
| 137 |
#endif /* E_SOAP_RESPONSE_H */ |
| 138 |
|