(soup_session_abort): New, to cancel all pending requests.
[platform/upstream/libsoup.git] / libsoup / soup-session.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2000-2003, Ximian, Inc.
4  */
5
6 #ifndef SOUP_SESSION_H
7 #define SOUP_SESSION_H 1
8
9 #include <libsoup/soup-types.h>
10 #include <libsoup/soup-message.h>
11
12 #define SOUP_TYPE_SESSION            (soup_session_get_type ())
13 #define SOUP_SESSION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_SESSION, SoupSession))
14 #define SOUP_SESSION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_SESSION, SoupSessionClass))
15 #define SOUP_IS_SESSION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUP_TYPE_SESSION))
16 #define SOUP_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SOUP_TYPE_SESSION))
17 #define SOUP_SESSION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_SESSION, SoupSessionClass))
18
19 typedef struct SoupSessionPrivate SoupSessionPrivate;
20
21 typedef struct {
22         GObject parent;
23
24         SoupSessionPrivate *priv;
25 } SoupSession;
26
27 typedef struct {
28         GObjectClass parent_class;
29
30         /* signals */
31         void (*authenticate)   (SoupSession *, SoupMessage *,
32                                 const char *auth_type, const char *auth_realm,
33                                 char **username, char **password);
34         void (*reauthenticate) (SoupSession *, SoupMessage *,
35                                 const char *auth_type, const char *auth_realm,
36                                 char **username, char **password);
37
38 } SoupSessionClass;
39
40 GType soup_session_get_type (void);
41
42 #define SOUP_SESSION_PROXY_URI          "proxy-uri"
43 #define SOUP_SESSION_MAX_CONNS          "max-conns"
44 #define SOUP_SESSION_MAX_CONNS_PER_HOST "max-conns-per-host"
45 #define SOUP_SESSION_USE_NTLM           "use-ntlm"
46
47 SoupSession    *soup_session_new              (void);
48 SoupSession    *soup_session_new_with_options (const char            *optname1,
49                                                ...);
50
51 void            soup_session_queue_message    (SoupSession           *session,
52                                                SoupMessage           *req,
53                                                SoupMessageCallbackFn  callback,
54                                                gpointer               user_data);
55 void            soup_session_requeue_message  (SoupSession           *session,
56                                                SoupMessage           *req);
57
58 guint           soup_session_send_message     (SoupSession           *session,
59                                                SoupMessage           *req);
60
61 void            soup_session_abort            (SoupSession           *session);
62
63
64 #endif /* SOUP_SESSION_H */