20
20
* Author: Alexander Larsson <alexl@redhat.com>
23
#ifndef __G_SIMPLE_ASYNC_RESULT_H__
24
#define __G_SIMPLE_ASYNC_RESULT_H__
23
26
#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
24
27
#error "Only <gio/gio.h> can be included directly."
27
#ifndef __G_SIMPLE_ASYNC_RESULT_H__
28
#define __G_SIMPLE_ASYNC_RESULT_H__
30
30
#include <gio/giotypes.h>
46
46
typedef struct _GSimpleAsyncResultClass GSimpleAsyncResultClass;
49
50
GType g_simple_async_result_get_type (void) G_GNUC_CONST;
51
53
GSimpleAsyncResult *g_simple_async_result_new (GObject *source_object,
52
54
GAsyncReadyCallback callback,
53
55
gpointer user_data,
54
56
gpointer source_tag);
55
58
GSimpleAsyncResult *g_simple_async_result_new_error (GObject *source_object,
56
59
GAsyncReadyCallback callback,
57
60
gpointer user_data,
60
63
const char *format,
61
64
...) G_GNUC_PRINTF (6, 7);
62
66
GSimpleAsyncResult *g_simple_async_result_new_from_error (GObject *source_object,
63
67
GAsyncReadyCallback callback,
64
68
gpointer user_data,
65
69
const GError *error);
66
71
GSimpleAsyncResult *g_simple_async_result_new_take_error (GObject *source_object,
67
72
GAsyncReadyCallback callback,
68
73
gpointer user_data,
71
77
void g_simple_async_result_set_op_res_gpointer (GSimpleAsyncResult *simple,
73
79
GDestroyNotify destroy_op_res);
74
81
gpointer g_simple_async_result_get_op_res_gpointer (GSimpleAsyncResult *simple);
76
84
void g_simple_async_result_set_op_res_gssize (GSimpleAsyncResult *simple,
78
87
gssize g_simple_async_result_get_op_res_gssize (GSimpleAsyncResult *simple);
80
90
void g_simple_async_result_set_op_res_gboolean (GSimpleAsyncResult *simple,
82
93
gboolean g_simple_async_result_get_op_res_gboolean (GSimpleAsyncResult *simple);
86
97
GLIB_AVAILABLE_IN_2_32
87
98
void g_simple_async_result_set_check_cancellable (GSimpleAsyncResult *simple,
88
99
GCancellable *check_cancellable);
100
GLIB_AVAILABLE_IN_ALL
89
101
gpointer g_simple_async_result_get_source_tag (GSimpleAsyncResult *simple);
102
GLIB_AVAILABLE_IN_ALL
90
103
void g_simple_async_result_set_handle_cancellation (GSimpleAsyncResult *simple,
91
104
gboolean handle_cancellation);
105
GLIB_AVAILABLE_IN_ALL
92
106
void g_simple_async_result_complete (GSimpleAsyncResult *simple);
107
GLIB_AVAILABLE_IN_ALL
93
108
void g_simple_async_result_complete_in_idle (GSimpleAsyncResult *simple);
109
GLIB_AVAILABLE_IN_ALL
94
110
void g_simple_async_result_run_in_thread (GSimpleAsyncResult *simple,
95
111
GSimpleAsyncThreadFunc func,
97
113
GCancellable *cancellable);
114
GLIB_AVAILABLE_IN_ALL
98
115
void g_simple_async_result_set_from_error (GSimpleAsyncResult *simple,
99
116
const GError *error);
117
GLIB_AVAILABLE_IN_ALL
100
118
void g_simple_async_result_take_error (GSimpleAsyncResult *simple,
120
GLIB_AVAILABLE_IN_ALL
102
121
gboolean g_simple_async_result_propagate_error (GSimpleAsyncResult *simple,
123
GLIB_AVAILABLE_IN_ALL
104
124
void g_simple_async_result_set_error (GSimpleAsyncResult *simple,
107
127
const char *format,
108
128
...) G_GNUC_PRINTF (4, 5);
129
GLIB_AVAILABLE_IN_ALL
109
130
void g_simple_async_result_set_error_va (GSimpleAsyncResult *simple,
112
133
const char *format,
136
GLIB_AVAILABLE_IN_ALL
114
137
gboolean g_simple_async_result_is_valid (GAsyncResult *result,
116
139
gpointer source_tag);
141
GLIB_AVAILABLE_IN_ALL
118
142
void g_simple_async_report_error_in_idle (GObject *object,
119
143
GAsyncReadyCallback callback,
120
144
gpointer user_data,
123
147
const char *format,
148
...) G_GNUC_PRINTF(6, 7);
149
GLIB_AVAILABLE_IN_ALL
125
150
void g_simple_async_report_gerror_in_idle (GObject *object,
126
151
GAsyncReadyCallback callback,
127
152
gpointer user_data,
128
153
const GError *error);
154
GLIB_AVAILABLE_IN_ALL
129
155
void g_simple_async_report_take_gerror_in_idle (GObject *object,
130
156
GAsyncReadyCallback callback,
131
157
gpointer user_data,