gmountoperation.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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_MOUNT_OPERATION_H__
  23. #define __G_MOUNT_OPERATION_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_MOUNT_OPERATION (g_mount_operation_get_type ())
  30. #define G_MOUNT_OPERATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_MOUNT_OPERATION, GMountOperation))
  31. #define G_MOUNT_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_MOUNT_OPERATION, GMountOperationClass))
  32. #define G_IS_MOUNT_OPERATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_MOUNT_OPERATION))
  33. #define G_IS_MOUNT_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_MOUNT_OPERATION))
  34. #define G_MOUNT_OPERATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_MOUNT_OPERATION, GMountOperationClass))
  35. typedef struct _GMountOperationClass GMountOperationClass;
  36. typedef struct _GMountOperationPrivate GMountOperationPrivate;
  37. struct _GMountOperation
  38. {
  39. GObject parent_instance;
  40. GMountOperationPrivate *priv;
  41. };
  42. struct _GMountOperationClass
  43. {
  44. GObjectClass parent_class;
  45. /* signals: */
  46. void (* ask_password) (GMountOperation *op,
  47. const char *message,
  48. const char *default_user,
  49. const char *default_domain,
  50. GAskPasswordFlags flags);
  51. /**
  52. * GMountOperationClass::ask_question:
  53. * @op: a #GMountOperation
  54. * @message: string containing a message to display to the user
  55. * @choices: (array zero-terminated=1) (element-type utf8): an array of
  56. * strings for each possible choice
  57. *
  58. * Virtual implementation of #GMountOperation::ask-question.
  59. */
  60. void (* ask_question) (GMountOperation *op,
  61. const char *message,
  62. const char *choices[]);
  63. void (* reply) (GMountOperation *op,
  64. GMountOperationResult result);
  65. void (* aborted) (GMountOperation *op);
  66. /**
  67. * GMountOperationClass::show_processes:
  68. * @op: a #GMountOperation
  69. * @message: string containing a message to display to the user
  70. * @processes: (element-type GPid): an array of #GPid for processes blocking
  71. * the operation
  72. * @choices: (array zero-terminated=1) (element-type utf8): an array of
  73. * strings for each possible choice
  74. *
  75. * Virtual implementation of #GMountOperation::show-processes.
  76. *
  77. * Since: 2.22
  78. */
  79. void (* show_processes) (GMountOperation *op,
  80. const gchar *message,
  81. GArray *processes,
  82. const gchar *choices[]);
  83. void (* show_unmount_progress) (GMountOperation *op,
  84. const gchar *message,
  85. gint64 time_left,
  86. gint64 bytes_left);
  87. /*< private >*/
  88. /* Padding for future expansion */
  89. void (*_g_reserved1) (void);
  90. void (*_g_reserved2) (void);
  91. void (*_g_reserved3) (void);
  92. void (*_g_reserved4) (void);
  93. void (*_g_reserved5) (void);
  94. void (*_g_reserved6) (void);
  95. void (*_g_reserved7) (void);
  96. void (*_g_reserved8) (void);
  97. void (*_g_reserved9) (void);
  98. };
  99. GIO_AVAILABLE_IN_ALL
  100. GType g_mount_operation_get_type (void) G_GNUC_CONST;
  101. GIO_AVAILABLE_IN_ALL
  102. GMountOperation * g_mount_operation_new (void);
  103. GIO_AVAILABLE_IN_ALL
  104. const char * g_mount_operation_get_username (GMountOperation *op);
  105. GIO_AVAILABLE_IN_ALL
  106. void g_mount_operation_set_username (GMountOperation *op,
  107. const char *username);
  108. GIO_AVAILABLE_IN_ALL
  109. const char * g_mount_operation_get_password (GMountOperation *op);
  110. GIO_AVAILABLE_IN_ALL
  111. void g_mount_operation_set_password (GMountOperation *op,
  112. const char *password);
  113. GIO_AVAILABLE_IN_ALL
  114. gboolean g_mount_operation_get_anonymous (GMountOperation *op);
  115. GIO_AVAILABLE_IN_ALL
  116. void g_mount_operation_set_anonymous (GMountOperation *op,
  117. gboolean anonymous);
  118. GIO_AVAILABLE_IN_ALL
  119. const char * g_mount_operation_get_domain (GMountOperation *op);
  120. GIO_AVAILABLE_IN_ALL
  121. void g_mount_operation_set_domain (GMountOperation *op,
  122. const char *domain);
  123. GIO_AVAILABLE_IN_ALL
  124. GPasswordSave g_mount_operation_get_password_save (GMountOperation *op);
  125. GIO_AVAILABLE_IN_ALL
  126. void g_mount_operation_set_password_save (GMountOperation *op,
  127. GPasswordSave save);
  128. GIO_AVAILABLE_IN_ALL
  129. int g_mount_operation_get_choice (GMountOperation *op);
  130. GIO_AVAILABLE_IN_ALL
  131. void g_mount_operation_set_choice (GMountOperation *op,
  132. int choice);
  133. GIO_AVAILABLE_IN_ALL
  134. void g_mount_operation_reply (GMountOperation *op,
  135. GMountOperationResult result);
  136. GIO_AVAILABLE_IN_2_58
  137. gboolean g_mount_operation_get_is_tcrypt_hidden_volume (GMountOperation *op);
  138. GIO_AVAILABLE_IN_2_58
  139. void g_mount_operation_set_is_tcrypt_hidden_volume (GMountOperation *op,
  140. gboolean hidden_volume);
  141. GIO_AVAILABLE_IN_2_58
  142. gboolean g_mount_operation_get_is_tcrypt_system_volume (GMountOperation *op);
  143. GIO_AVAILABLE_IN_2_58
  144. void g_mount_operation_set_is_tcrypt_system_volume (GMountOperation *op,
  145. gboolean system_volume);
  146. GIO_AVAILABLE_IN_2_58
  147. guint g_mount_operation_get_pim (GMountOperation *op);
  148. GIO_AVAILABLE_IN_2_58
  149. void g_mount_operation_set_pim (GMountOperation *op,
  150. guint pim);
  151. G_END_DECLS
  152. #endif /* __G_MOUNT_OPERATION_H__ */