| 38 * An opaque structure representing a DNS query. The hostname and port |
38 * An opaque structure representing a DNS query. The hostname and port |
| 39 * associated with the query can be retrieved using |
39 * associated with the query can be retrieved using |
| 40 * purple_dnsquery_get_host() and purple_dnsquery_get_port(). |
40 * purple_dnsquery_get_host() and purple_dnsquery_get_port(). |
| 41 */ |
41 */ |
| 42 typedef struct _PurpleDnsQueryData PurpleDnsQueryData; |
42 typedef struct _PurpleDnsQueryData PurpleDnsQueryData; |
| |
43 typedef struct _PurpleDnsQueryUiOps PurpleDnsQueryUiOps; |
| 43 |
44 |
| 44 /** |
45 /** |
| 45 * PurpleDnsQueryConnectFunction: |
46 * PurpleDnsQueryConnectFunction: |
| 46 * |
47 * |
| 47 * The "hosts" parameter is a linked list containing pairs of |
48 * The "hosts" parameter is a linked list containing pairs of |
| 64 */ |
65 */ |
| 65 typedef void (*PurpleDnsQueryFailedCallback) (PurpleDnsQueryData *query_data, const gchar *error_message); |
66 typedef void (*PurpleDnsQueryFailedCallback) (PurpleDnsQueryData *query_data, const gchar *error_message); |
| 66 |
67 |
| 67 /** |
68 /** |
| 68 * PurpleDnsQueryUiOps: |
69 * PurpleDnsQueryUiOps: |
| |
70 * @resolve_host: If implemented, return %TRUE if the UI takes responsibility |
| |
71 * for DNS queries. When returning %FALSE, the standard |
| |
72 * implementation is used. |
| |
73 * @destroy: Called just before @query_data is freed; this should cancel |
| |
74 * any further use of @query_data the UI would make. Unneeded if |
| |
75 * @resolve_host is not implemented. |
| 69 * |
76 * |
| 70 * DNS Request UI operations; UIs should implement this if they want to do DNS |
77 * DNS Request UI operations; UIs should implement this if they want to do DNS |
| 71 * lookups themselves, rather than relying on the core. |
78 * lookups themselves, rather than relying on the core. |
| 72 * |
79 * |
| 73 * @see @ref ui-ops |
80 * @see @ref ui-ops |
| 74 */ |
81 */ |
| 75 typedef struct |
82 struct _PurpleDnsQueryUiOps |
| 76 { |
83 { |
| 77 /** If implemented, return TRUE if the UI takes responsibility for DNS |
|
| 78 * queries. When returning FALSE, the standard implementation is used. */ |
|
| 79 gboolean (*resolve_host)(PurpleDnsQueryData *query_data, |
84 gboolean (*resolve_host)(PurpleDnsQueryData *query_data, |
| 80 PurpleDnsQueryResolvedCallback resolved_cb, |
85 PurpleDnsQueryResolvedCallback resolved_cb, |
| 81 PurpleDnsQueryFailedCallback failed_cb); |
86 PurpleDnsQueryFailedCallback failed_cb); |
| 82 |
87 |
| 83 /** Called just before @query_data is freed; this should cancel any |
|
| 84 * further use of @query_data the UI would make. Unneeded if |
|
| 85 * #resolve_host is not implemented. |
|
| 86 */ |
|
| 87 void (*destroy)(PurpleDnsQueryData *query_data); |
88 void (*destroy)(PurpleDnsQueryData *query_data); |
| 88 |
89 |
| 89 /*< private >*/ |
90 /*< private >*/ |
| 90 void (*_purple_reserved1)(void); |
91 void (*_purple_reserved1)(void); |
| 91 void (*_purple_reserved2)(void); |
92 void (*_purple_reserved2)(void); |
| 92 void (*_purple_reserved3)(void); |
93 void (*_purple_reserved3)(void); |
| 93 void (*_purple_reserved4)(void); |
94 void (*_purple_reserved4)(void); |
| 94 } PurpleDnsQueryUiOps; |
95 }; |
| 95 |
96 |
| 96 G_BEGIN_DECLS |
97 G_BEGIN_DECLS |
| 97 |
98 |
| 98 /**************************************************************************/ |
99 /**************************************************************************/ |
| 99 /** @name DNS query API */ |
100 /** @name DNS query API */ |