Change the SoupURI properties to SoupAddress properties.
[platform/upstream/libsoup.git] / libsoup / soup-connection.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_CONNECTION_H
7 #define SOUP_CONNECTION_H 1
8
9 #include <time.h>
10
11 #include "soup-types.h"
12
13 G_BEGIN_DECLS
14
15 #define SOUP_TYPE_CONNECTION            (soup_connection_get_type ())
16 #define SOUP_CONNECTION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_CONNECTION, SoupConnection))
17 #define SOUP_CONNECTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_CONNECTION, SoupConnectionClass))
18 #define SOUP_IS_CONNECTION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUP_TYPE_CONNECTION))
19 #define SOUP_IS_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SOUP_TYPE_CONNECTION))
20 #define SOUP_CONNECTION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_CONNECTION, SoupConnectionClass))
21
22 typedef struct {
23         GObject parent;
24
25 } SoupConnection;
26
27 typedef struct {
28         GObjectClass parent_class;
29
30         /* signals */
31         void (*connect_result)  (SoupConnection *, guint);
32         void (*disconnected)    (SoupConnection *);
33
34         void (*request_started) (SoupConnection *, SoupMessage *);
35
36         /* methods */
37         void (*send_request) (SoupConnection *, SoupMessage *);
38 } SoupConnectionClass;
39
40 GType soup_connection_get_type (void);
41
42
43 typedef void  (*SoupConnectionCallback)        (SoupConnection   *conn,
44                                                 guint             status,
45                                                 gpointer          data);
46
47
48 #define SOUP_CONNECTION_SERVER_ADDRESS  "server_address"
49 #define SOUP_CONNECTION_PROXY_ADDRESS   "proxy-address"
50 #define SOUP_CONNECTION_SSL_CREDENTIALS "ssl-creds"
51 #define SOUP_CONNECTION_ASYNC_CONTEXT   "async-context"
52 #define SOUP_CONNECTION_TIMEOUT         "timeout"
53 #define SOUP_CONNECTION_IDLE_TIMEOUT    "idle-timeout"
54
55 SoupConnection *soup_connection_new            (const char       *propname1,
56                                                 ...) G_GNUC_NULL_TERMINATED;
57
58 void            soup_connection_connect_async  (SoupConnection   *conn,
59                                                 SoupConnectionCallback callback,
60                                                 gpointer          user_data);
61 guint           soup_connection_connect_sync   (SoupConnection   *conn);
62
63 void            soup_connection_disconnect     (SoupConnection   *conn);
64
65 SoupSocket     *soup_connection_get_socket     (SoupConnection   *conn);
66
67 gboolean        soup_connection_is_in_use      (SoupConnection   *conn);
68 time_t          soup_connection_last_used      (SoupConnection   *conn);
69
70 void            soup_connection_send_request   (SoupConnection   *conn,
71                                                 SoupMessage      *req);
72
73 void            soup_connection_reserve        (SoupConnection   *conn);
74 void            soup_connection_release        (SoupConnection   *conn);
75
76 G_END_DECLS
77
78 #endif /* SOUP_CONNECTION_H */