gtlsinteraction.h 8.2 KB

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