gasyncresult.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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, see <http://www.gnu.org/licenses/>.
  17. *
  18. * Author: Alexander Larsson <[email protected]>
  19. */
  20. #ifndef __G_ASYNC_RESULT_H__
  21. #define __G_ASYNC_RESULT_H__
  22. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  23. #error "Only <gio/gio.h> can be included directly."
  24. #endif
  25. #include <gio/giotypes.h>
  26. G_BEGIN_DECLS
  27. #define G_TYPE_ASYNC_RESULT (g_async_result_get_type ())
  28. #define G_ASYNC_RESULT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_ASYNC_RESULT, GAsyncResult))
  29. #define G_IS_ASYNC_RESULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_ASYNC_RESULT))
  30. #define G_ASYNC_RESULT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_ASYNC_RESULT, GAsyncResultIface))
  31. /**
  32. * GAsyncResult:
  33. *
  34. * Holds results information for an asynchronous operation,
  35. * usually passed directly to a asynchronous _finish() operation.
  36. **/
  37. typedef struct _GAsyncResultIface GAsyncResultIface;
  38. /**
  39. * GAsyncResultIface:
  40. * @g_iface: The parent interface.
  41. * @get_user_data: Gets the user data passed to the callback.
  42. * @get_source_object: Gets the source object that issued the asynchronous operation.
  43. * @is_tagged: Checks if a result is tagged with a particular source.
  44. *
  45. * Interface definition for #GAsyncResult.
  46. **/
  47. struct _GAsyncResultIface
  48. {
  49. GTypeInterface g_iface;
  50. /* Virtual Table */
  51. gpointer (* get_user_data) (GAsyncResult *res);
  52. GObject * (* get_source_object) (GAsyncResult *res);
  53. gboolean (* is_tagged) (GAsyncResult *res,
  54. gpointer source_tag);
  55. };
  56. GLIB_AVAILABLE_IN_ALL
  57. GType g_async_result_get_type (void) G_GNUC_CONST;
  58. GLIB_AVAILABLE_IN_ALL
  59. gpointer g_async_result_get_user_data (GAsyncResult *res);
  60. GLIB_AVAILABLE_IN_ALL
  61. GObject *g_async_result_get_source_object (GAsyncResult *res);
  62. GLIB_AVAILABLE_IN_2_34
  63. gboolean g_async_result_legacy_propagate_error (GAsyncResult *res,
  64. GError **error);
  65. GLIB_AVAILABLE_IN_2_34
  66. gboolean g_async_result_is_tagged (GAsyncResult *res,
  67. gpointer source_tag);
  68. G_END_DECLS
  69. #endif /* __G_ASYNC_RESULT_H__ */