add these to query session features. #565392.
[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 G_BEGIN_DECLS
13
14 #define SOUP_TYPE_SESSION            (soup_session_get_type ())
15 #define SOUP_SESSION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_SESSION, SoupSession))
16 #define SOUP_SESSION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_SESSION, SoupSessionClass))
17 #define SOUP_IS_SESSION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUP_TYPE_SESSION))
18 #define SOUP_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SOUP_TYPE_SESSION))
19 #define SOUP_SESSION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_SESSION, SoupSessionClass))
20
21 typedef void (*SoupSessionCallback) (SoupSession           *session,
22                                      SoupMessage           *msg,
23                                      gpointer               user_data);
24
25 struct _SoupSession {
26         GObject parent;
27
28 };
29
30 typedef struct {
31         GObjectClass parent_class;
32
33         /* signals */
34         void (*request_started) (SoupSession *session, SoupMessage *msg,
35                                  SoupSocket *socket);
36         void (*authenticate)    (SoupSession *session, SoupMessage *msg,
37                                  SoupAuth *auth, gboolean retrying);
38
39         /* methods */
40         void  (*queue_message)   (SoupSession *session, SoupMessage *msg,
41                                   SoupSessionCallback callback,
42                                   gpointer user_data);
43         void  (*requeue_message) (SoupSession *session, SoupMessage *msg);
44         guint (*send_message)    (SoupSession *session, SoupMessage *msg);
45
46         void  (*cancel_message)  (SoupSession *session, SoupMessage *msg,
47                                   guint status_code);
48
49         /* Padding for future expansion */
50         void (*_libsoup_reserved1) (void);
51         void (*_libsoup_reserved2) (void);
52         void (*_libsoup_reserved3) (void);
53         void (*_libsoup_reserved4) (void);
54 } SoupSessionClass;
55
56 GType soup_session_get_type (void);
57
58 #define SOUP_SESSION_PROXY_URI          "proxy-uri"
59 #define SOUP_SESSION_MAX_CONNS          "max-conns"
60 #define SOUP_SESSION_MAX_CONNS_PER_HOST "max-conns-per-host"
61 #define SOUP_SESSION_USE_NTLM           "use-ntlm"
62 #define SOUP_SESSION_SSL_CA_FILE        "ssl-ca-file"
63 #define SOUP_SESSION_ASYNC_CONTEXT      "async-context"
64 #define SOUP_SESSION_TIMEOUT            "timeout"
65 #define SOUP_SESSION_USER_AGENT         "user-agent"
66 #define SOUP_SESSION_IDLE_TIMEOUT       "idle-timeout"
67 #define SOUP_SESSION_ADD_FEATURE            "add-feature"
68 #define SOUP_SESSION_ADD_FEATURE_BY_TYPE    "add-feature-by-type"
69 #define SOUP_SESSION_REMOVE_FEATURE_BY_TYPE "remove-feature-by-type"
70
71 GMainContext   *soup_session_get_async_context(SoupSession           *session);
72
73 void            soup_session_queue_message    (SoupSession           *session,
74                                                SoupMessage           *msg,
75                                                SoupSessionCallback    callback,
76                                                gpointer               user_data);
77 void            soup_session_requeue_message  (SoupSession           *session,
78                                                SoupMessage           *msg);
79
80 guint           soup_session_send_message     (SoupSession           *session,
81                                                SoupMessage           *msg);
82
83 void            soup_session_pause_message    (SoupSession           *session,
84                                                SoupMessage           *msg);
85 void            soup_session_unpause_message  (SoupSession           *session,
86                                                SoupMessage           *msg);
87
88 void            soup_session_cancel_message   (SoupSession           *session,
89                                                SoupMessage           *msg,
90                                                guint                  status_code);
91 void            soup_session_abort            (SoupSession           *session);
92
93
94 void                soup_session_add_feature            (SoupSession        *session,
95                                                          SoupSessionFeature *feature);
96 void                soup_session_add_feature_by_type    (SoupSession        *session,
97                                                          GType               feature_type);
98 void                soup_session_remove_feature         (SoupSession        *session,
99                                                          SoupSessionFeature *feature);
100 void                soup_session_remove_feature_by_type (SoupSession        *session,
101                                                          GType               feature_type);
102 GSList             *soup_session_get_features           (SoupSession        *session,
103                                                          GType               feature_type);
104 SoupSessionFeature *soup_session_get_feature            (SoupSession        *session,
105                                                          GType               feature_type);
106
107 G_END_DECLS
108
109 #endif /* SOUP_SESSION_H */