gtlsinteraction.h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright (C) 2011 Collabora, Ltd.
  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: Stef Walter <[email protected]>
  19. */
  20. #ifndef __G_TLS_INTERACTION_H__
  21. #define __G_TLS_INTERACTION_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_TLS_INTERACTION (g_tls_interaction_get_type ())
  28. #define G_TLS_INTERACTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_TLS_INTERACTION, GTlsInteraction))
  29. #define G_TLS_INTERACTION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_TLS_INTERACTION, GTlsInteractionClass))
  30. #define G_IS_TLS_INTERACTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_TLS_INTERACTION))
  31. #define G_IS_TLS_INTERACTION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_TLS_INTERACTION))
  32. #define G_TLS_INTERACTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_TLS_INTERACTION, GTlsInteractionClass))
  33. typedef struct _GTlsInteractionClass GTlsInteractionClass;
  34. typedef struct _GTlsInteractionPrivate GTlsInteractionPrivate;
  35. struct _GTlsInteraction
  36. {
  37. /*< private >*/
  38. GObject parent_instance;
  39. GTlsInteractionPrivate *priv;
  40. };
  41. struct _GTlsInteractionClass
  42. {
  43. /*< private >*/
  44. GObjectClass parent_class;
  45. /*< public >*/
  46. GTlsInteractionResult (* ask_password) (GTlsInteraction *interaction,
  47. GTlsPassword *password,
  48. GCancellable *cancellable,
  49. GError **error);
  50. void (* ask_password_async) (GTlsInteraction *interaction,
  51. GTlsPassword *password,
  52. GCancellable *cancellable,
  53. GAsyncReadyCallback callback,
  54. gpointer user_data);
  55. GTlsInteractionResult (* ask_password_finish) (GTlsInteraction *interaction,
  56. GAsyncResult *result,
  57. GError **error);
  58. GTlsInteractionResult (* request_certificate) (GTlsInteraction *interaction,
  59. GTlsConnection *connection,
  60. GTlsCertificateRequestFlags flags,
  61. GCancellable *cancellable,
  62. GError **error);
  63. void (* request_certificate_async) (GTlsInteraction *interaction,
  64. GTlsConnection *connection,
  65. GTlsCertificateRequestFlags flags,
  66. GCancellable *cancellable,
  67. GAsyncReadyCallback callback,
  68. gpointer user_data);
  69. GTlsInteractionResult (* request_certificate_finish) (GTlsInteraction *interaction,
  70. GAsyncResult *result,
  71. GError **error);
  72. /*< private >*/
  73. /* Padding for future expansion */
  74. gpointer padding[21];
  75. };
  76. GLIB_AVAILABLE_IN_ALL
  77. GType g_tls_interaction_get_type (void) G_GNUC_CONST;
  78. GLIB_AVAILABLE_IN_ALL
  79. GTlsInteractionResult g_tls_interaction_invoke_ask_password (GTlsInteraction *interaction,
  80. GTlsPassword *password,
  81. GCancellable *cancellable,
  82. GError **error);
  83. GLIB_AVAILABLE_IN_ALL
  84. GTlsInteractionResult g_tls_interaction_ask_password (GTlsInteraction *interaction,
  85. GTlsPassword *password,
  86. GCancellable *cancellable,
  87. GError **error);
  88. GLIB_AVAILABLE_IN_ALL
  89. void g_tls_interaction_ask_password_async (GTlsInteraction *interaction,
  90. GTlsPassword *password,
  91. GCancellable *cancellable,
  92. GAsyncReadyCallback callback,
  93. gpointer user_data);
  94. GLIB_AVAILABLE_IN_ALL
  95. GTlsInteractionResult g_tls_interaction_ask_password_finish (GTlsInteraction *interaction,
  96. GAsyncResult *result,
  97. GError **error);
  98. GLIB_AVAILABLE_IN_2_40
  99. GTlsInteractionResult g_tls_interaction_invoke_request_certificate (GTlsInteraction *interaction,
  100. GTlsConnection *connection,
  101. GTlsCertificateRequestFlags flags,
  102. GCancellable *cancellable,
  103. GError **error);
  104. GLIB_AVAILABLE_IN_2_40
  105. GTlsInteractionResult g_tls_interaction_request_certificate (GTlsInteraction *interaction,
  106. GTlsConnection *connection,
  107. GTlsCertificateRequestFlags flags,
  108. GCancellable *cancellable,
  109. GError **error);
  110. GLIB_AVAILABLE_IN_2_40
  111. void g_tls_interaction_request_certificate_async (GTlsInteraction *interaction,
  112. GTlsConnection *connection,
  113. GTlsCertificateRequestFlags flags,
  114. GCancellable *cancellable,
  115. GAsyncReadyCallback callback,
  116. gpointer user_data);
  117. GLIB_AVAILABLE_IN_2_40
  118. GTlsInteractionResult g_tls_interaction_request_certificate_finish (GTlsInteraction *interaction,
  119. GAsyncResult *result,
  120. GError **error);
  121. G_END_DECLS
  122. #endif /* __G_TLS_INTERACTION_H__ */