gsimpleasyncresult.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright (C) 2006-2007 Red Hat, Inc.
  4. *
  5. * SPDX-License-Identifier: LGPL-2.1-or-later
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General
  18. * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  19. *
  20. * Author: Alexander Larsson <alexl@redhat.com>
  21. */
  22. #ifndef __G_SIMPLE_ASYNC_RESULT_H__
  23. #define __G_SIMPLE_ASYNC_RESULT_H__
  24. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  25. #error "Only <gio/gio.h> can be included directly."
  26. #endif
  27. #include <gio/giotypes.h>
  28. G_BEGIN_DECLS
  29. #define G_TYPE_SIMPLE_ASYNC_RESULT (g_simple_async_result_get_type ())
  30. #define G_SIMPLE_ASYNC_RESULT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_SIMPLE_ASYNC_RESULT, GSimpleAsyncResult))
  31. #define G_SIMPLE_ASYNC_RESULT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_SIMPLE_ASYNC_RESULT, GSimpleAsyncResultClass))
  32. #define G_IS_SIMPLE_ASYNC_RESULT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_SIMPLE_ASYNC_RESULT))
  33. #define G_IS_SIMPLE_ASYNC_RESULT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_SIMPLE_ASYNC_RESULT))
  34. #define G_SIMPLE_ASYNC_RESULT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_SIMPLE_ASYNC_RESULT, GSimpleAsyncResultClass))
  35. typedef struct _GSimpleAsyncResultClass GSimpleAsyncResultClass;
  36. GIO_AVAILABLE_IN_ALL
  37. GType g_simple_async_result_get_type (void) G_GNUC_CONST;
  38. GIO_DEPRECATED_IN_2_46_FOR(g_task_new)
  39. GSimpleAsyncResult *g_simple_async_result_new (GObject *source_object,
  40. GAsyncReadyCallback callback,
  41. gpointer user_data,
  42. gpointer source_tag);
  43. GIO_DEPRECATED_IN_2_46_FOR(g_task_new)
  44. GSimpleAsyncResult *g_simple_async_result_new_error (GObject *source_object,
  45. GAsyncReadyCallback callback,
  46. gpointer user_data,
  47. GQuark domain,
  48. gint code,
  49. const char *format,
  50. ...) G_GNUC_PRINTF (6, 7);
  51. GIO_DEPRECATED_IN_2_46_FOR(g_task_new)
  52. GSimpleAsyncResult *g_simple_async_result_new_from_error (GObject *source_object,
  53. GAsyncReadyCallback callback,
  54. gpointer user_data,
  55. const GError *error);
  56. GIO_DEPRECATED_IN_2_46_FOR(g_task_new)
  57. GSimpleAsyncResult *g_simple_async_result_new_take_error (GObject *source_object,
  58. GAsyncReadyCallback callback,
  59. gpointer user_data,
  60. GError *error);
  61. GIO_DEPRECATED_IN_2_46
  62. void g_simple_async_result_set_op_res_gpointer (GSimpleAsyncResult *simple,
  63. gpointer op_res,
  64. GDestroyNotify destroy_op_res);
  65. GIO_DEPRECATED_IN_2_46
  66. gpointer g_simple_async_result_get_op_res_gpointer (GSimpleAsyncResult *simple);
  67. GIO_DEPRECATED_IN_2_46
  68. void g_simple_async_result_set_op_res_gssize (GSimpleAsyncResult *simple,
  69. gssize op_res);
  70. GIO_DEPRECATED_IN_2_46
  71. gssize g_simple_async_result_get_op_res_gssize (GSimpleAsyncResult *simple);
  72. GIO_DEPRECATED_IN_2_46
  73. void g_simple_async_result_set_op_res_gboolean (GSimpleAsyncResult *simple,
  74. gboolean op_res);
  75. GIO_DEPRECATED_IN_2_46
  76. gboolean g_simple_async_result_get_op_res_gboolean (GSimpleAsyncResult *simple);
  77. GIO_AVAILABLE_IN_2_32 /* Also deprecated, but can't mark something both AVAILABLE and DEPRECATED */
  78. void g_simple_async_result_set_check_cancellable (GSimpleAsyncResult *simple,
  79. GCancellable *check_cancellable);
  80. GIO_DEPRECATED_IN_2_46
  81. gpointer g_simple_async_result_get_source_tag (GSimpleAsyncResult *simple);
  82. GIO_DEPRECATED_IN_2_46
  83. void g_simple_async_result_set_handle_cancellation (GSimpleAsyncResult *simple,
  84. gboolean handle_cancellation);
  85. GIO_DEPRECATED_IN_2_46
  86. void g_simple_async_result_complete (GSimpleAsyncResult *simple);
  87. GIO_DEPRECATED_IN_2_46
  88. void g_simple_async_result_complete_in_idle (GSimpleAsyncResult *simple);
  89. GIO_DEPRECATED_IN_2_46
  90. void g_simple_async_result_run_in_thread (GSimpleAsyncResult *simple,
  91. GSimpleAsyncThreadFunc func,
  92. int io_priority,
  93. GCancellable *cancellable);
  94. GIO_DEPRECATED_IN_2_46
  95. void g_simple_async_result_set_from_error (GSimpleAsyncResult *simple,
  96. const GError *error);
  97. GIO_DEPRECATED_IN_2_46
  98. void g_simple_async_result_take_error (GSimpleAsyncResult *simple,
  99. GError *error);
  100. GIO_DEPRECATED_IN_2_46
  101. gboolean g_simple_async_result_propagate_error (GSimpleAsyncResult *simple,
  102. GError **dest);
  103. GIO_DEPRECATED_IN_2_46
  104. void g_simple_async_result_set_error (GSimpleAsyncResult *simple,
  105. GQuark domain,
  106. gint code,
  107. const char *format,
  108. ...) G_GNUC_PRINTF (4, 5);
  109. GIO_DEPRECATED_IN_2_46
  110. void g_simple_async_result_set_error_va (GSimpleAsyncResult *simple,
  111. GQuark domain,
  112. gint code,
  113. const char *format,
  114. va_list args)
  115. G_GNUC_PRINTF(4, 0);
  116. GIO_DEPRECATED_IN_2_46
  117. gboolean g_simple_async_result_is_valid (GAsyncResult *result,
  118. GObject *source,
  119. gpointer source_tag);
  120. GIO_DEPRECATED_IN_2_46_FOR(g_task_report_error)
  121. void g_simple_async_report_error_in_idle (GObject *object,
  122. GAsyncReadyCallback callback,
  123. gpointer user_data,
  124. GQuark domain,
  125. gint code,
  126. const char *format,
  127. ...) G_GNUC_PRINTF(6, 7);
  128. GIO_DEPRECATED_IN_2_46_FOR(g_task_report_error)
  129. void g_simple_async_report_gerror_in_idle (GObject *object,
  130. GAsyncReadyCallback callback,
  131. gpointer user_data,
  132. const GError *error);
  133. GIO_DEPRECATED_IN_2_46_FOR(g_task_report_error)
  134. void g_simple_async_report_take_gerror_in_idle (GObject *object,
  135. GAsyncReadyCallback callback,
  136. gpointer user_data,
  137. GError *error);
  138. G_END_DECLS
  139. #endif /* __G_SIMPLE_ASYNC_RESULT_H__ */