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 | #include <libsoup/soup-message-queue.h> |
---|
12 | |
---|
13 | #define SOUP_TYPE_SESSION (soup_session_get_type ()) |
---|
14 | #define SOUP_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_SESSION, SoupSession)) |
---|
15 | #define SOUP_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_SESSION, SoupSessionClass)) |
---|
16 | #define SOUP_IS_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUP_TYPE_SESSION)) |
---|
17 | #define SOUP_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SOUP_TYPE_SESSION)) |
---|
18 | #define SOUP_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_SESSION, SoupSessionClass)) |
---|
19 | |
---|
20 | typedef struct SoupSessionPrivate SoupSessionPrivate; |
---|
21 | |
---|
22 | struct SoupSession { |
---|
23 | GObject parent; |
---|
24 | |
---|
25 | SoupSessionPrivate *priv; |
---|
26 | |
---|
27 | /* protected */ |
---|
28 | SoupMessageQueue *queue; |
---|
29 | }; |
---|
30 | |
---|
31 | typedef struct { |
---|
32 | GObjectClass parent_class; |
---|
33 | |
---|
34 | /* signals */ |
---|
35 | void (*authenticate) (SoupSession *, SoupMessage *, |
---|
36 | const char *auth_type, const char *auth_realm, |
---|
37 | char **username, char **password); |
---|
38 | void (*reauthenticate) (SoupSession *, SoupMessage *, |
---|
39 | const char *auth_type, const char *auth_realm, |
---|
40 | char **username, char **password); |
---|
41 | |
---|
42 | /* methods */ |
---|
43 | void (*queue_message) (SoupSession *session, SoupMessage *msg, |
---|
44 | SoupMessageCallbackFn callback, |
---|
45 | gpointer user_data); |
---|
46 | void (*requeue_message) (SoupSession *session, SoupMessage *msg); |
---|
47 | guint (*send_message) (SoupSession *session, SoupMessage *msg); |
---|
48 | |
---|
49 | void (*cancel_message) (SoupSession *session, SoupMessage *msg); |
---|
50 | |
---|
51 | } SoupSessionClass; |
---|
52 | |
---|
53 | GType soup_session_get_type (void); |
---|
54 | |
---|
55 | #define SOUP_SESSION_PROXY_URI "proxy-uri" |
---|
56 | #define SOUP_SESSION_MAX_CONNS "max-conns" |
---|
57 | #define SOUP_SESSION_MAX_CONNS_PER_HOST "max-conns-per-host" |
---|
58 | #define SOUP_SESSION_USE_NTLM "use-ntlm" |
---|
59 | #define SOUP_SESSION_SSL_CA_FILE "ssl-ca-file" |
---|
60 | |
---|
61 | void soup_session_add_filter (SoupSession *session, |
---|
62 | SoupMessageFilter *filter); |
---|
63 | void soup_session_remove_filter (SoupSession *session, |
---|
64 | SoupMessageFilter *filter); |
---|
65 | |
---|
66 | void soup_session_queue_message (SoupSession *session, |
---|
67 | SoupMessage *msg, |
---|
68 | SoupMessageCallbackFn callback, |
---|
69 | gpointer user_data); |
---|
70 | void soup_session_requeue_message (SoupSession *session, |
---|
71 | SoupMessage *msg); |
---|
72 | |
---|
73 | guint soup_session_send_message (SoupSession *session, |
---|
74 | SoupMessage *msg); |
---|
75 | |
---|
76 | void soup_session_cancel_message (SoupSession *session, |
---|
77 | SoupMessage *msg); |
---|
78 | void soup_session_abort (SoupSession *session); |
---|
79 | |
---|
80 | |
---|
81 | /* Protected methods */ |
---|
82 | SoupConnection *soup_session_get_connection (SoupSession *session, |
---|
83 | SoupMessage *msg, |
---|
84 | gboolean *try_pruning, |
---|
85 | gboolean *is_new); |
---|
86 | gboolean soup_session_try_prune_connection (SoupSession *session); |
---|
87 | |
---|
88 | |
---|
89 | #endif /* SOUP_SESSION_H */ |
---|