File indexing completed on 2025-01-18 09:59:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef __G_PERMISSION_H__
0023 #define __G_PERMISSION_H__
0024
0025 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0026 #error "Only <gio/gio.h> can be included directly."
0027 #endif
0028
0029 #include <gio/giotypes.h>
0030
0031 G_BEGIN_DECLS
0032
0033 #define G_TYPE_PERMISSION (g_permission_get_type ())
0034 #define G_PERMISSION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
0035 G_TYPE_PERMISSION, GPermission))
0036 #define G_PERMISSION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
0037 G_TYPE_PERMISSION, GPermissionClass))
0038 #define G_IS_PERMISSION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
0039 G_TYPE_PERMISSION))
0040 #define G_IS_PERMISSION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
0041 G_TYPE_PERMISSION))
0042 #define G_PERMISSION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
0043 G_TYPE_PERMISSION, GPermissionClass))
0044
0045 typedef struct _GPermissionPrivate GPermissionPrivate;
0046 typedef struct _GPermissionClass GPermissionClass;
0047
0048 struct _GPermission
0049 {
0050 GObject parent_instance;
0051
0052
0053 GPermissionPrivate *priv;
0054 };
0055
0056 struct _GPermissionClass {
0057 GObjectClass parent_class;
0058
0059 gboolean (*acquire) (GPermission *permission,
0060 GCancellable *cancellable,
0061 GError **error);
0062 void (*acquire_async) (GPermission *permission,
0063 GCancellable *cancellable,
0064 GAsyncReadyCallback callback,
0065 gpointer user_data);
0066 gboolean (*acquire_finish) (GPermission *permission,
0067 GAsyncResult *result,
0068 GError **error);
0069
0070 gboolean (*release) (GPermission *permission,
0071 GCancellable *cancellable,
0072 GError **error);
0073 void (*release_async) (GPermission *permission,
0074 GCancellable *cancellable,
0075 GAsyncReadyCallback callback,
0076 gpointer user_data);
0077 gboolean (*release_finish) (GPermission *permission,
0078 GAsyncResult *result,
0079 GError **error);
0080
0081 gpointer reserved[16];
0082 };
0083
0084 GIO_AVAILABLE_IN_ALL
0085 GType g_permission_get_type (void);
0086 GIO_AVAILABLE_IN_ALL
0087 gboolean g_permission_acquire (GPermission *permission,
0088 GCancellable *cancellable,
0089 GError **error);
0090 GIO_AVAILABLE_IN_ALL
0091 void g_permission_acquire_async (GPermission *permission,
0092 GCancellable *cancellable,
0093 GAsyncReadyCallback callback,
0094 gpointer user_data);
0095 GIO_AVAILABLE_IN_ALL
0096 gboolean g_permission_acquire_finish (GPermission *permission,
0097 GAsyncResult *result,
0098 GError **error);
0099
0100 GIO_AVAILABLE_IN_ALL
0101 gboolean g_permission_release (GPermission *permission,
0102 GCancellable *cancellable,
0103 GError **error);
0104 GIO_AVAILABLE_IN_ALL
0105 void g_permission_release_async (GPermission *permission,
0106 GCancellable *cancellable,
0107 GAsyncReadyCallback callback,
0108 gpointer user_data);
0109 GIO_AVAILABLE_IN_ALL
0110 gboolean g_permission_release_finish (GPermission *permission,
0111 GAsyncResult *result,
0112 GError **error);
0113
0114 GIO_AVAILABLE_IN_ALL
0115 gboolean g_permission_get_allowed (GPermission *permission);
0116 GIO_AVAILABLE_IN_ALL
0117 gboolean g_permission_get_can_acquire (GPermission *permission);
0118 GIO_AVAILABLE_IN_ALL
0119 gboolean g_permission_get_can_release (GPermission *permission);
0120
0121 GIO_AVAILABLE_IN_ALL
0122 void g_permission_impl_update (GPermission *permission,
0123 gboolean allowed,
0124 gboolean can_acquire,
0125 gboolean can_release);
0126
0127 G_END_DECLS
0128
0129 #endif