My favorites | Sign in
Project Logo
                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/*
The MIT License

Copyright (c) 2008 jacob berkman <jacob@ilovegom.org>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef GOM_XML_HTTP_REQUEST_H
#define GOM_XML_HTTP_REQUEST_H

#include <glib/gmacros.h>

G_BEGIN_DECLS

typedef struct _GomXMLHttpRequest GomXMLHttpRequest; /* dummy object */
typedef struct _GomXMLHttpRequestInterface GomXMLHttpRequestInterface;

typedef enum {
GOM_UNSENT = 0,
GOM_OPENED = 1,
GOM_HEADERS_RECEIVED = 2,
GOM_LOADING = 3,
GOM_DONE = 4
} GomXmlHttpRequestState;

typedef GomXmlHttpRequestState GomXMLHttpRequestState;

#define GOM_XML_HTTP_REQUEST_OMITTED ((const char *)GINT_TO_POINTER(1))

G_END_DECLS

#include <gom/dom/gomdocument.h>

G_BEGIN_DECLS

#define GOM_TYPE_XML_HTTP_REQUEST (gom_xml_http_request_get_type ())
#define GOM_XML_HTTP_REQUEST(i) (G_TYPE_CHECK_INSTANCE_CAST ((i), GOM_TYPE_XML_HTTP_REQUEST, GomXMLHttpRequest))
#define GOM_IS_XML_HTTP_REQUEST(i) (G_TYPE_CHECK_INSTANCE_TYPE ((i), GOM_TYPE_XML_HTTP_REQUEST))
#define GOM_XML_HTTP_REQUEST_GET_INTERFACE(i) (G_TYPE_INSTANCE_GET_INTERFACE ((i), GOM_TYPE_XML_HTTP_REQUEST, GomXMLHttpRequestInterface))

#define _GOM_IMPLEMENT_XML_HTTP_REQUEST(i, p, f) (((GomXMLHttpRequestInterface*)i)->f = p##_##f)
#define GOM_IMPLEMENT_XML_HTTP_REQUEST(i, p) \
G_STMT_START { \
_GOM_IMPLEMENT_XML_HTTP_REQUEST (i, p, open); \
_GOM_IMPLEMENT_XML_HTTP_REQUEST (i, p, set_request_header); \
_GOM_IMPLEMENT_XML_HTTP_REQUEST (i, p, send); \
_GOM_IMPLEMENT_XML_HTTP_REQUEST (i, p, send_string); \
_GOM_IMPLEMENT_XML_HTTP_REQUEST (i, p, send_document); \
_GOM_IMPLEMENT_XML_HTTP_REQUEST (i, p, abort); \
_GOM_IMPLEMENT_XML_HTTP_REQUEST (i, p, get_all_response_headers); \
_GOM_IMPLEMENT_XML_HTTP_REQUEST (i, p, get_response_header); \
} G_STMT_END

struct _GomXMLHttpRequestInterface {
GTypeInterface parent;

void (*open) (GomXMLHttpRequest *xml_http_request,
const char *method,
const char *url,
gboolean async,
const char *user,
const char *password,
GError **error);

void (*set_request_header) (GomXMLHttpRequest *xml_http_request,
const char *header,
const char *value,
GError **error);

void (*send) (GomXMLHttpRequest *xml_http_request,
GError **error);

void (*send_string) (GomXMLHttpRequest *xml_http_request,
const char *data,
GError **error);

void (*send_document) (GomXMLHttpRequest *xml_http_request,
const GomDocument *doc,
GError **error);

void (*abort) (GomXMLHttpRequest *xml_http_request);

char *(*get_all_response_headers) (const GomXMLHttpRequest *xml_http_request,
GError **error);

char *(*get_response_header) (const GomXMLHttpRequest *xml_http_request,
const char *header,
GError **error);
};

GType gom_xml_http_request_get_type (void);

void gom_xml_http_request_open (GomXMLHttpRequest *xml_http_request,
const char *method,
const char *url,
gboolean async,
const char *user,
const char *password,
GError **error);

void gom_xml_http_request_set_request_header (GomXMLHttpRequest *xml_http_request,
const char *header,
const char *value,
GError **error);

void gom_xml_http_request_send (GomXMLHttpRequest *xml_http_request,
GError **error);

void gom_xml_http_request_send_string (GomXMLHttpRequest *xml_http_request,
const char *data,
GError **error);

void gom_xml_http_request_send_document (GomXMLHttpRequest *xml_http_request,
const GomDocument *doc,
GError **error);

void gom_xml_http_request_abort (GomXMLHttpRequest *xml_http_request);

char *gom_xml_http_request_get_all_response_headers (const GomXMLHttpRequest *xml_http_request,
GError **error);

char *gom_xml_http_request_get_response_header (const GomXMLHttpRequest *xml_http_request,
const char *header,
GError **error);

G_END_DECLS

#endif /* GOM_XML_HTTP_REQUEST_H */
Show details Hide details

Change log

r67 by ja...@87k.net on Aug 01, 2008   Diff
2008-08-01  jacob berkman
<jacob@ilovegom.org>

        * src/xpgom/xgGomModule.cc
(xgGomRegistrationProc): try to
        initialize Gtk

        * src/xpgom/xgDOMImplementation.cc
(xgDOMImplementation):
        initialize gdom
        (xgDOMImplementation): release
gdom
...
Go to: 
Project members, sign in to write a code review

Older revisions

r63 by ja...@87k.net on Jul 20, 2008   Diff
2008-07-20  jacob berkman
<jacob@ilovegom.org>

        * src/libgom/gomgcmanager.c:
remove GomGCManaged interface
...
All revisions of this file

File info

Size: 6351 bytes, 144 lines
Hosted by Google Code