File indexing completed on 2025-01-18 09:59:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #ifndef __G_DRIVE_H__
0025 #define __G_DRIVE_H__
0026
0027 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0028 #error "Only <gio/gio.h> can be included directly."
0029 #endif
0030
0031 #include <gio/giotypes.h>
0032
0033 G_BEGIN_DECLS
0034
0035
0036
0037
0038
0039
0040
0041
0042 #define G_DRIVE_IDENTIFIER_KIND_UNIX_DEVICE "unix-device"
0043
0044 #define G_TYPE_DRIVE (g_drive_get_type ())
0045 #define G_DRIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_DRIVE, GDrive))
0046 #define G_IS_DRIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_DRIVE))
0047 #define G_DRIVE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_DRIVE, GDriveIface))
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089 typedef struct _GDriveIface GDriveIface;
0090
0091 struct _GDriveIface
0092 {
0093 GTypeInterface g_iface;
0094
0095
0096 void (* changed) (GDrive *drive);
0097 void (* disconnected) (GDrive *drive);
0098 void (* eject_button) (GDrive *drive);
0099
0100
0101 char * (* get_name) (GDrive *drive);
0102 GIcon * (* get_icon) (GDrive *drive);
0103 gboolean (* has_volumes) (GDrive *drive);
0104 GList * (* get_volumes) (GDrive *drive);
0105 gboolean (* is_media_removable) (GDrive *drive);
0106 gboolean (* has_media) (GDrive *drive);
0107 gboolean (* is_media_check_automatic) (GDrive *drive);
0108 gboolean (* can_eject) (GDrive *drive);
0109 gboolean (* can_poll_for_media) (GDrive *drive);
0110 void (* eject) (GDrive *drive,
0111 GMountUnmountFlags flags,
0112 GCancellable *cancellable,
0113 GAsyncReadyCallback callback,
0114 gpointer user_data);
0115 gboolean (* eject_finish) (GDrive *drive,
0116 GAsyncResult *result,
0117 GError **error);
0118 void (* poll_for_media) (GDrive *drive,
0119 GCancellable *cancellable,
0120 GAsyncReadyCallback callback,
0121 gpointer user_data);
0122 gboolean (* poll_for_media_finish) (GDrive *drive,
0123 GAsyncResult *result,
0124 GError **error);
0125
0126 char * (* get_identifier) (GDrive *drive,
0127 const char *kind);
0128 char ** (* enumerate_identifiers) (GDrive *drive);
0129
0130 GDriveStartStopType (* get_start_stop_type) (GDrive *drive);
0131
0132 gboolean (* can_start) (GDrive *drive);
0133 gboolean (* can_start_degraded) (GDrive *drive);
0134 void (* start) (GDrive *drive,
0135 GDriveStartFlags flags,
0136 GMountOperation *mount_operation,
0137 GCancellable *cancellable,
0138 GAsyncReadyCallback callback,
0139 gpointer user_data);
0140 gboolean (* start_finish) (GDrive *drive,
0141 GAsyncResult *result,
0142 GError **error);
0143
0144 gboolean (* can_stop) (GDrive *drive);
0145 void (* stop) (GDrive *drive,
0146 GMountUnmountFlags flags,
0147 GMountOperation *mount_operation,
0148 GCancellable *cancellable,
0149 GAsyncReadyCallback callback,
0150 gpointer user_data);
0151 gboolean (* stop_finish) (GDrive *drive,
0152 GAsyncResult *result,
0153 GError **error);
0154
0155 void (* stop_button) (GDrive *drive);
0156
0157 void (* eject_with_operation) (GDrive *drive,
0158 GMountUnmountFlags flags,
0159 GMountOperation *mount_operation,
0160 GCancellable *cancellable,
0161 GAsyncReadyCallback callback,
0162 gpointer user_data);
0163 gboolean (* eject_with_operation_finish) (GDrive *drive,
0164 GAsyncResult *result,
0165 GError **error);
0166
0167 const gchar * (* get_sort_key) (GDrive *drive);
0168 GIcon * (* get_symbolic_icon) (GDrive *drive);
0169 gboolean (* is_removable) (GDrive *drive);
0170
0171 };
0172
0173 GIO_AVAILABLE_IN_ALL
0174 GType g_drive_get_type (void) G_GNUC_CONST;
0175
0176 GIO_AVAILABLE_IN_ALL
0177 char * g_drive_get_name (GDrive *drive);
0178 GIO_AVAILABLE_IN_ALL
0179 GIcon * g_drive_get_icon (GDrive *drive);
0180 GIO_AVAILABLE_IN_ALL
0181 GIcon * g_drive_get_symbolic_icon (GDrive *drive);
0182 GIO_AVAILABLE_IN_ALL
0183 gboolean g_drive_has_volumes (GDrive *drive);
0184 GIO_AVAILABLE_IN_ALL
0185 GList * g_drive_get_volumes (GDrive *drive);
0186 GIO_AVAILABLE_IN_2_50
0187 gboolean g_drive_is_removable (GDrive *drive);
0188 GIO_AVAILABLE_IN_ALL
0189 gboolean g_drive_is_media_removable (GDrive *drive);
0190 GIO_AVAILABLE_IN_ALL
0191 gboolean g_drive_has_media (GDrive *drive);
0192 GIO_AVAILABLE_IN_ALL
0193 gboolean g_drive_is_media_check_automatic (GDrive *drive);
0194 GIO_AVAILABLE_IN_ALL
0195 gboolean g_drive_can_poll_for_media (GDrive *drive);
0196 GIO_AVAILABLE_IN_ALL
0197 gboolean g_drive_can_eject (GDrive *drive);
0198 GIO_DEPRECATED_FOR(g_drive_eject_with_operation)
0199 void g_drive_eject (GDrive *drive,
0200 GMountUnmountFlags flags,
0201 GCancellable *cancellable,
0202 GAsyncReadyCallback callback,
0203 gpointer user_data);
0204
0205 GIO_DEPRECATED_FOR(g_drive_eject_with_operation_finish)
0206 gboolean g_drive_eject_finish (GDrive *drive,
0207 GAsyncResult *result,
0208 GError **error);
0209 GIO_AVAILABLE_IN_ALL
0210 void g_drive_poll_for_media (GDrive *drive,
0211 GCancellable *cancellable,
0212 GAsyncReadyCallback callback,
0213 gpointer user_data);
0214 GIO_AVAILABLE_IN_ALL
0215 gboolean g_drive_poll_for_media_finish (GDrive *drive,
0216 GAsyncResult *result,
0217 GError **error);
0218 GIO_AVAILABLE_IN_ALL
0219 char * g_drive_get_identifier (GDrive *drive,
0220 const char *kind);
0221 GIO_AVAILABLE_IN_ALL
0222 char ** g_drive_enumerate_identifiers (GDrive *drive);
0223
0224 GIO_AVAILABLE_IN_ALL
0225 GDriveStartStopType g_drive_get_start_stop_type (GDrive *drive);
0226
0227 GIO_AVAILABLE_IN_ALL
0228 gboolean g_drive_can_start (GDrive *drive);
0229 GIO_AVAILABLE_IN_ALL
0230 gboolean g_drive_can_start_degraded (GDrive *drive);
0231 GIO_AVAILABLE_IN_ALL
0232 void g_drive_start (GDrive *drive,
0233 GDriveStartFlags flags,
0234 GMountOperation *mount_operation,
0235 GCancellable *cancellable,
0236 GAsyncReadyCallback callback,
0237 gpointer user_data);
0238 GIO_AVAILABLE_IN_ALL
0239 gboolean g_drive_start_finish (GDrive *drive,
0240 GAsyncResult *result,
0241 GError **error);
0242
0243 GIO_AVAILABLE_IN_ALL
0244 gboolean g_drive_can_stop (GDrive *drive);
0245 GIO_AVAILABLE_IN_ALL
0246 void g_drive_stop (GDrive *drive,
0247 GMountUnmountFlags flags,
0248 GMountOperation *mount_operation,
0249 GCancellable *cancellable,
0250 GAsyncReadyCallback callback,
0251 gpointer user_data);
0252 GIO_AVAILABLE_IN_ALL
0253 gboolean g_drive_stop_finish (GDrive *drive,
0254 GAsyncResult *result,
0255 GError **error);
0256
0257 GIO_AVAILABLE_IN_ALL
0258 void g_drive_eject_with_operation (GDrive *drive,
0259 GMountUnmountFlags flags,
0260 GMountOperation *mount_operation,
0261 GCancellable *cancellable,
0262 GAsyncReadyCallback callback,
0263 gpointer user_data);
0264 GIO_AVAILABLE_IN_ALL
0265 gboolean g_drive_eject_with_operation_finish (GDrive *drive,
0266 GAsyncResult *result,
0267 GError **error);
0268
0269 GIO_AVAILABLE_IN_2_32
0270 const gchar *g_drive_get_sort_key (GDrive *drive);
0271
0272 G_END_DECLS
0273
0274 #endif