You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

126 lines
6.0 KiB

  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright (C) 2006-2007 Red Hat, Inc.
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General
  16. * Public License along with this library; if not, write to the
  17. * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  18. * Boston, MA 02111-1307, USA.
  19. *
  20. * Author: Alexander Larsson <alexl@redhat.com>
  21. */
  22. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  23. #error "Only <gio/gio.h> can be included directly."
  24. #endif
  25. #ifndef __G_SIMPLE_ASYNC_RESULT_H__
  26. #define __G_SIMPLE_ASYNC_RESULT_H__
  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. /**
  36. * GSimpleAsyncResult:
  37. *
  38. * A simple implementation of #GAsyncResult.
  39. **/
  40. typedef struct _GSimpleAsyncResultClass GSimpleAsyncResultClass;
  41. GType g_simple_async_result_get_type (void) G_GNUC_CONST;
  42. GSimpleAsyncResult *g_simple_async_result_new (GObject *source_object,
  43. GAsyncReadyCallback callback,
  44. gpointer user_data,
  45. gpointer source_tag);
  46. GSimpleAsyncResult *g_simple_async_result_new_error (GObject *source_object,
  47. GAsyncReadyCallback callback,
  48. gpointer user_data,
  49. GQuark domain,
  50. gint code,
  51. const char *format,
  52. ...) G_GNUC_PRINTF (6, 7);
  53. GSimpleAsyncResult *g_simple_async_result_new_from_error (GObject *source_object,
  54. GAsyncReadyCallback callback,
  55. gpointer user_data,
  56. GError *error);
  57. void g_simple_async_result_set_op_res_gpointer (GSimpleAsyncResult *simple,
  58. gpointer op_res,
  59. GDestroyNotify destroy_op_res);
  60. gpointer g_simple_async_result_get_op_res_gpointer (GSimpleAsyncResult *simple);
  61. void g_simple_async_result_set_op_res_gssize (GSimpleAsyncResult *simple,
  62. gssize op_res);
  63. gssize g_simple_async_result_get_op_res_gssize (GSimpleAsyncResult *simple);
  64. void g_simple_async_result_set_op_res_gboolean (GSimpleAsyncResult *simple,
  65. gboolean op_res);
  66. gboolean g_simple_async_result_get_op_res_gboolean (GSimpleAsyncResult *simple);
  67. gpointer g_simple_async_result_get_source_tag (GSimpleAsyncResult *simple);
  68. void g_simple_async_result_set_handle_cancellation (GSimpleAsyncResult *simple,
  69. gboolean handle_cancellation);
  70. void g_simple_async_result_complete (GSimpleAsyncResult *simple);
  71. void g_simple_async_result_complete_in_idle (GSimpleAsyncResult *simple);
  72. void g_simple_async_result_run_in_thread (GSimpleAsyncResult *simple,
  73. GSimpleAsyncThreadFunc func,
  74. int io_priority,
  75. GCancellable *cancellable);
  76. void g_simple_async_result_set_from_error (GSimpleAsyncResult *simple,
  77. const GError *error);
  78. gboolean g_simple_async_result_propagate_error (GSimpleAsyncResult *simple,
  79. GError **dest);
  80. void g_simple_async_result_set_error (GSimpleAsyncResult *simple,
  81. GQuark domain,
  82. gint code,
  83. const char *format,
  84. ...) G_GNUC_PRINTF (4, 5);
  85. void g_simple_async_result_set_error_va (GSimpleAsyncResult *simple,
  86. GQuark domain,
  87. gint code,
  88. const char *format,
  89. va_list args);
  90. gboolean g_simple_async_result_is_valid (GAsyncResult *result,
  91. GObject *source,
  92. gpointer source_tag);
  93. void g_simple_async_report_error_in_idle (GObject *object,
  94. GAsyncReadyCallback callback,
  95. gpointer user_data,
  96. GQuark domain,
  97. gint code,
  98. const char *format,
  99. ...);
  100. void g_simple_async_report_gerror_in_idle (GObject *object,
  101. GAsyncReadyCallback callback,
  102. gpointer user_data,
  103. GError *error);
  104. G_END_DECLS
  105. #endif /* __G_SIMPLE_ASYNC_RESULT_H__ */