1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
2 | /* |
3 | * Copyright (C) 2008 Red Hat, Inc. |
4 | */ |
5 | |
6 | #ifndef __SOUP_SESSION_FEATURE_H__ |
7 | #define __SOUP_SESSION_FEATURE_H__ 1 |
8 | |
9 | #include <libsoup/soup-types.h> |
10 | |
11 | G_BEGIN_DECLS |
12 | |
13 | #define SOUP_TYPE_SESSION_FEATURE (soup_session_feature_get_type ()) |
14 | #define SOUP_SESSION_FEATURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_SESSION_FEATURE, SoupSessionFeature)) |
15 | #define SOUP_SESSION_FEATURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_SESSION_FEATURE, SoupSessionFeatureInterface)) |
16 | #define SOUP_IS_SESSION_FEATURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUP_TYPE_SESSION_FEATURE)) |
17 | #define SOUP_IS_SESSION_FEATURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SOUP_TYPE_SESSION_FEATURE)) |
18 | #define SOUP_SESSION_FEATURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SOUP_TYPE_SESSION_FEATURE, SoupSessionFeatureInterface)) |
19 | |
20 | typedef struct { |
21 | GTypeInterface parent; |
22 | |
23 | /* methods */ |
24 | void (*attach) (SoupSessionFeature *feature, |
25 | SoupSession *session); |
26 | void (*detach) (SoupSessionFeature *feature, |
27 | SoupSession *session); |
28 | |
29 | void (*request_queued) (SoupSessionFeature *feature, |
30 | SoupSession *session, |
31 | SoupMessage *msg); |
32 | void (*request_started) (SoupSessionFeature *feature, |
33 | SoupSession *session, |
34 | SoupMessage *msg, |
35 | SoupSocket *socket); |
36 | void (*request_unqueued) (SoupSessionFeature *feature, |
37 | SoupSession *session, |
38 | SoupMessage *msg); |
39 | |
40 | gboolean (*add_feature) (SoupSessionFeature *feature, |
41 | GType type); |
42 | gboolean (*remove_feature) (SoupSessionFeature *feature, |
43 | GType type); |
44 | gboolean (*has_feature) (SoupSessionFeature *feature, |
45 | GType type); |
46 | |
47 | } SoupSessionFeatureInterface; |
48 | |
49 | SOUP_AVAILABLE_IN_2_24 |
50 | GType soup_session_feature_get_type (void); |
51 | |
52 | SOUP_AVAILABLE_IN_2_24 |
53 | void soup_session_feature_attach (SoupSessionFeature *feature, |
54 | SoupSession *session); |
55 | SOUP_AVAILABLE_IN_2_24 |
56 | void soup_session_feature_detach (SoupSessionFeature *feature, |
57 | SoupSession *session); |
58 | |
59 | SOUP_AVAILABLE_IN_2_34 |
60 | gboolean soup_session_feature_add_feature (SoupSessionFeature *feature, |
61 | GType type); |
62 | SOUP_AVAILABLE_IN_2_34 |
63 | gboolean soup_session_feature_remove_feature (SoupSessionFeature *feature, |
64 | GType type); |
65 | SOUP_AVAILABLE_IN_2_34 |
66 | gboolean soup_session_feature_has_feature (SoupSessionFeature *feature, |
67 | GType type); |
68 | |
69 | G_END_DECLS |
70 | |
71 | #endif /* __SOUP_SESSION_FEATURE_H__ */ |
72 | |