gmountoperation.h 6.6 KB

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