gmountoperation.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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_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. void (* ask_question) (GMountOperation *op,
  56. const char *message,
  57. const char *choices[]);
  58. void (* reply) (GMountOperation *op,
  59. GMountOperationResult result);
  60. void (* aborted) (GMountOperation *op);
  61. void (* show_processes) (GMountOperation *op,
  62. const gchar *message,
  63. GArray *processes,
  64. const gchar *choices[]);
  65. void (* show_unmount_progress) (GMountOperation *op,
  66. const gchar *message,
  67. gint64 time_left,
  68. gint64 bytes_left);
  69. /*< private >*/
  70. /* Padding for future expansion */
  71. void (*_g_reserved1) (void);
  72. void (*_g_reserved2) (void);
  73. void (*_g_reserved3) (void);
  74. void (*_g_reserved4) (void);
  75. void (*_g_reserved5) (void);
  76. void (*_g_reserved6) (void);
  77. void (*_g_reserved7) (void);
  78. void (*_g_reserved8) (void);
  79. void (*_g_reserved9) (void);
  80. };
  81. GLIB_AVAILABLE_IN_ALL
  82. GType g_mount_operation_get_type (void) G_GNUC_CONST;
  83. GLIB_AVAILABLE_IN_ALL
  84. GMountOperation * g_mount_operation_new (void);
  85. GLIB_AVAILABLE_IN_ALL
  86. const char * g_mount_operation_get_username (GMountOperation *op);
  87. GLIB_AVAILABLE_IN_ALL
  88. void g_mount_operation_set_username (GMountOperation *op,
  89. const char *username);
  90. GLIB_AVAILABLE_IN_ALL
  91. const char * g_mount_operation_get_password (GMountOperation *op);
  92. GLIB_AVAILABLE_IN_ALL
  93. void g_mount_operation_set_password (GMountOperation *op,
  94. const char *password);
  95. GLIB_AVAILABLE_IN_ALL
  96. gboolean g_mount_operation_get_anonymous (GMountOperation *op);
  97. GLIB_AVAILABLE_IN_ALL
  98. void g_mount_operation_set_anonymous (GMountOperation *op,
  99. gboolean anonymous);
  100. GLIB_AVAILABLE_IN_ALL
  101. const char * g_mount_operation_get_domain (GMountOperation *op);
  102. GLIB_AVAILABLE_IN_ALL
  103. void g_mount_operation_set_domain (GMountOperation *op,
  104. const char *domain);
  105. GLIB_AVAILABLE_IN_ALL
  106. GPasswordSave g_mount_operation_get_password_save (GMountOperation *op);
  107. GLIB_AVAILABLE_IN_ALL
  108. void g_mount_operation_set_password_save (GMountOperation *op,
  109. GPasswordSave save);
  110. GLIB_AVAILABLE_IN_ALL
  111. int g_mount_operation_get_choice (GMountOperation *op);
  112. GLIB_AVAILABLE_IN_ALL
  113. void g_mount_operation_set_choice (GMountOperation *op,
  114. int choice);
  115. GLIB_AVAILABLE_IN_ALL
  116. void g_mount_operation_reply (GMountOperation *op,
  117. GMountOperationResult result);
  118. G_END_DECLS
  119. #endif /* __G_MOUNT_OPERATION_H__ */