SimplePermission

gio.simple_permission.SimplePermission is a trivial implementation of gio.permission.Permission that represents a permission that is either always or never allowed. The value is given at construction and doesn’t change.

Calling gio.permission.Permission.acquire or gio.permission.Permission.release on a gio.simple_permission.SimplePermission will result in errors.

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this(bool allowed)

Creates a new #GPermission instance that represents an action that is either always or never allowed.

Members

Functions

self
SimplePermission self()

Returns this, for use in with statements.

Properties

gType
GType gType [@property getter]

Static functions

getGType
GType getGType()

Inherited Members

From Permission

getGType
GType getGType()
gType
GType gType [@property getter]
self
Permission self()

Returns this, for use in with statements.

acquire
bool acquire(gio.cancellable.Cancellable cancellable)

Attempts to acquire the permission represented by permission.

acquireAsync
void acquireAsync(gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Attempts to acquire the permission represented by permission.

acquireFinish
bool acquireFinish(gio.async_result.AsyncResult result)

Collects the result of attempting to acquire the permission represented by permission.

getAllowed
bool getAllowed()

Gets the value of the 'allowed' property. This property is true if the caller currently has permission to perform the action that permission represents the permission to perform.

getCanAcquire
bool getCanAcquire()

Gets the value of the 'can-acquire' property. This property is true if it is generally possible to acquire the permission by calling gio.permission.Permission.acquire.

getCanRelease
bool getCanRelease()

Gets the value of the 'can-release' property. This property is true if it is generally possible to release the permission by calling gio.permission.Permission.release.

implUpdate
void implUpdate(bool allowed, bool canAcquire, bool canRelease)

This function is called by the #GPermission implementation to update the properties of the permission. You should never call this function except from a #GPermission implementation.

release
bool release(gio.cancellable.Cancellable cancellable)

Attempts to release the permission represented by permission.

releaseAsync
void releaseAsync(gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Attempts to release the permission represented by permission.

releaseFinish
bool releaseFinish(gio.async_result.AsyncResult result)

Collects the result of attempting to release the permission represented by permission.